Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
SocCamera::tcSavableSensorBoard Class Reference

#include <SavableSensorBoard.h>

Inheritance diagram for SocCamera::tcSavableSensorBoard:
Collaboration diagram for SocCamera::tcSavableSensorBoard:

Public Member Functions

 tcSavableSensorBoard (tcSensorBoard *apBoard)
 
virtual ~tcSavableSensorBoard ()
 
virtual int GetCameraInfo (tsCameraInfo *apInfo)
 
virtual teNackCode calibrate ()
 
virtual void snap (tsCaptureRequest asSnapRequest)
 
virtual int32 initialize ()
 
virtual teNackCode setExposure (int32 anMicroseconds, uint32_t anExpIndex=0) override
 
virtual int32 getExposure (uint32_t anExpIndex=0) override
 
virtual teNackCode setFrameInterval (int32 anMicroseconds)
 
virtual int32 getFrameInterval ()
 
virtual teNackCode setROI (ROI region)
 
virtual ROI getROI ()
 
virtual ROI getImageROI ()
 
virtual teNackCode setVerticalBin (int32 anPixels)
 
virtual int32 getVerticalBin ()
 
virtual teNackCode setHorizontalBin (int32 anPixels)
 
virtual int32 getHorizontalBin ()
 
virtual teNackCode setShutterMode (teShutterMode eeMode)
 
virtual int32 getShutterMode ()
 
virtual teNackCode setBPP (teBPPMode eeMode)
 
virtual teNackCode setTestPattern (teTestPattern eeSelection)
 
virtual int32 getTestPattern ()
 
virtual teNackCode setTrigger (teTriggerMode eeTrigger)
 
virtual int32 getTrigger ()
 
virtual teNackCode peek (int32 anRegister, int *apValue)
 
virtual teNackCode poke (int32 anRegister, int32 anValue)
 
virtual int32 validate ()
 
virtual bool isCapturing ()
 
virtual teNackCode start ()
 
virtual teNackCode stop ()
 
virtual std::string getTemperature (int32 anSensor=0)
 
virtual float getTempCelsius ()
 
virtual std::string getVersion ()
 
virtual teNackCode save (int32 anConfiguration)
 
virtual teNackCode recall (int32 anConfiguration)
 
virtual teNackCode setIODirection (int32 anPin, int32 anDirection)
 
virtual teNackCode setIOValue (int32 anPin, int32 anValue)
 
virtual teNackCode power (bool abOn)
 
virtual int32 getIODirection ()
 
virtual int32 getIOValue ()
 
virtual tcRAMStreamergetStreamer ()
 
virtual tcTimestamp * getTimestamper ()
 
virtual tcSensorBoardself ()
 
- Public Member Functions inherited from SocCamera::tcSensorBoard
 tcSensorBoard (int aeType, uint32 anStreamAddr, int32 length, int32 *aaGpioNum)
 
 tcSensorBoard (int aeType, uint32_t anFpgaBaseAddr, uint32_t anRamStreamAddr, int32 length, int32 *aaGpioNum)
 
virtual ~tcSensorBoard ()
 
int id ()
 
int32 init ()
 
virtual tcAbstractHandlergetCustomHandlers (tcAbstractHandler *apTailHandler, std::map< std::string, tcAbstractHandler * > *apStringMap)
 
virtual void resetFpga ()
 
virtual uint64_t fpgaVersion ()
 
virtual void update (tsUpdate asMessage)
 
virtual teNackCode whiteLevelCalibrate ()
 
virtual teNackCode setClockSetting (int32 anSetting)
 
virtual teNackCode getClockSetting (int32 &arSetting)
 
teNackCode setExposure (std::chrono::microseconds anMicroseconds, uint32_t anExpIndex=0)
 
virtual uint32 getMinFrameIntervalMicroS ()
 
std::chrono::microseconds getMinFrameInterval ()
 
teNackCode setFrameInterval (std::chrono::microseconds anMicroseconds)
 
virtual teNackCode setColor (bool)
 
virtual float getBoardTempCelsius ()
 
virtual teNackCode setIOInverter (int32 anPinNum, int32 anInvertEnable)
 tcSensorBoard::setIOInverter Sets the camera GPIO invert state. More...
 
virtual int32 getNumPins ()
 
virtual teNackCode setMirroring (bool isX, bool Enabled)
 
virtual teNackCode getMirroring (bool isX, bool *Enabled)
 
virtual teNackCode setNoiseReduct (bool enHi, uint16_t threshhi, bool enLo, uint16_t threshlo)
 
virtual teNackCode getNoiseReduct (bool &enHi, uint16_t &threshhi, bool &enLo, uint16_t &threshlo)
 
virtual teNackCode setSqrtCompression (bool enable)
 
virtual teNackCode getSqrtCompression (bool &enable)
 
virtual teNackCode setDemoMode (int32 anMode)
 
virtual teNackCode getDemoMode (int32 &arMode)
 
virtual teNackCode loadColumnBias (const char *asFilename)
 
virtual teNackCode loadColumnGain (const char *asFilename)
 
virtual teNackCode loadPixelCal (const char *asFilename)
 
virtual void setTimestamper (tcTimestamp *apStamper)
 
uint32 getFrameSizeBytes ()
 
int getSysIdNumber (unsigned short &major, unsigned short &minor)
 
uint32 getMaxImgCount ()
 
uint32 getNumSnapFramesLeft ()
 
virtual void Handler (unsigned int gpionum, unsigned int val)
 Handler GPIO Handler notifies changes on any gpio with edges enabled. More...
 
virtual uint32 getPixelFormat (void)
 Get the pixel format generated by the pixel pipeline. More...
 
virtual tcVoltageSensorgetVoltageSensor ()
 get the temperature monitor object for this sensor More...
 
virtual tcTemperatureSensorgetTempSensor ()
 get the tcTemperature monitor object for this sensor More...
 
virtual void runPeriodic ()
 can be called by framework to do any periodic work. More...
 
virtual int32_t getSensorWidth ()
 
virtual int32_t getSensorHeight ()
 
- Public Member Functions inherited from tcObserver
 tcObserver ()
 
virtual ~tcObserver ()
 

Additional Inherited Members

- Static Public Attributes inherited from SocCamera::tcSensorBoard
static const std::string NO_TEMPERATURE_SENSOR
 
static const std::string TEMPERATURE_SENSOR_ERROR
 
- Protected Member Functions inherited from SocCamera::tcSensorBoard
void nextRequest ()
 
void initGpios (int32 length, int32 *aaGpioNum)
 
virtual uint32 GetSkipFrames (bool &reload)
 GetSkipFrames If the current sensor needs to skip initially received frames, they can overload this function, which will be called immediately prior to a ::start() call, to set the number of frames to skip. This only works with the RAMStreamer image data. More...
 
uint32 ConvertPixelFormat (uint32 anFormat, bool abFlipX, bool abFlipY)
 Utility routine to convert PFNC pixel format given flip options. More...
 
teNackCode GetA10BoardTemp (uint32 anIndex, float &anTemp)
 Utility routine to get the temp sensor readings off an A10 processor card. More...
 
- Protected Attributes inherited from SocCamera::tcSensorBoard
bool mbIsPowered
 
tcMutex mhMutex
 
MityDSP::tcGpio * mpCamIO
 
MityDSP::tcGpio::PinConfig * maPinConfigs
 
int32 mnPinCount
 
tcRAMStreamermpStreamer
 
std::map< int, std::pair< tcIntAccessor *, IntAccessorFunction > > mhPeekMap
 
std::map< int, std::pair< tcIntSetter *, IntSetterFunction > > mhPokeMap
 
tcPollingInterruptThread mcInterruptThread
 
MityDSP::tcAD741x * mpTempSensor
 
uint32 mnMaxImgCount
 
const sensors_chip_name * mpChipnameAD7414
 lmsensors chipname for AD7414 on A10/CV More...
 
const sensors_chip_name * mpChipnameLM95235
 lmsensors chipname for LM95235 on A10 More...
 
int mnAD7414_sf
 TEMP input subfeature number needed to get the actual temperature. More...
 
int mnLM95235_die_sf
 TEMP input subfeature for die temperature (CPU) sensor. More...
 
int mnLM95235_board_sf
 TEMP input subfeature for on-chip sensor. More...
 

Constructor & Destructor Documentation

◆ tcSavableSensorBoard()

tcSavableSensorBoard::tcSavableSensorBoard ( tcSensorBoard apBoard)

◆ ~tcSavableSensorBoard()

tcSavableSensorBoard::~tcSavableSensorBoard ( )
virtual

Member Function Documentation

◆ calibrate()

teNackCode tcSavableSensorBoard::calibrate ( )
virtual

Perform calibration routine for the camera.

Returns
the nack code.

Reimplemented from SocCamera::tcSensorBoard.

◆ GetCameraInfo()

virtual int SocCamera::tcSavableSensorBoard::GetCameraInfo ( tsCameraInfo apInfo)
inlinevirtual

Get the camera info for the given sensor board.

Parameters
apInfo- pointer to camera structure to fill in.
Returns
zero on success.

Implements SocCamera::tcSensorBoard.

◆ getExposure()

int32 tcSavableSensorBoard::getExposure ( uint32_t  anExpIndex = 0)
overridevirtual

Returns the currently set exposure time in microseconds.

Returns
an int32 for the number of microseconds the exposure is set to.

Implements SocCamera::tcSensorBoard.

◆ getFrameInterval()

int32 tcSavableSensorBoard::getFrameInterval ( )
virtual

Returns the frame interval time in microseconds.

Returns
an int32 for the number of microseconds the interval is set to.

Implements SocCamera::tcSensorBoard.

◆ getHorizontalBin()

int32 tcSavableSensorBoard::getHorizontalBin ( )
virtual

Gets the currently set horizontal binning factor being used.

Returns
an int32 - the number of pixels being binned horizontally

Implements SocCamera::tcSensorBoard.

◆ getImageROI()

ROI SocCamera::tcSavableSensorBoard::getImageROI ( )
virtual

Forwards to the underlying sensor.

Returns
the underlying sensor's image ROI

Reimplemented from SocCamera::tcSensorBoard.

◆ getIODirection()

int32 tcSavableSensorBoard::getIODirection ( )
virtual

Returns the current direction of the pins as a bit mask where the position of the bit is the gpio and a non-zero value indicates an output.

Returns
The bit mask of the directions; non-zero is output, 0 is input and each bit corresponds to the IO pin.

Reimplemented from SocCamera::tcSensorBoard.

◆ getIOValue()

int32 tcSavableSensorBoard::getIOValue ( )
virtual

Returns the current value of the pins; if the pin is an input, this is the value read. If the pin is an output, this is the value it is driving.

Returns
The bit mask of pin values being read or driven.

Reimplemented from SocCamera::tcSensorBoard.

◆ getROI()

ROI tcSavableSensorBoard::getROI ( )
virtual

Returns the currently set region of interest for the camera.

Returns
the ROI the sensor will produce.

Implements SocCamera::tcSensorBoard.

◆ getShutterMode()

int32 tcSavableSensorBoard::getShutterMode ( )
virtual

Returns the current shutter mode of the camera.

Returns
an int32 from eeShutterModes to state the shutter mode of the camera

Implements SocCamera::tcSensorBoard.

◆ getStreamer()

tcRAMStreamer * tcSavableSensorBoard::getStreamer ( )
virtual

Gets the RAM streamer component reference to share with IOChannel objects.

Returns
A pointer to the shared RAMStreamer object.

Reimplemented from SocCamera::tcSensorBoard.

◆ getTempCelsius()

float tcSavableSensorBoard::getTempCelsius ( )
virtual

A default temperature accessor that returns a single sensor's reading in celsius.

Returns
-275.0f (no sensor)

Reimplemented from SocCamera::tcSensorBoard.

◆ getTemperature()

std::string tcSavableSensorBoard::getTemperature ( int32  anSensor = 0)
virtual

Returns the temperature for the sensor specified if there are multiple. This function returns tcSensorBoard::NO_TEMPERATURE_SENSOR (below absolute 0) if not implemented for a specific sensor.

Parameters
anSensor- the sensor to request.
Returns
the response as a string. this may be information about the lack of a sensor etc.

Implements SocCamera::tcSensorBoard.

◆ getTestPattern()

int32 tcSavableSensorBoard::getTestPattern ( )
virtual

Get the currently set test pattern from eeTestPatterns.

Returns
an int32 - the current test pattern from eeTestPatterns

Implements SocCamera::tcSensorBoard.

◆ getTimestamper()

tcTimestamp * SocCamera::tcSavableSensorBoard::getTimestamper ( )
virtual

Gets the Timestamp component to share with other objects.

Returns
a pointer to the shared Timestamp object.

Reimplemented from SocCamera::tcSensorBoard.

◆ getTrigger()

int32 tcSavableSensorBoard::getTrigger ( )
virtual

Returns the currently set trigger mode.

Returns
an int32 - the current trigger from eeTriggerModes

Implements SocCamera::tcSensorBoard.

◆ getVersion()

std::string tcSavableSensorBoard::getVersion ( )
virtual

Get the chip version of the sensor board if possible.

Returns
a string with the chip version.

Implements SocCamera::tcSensorBoard.

◆ getVerticalBin()

int32 tcSavableSensorBoard::getVerticalBin ( )
virtual

Gets the currently set vertical binnign factor being used.

Returns
an int32 - the number of pixels being binned vertically

Implements SocCamera::tcSensorBoard.

◆ initialize()

int32 tcSavableSensorBoard::initialize ( )
virtual

Performs the operations of initialization. This consists of power up, setting default register values and configuring peripherals.

Returns
an int32 for the status; 0 if successful, non zero for error.

Implements SocCamera::tcSensorBoard.

◆ isCapturing()

bool tcSavableSensorBoard::isCapturing ( )
virtual

Test if the camera is currently capturing. Used to prevent setting certain paramters when the device is capturing.

Returns
a bool - true if the camera is currently capturing; false otherwise

Implements SocCamera::tcSensorBoard.

◆ peek()

teNackCode tcSavableSensorBoard::peek ( int32  anRegister,
int *  apValue 
)
virtual

Gets the current value of a register according to the document defining the behavior of the concrete class.

Parameters
anRegister- an int32 - the register to look at.
apValue- a pointer to a location to store the value read back
Returns
an int32 - the value from the register; 0 if the register was invalid.

Reimplemented from SocCamera::tcSensorBoard.

◆ poke()

teNackCode tcSavableSensorBoard::poke ( int32  anRegister,
int32  anValue 
)
virtual

Sets a register according to the document defining the behavior of the concrete class.

Parameters
anRegister- an int32 - the register to set.
anValue- an int32 - the value to set the register to.
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Reimplemented from SocCamera::tcSensorBoard.

◆ power()

teNackCode tcSavableSensorBoard::power ( bool  abOn)
virtual

Toggle power on the sensor board; hook provides no functionality.

Parameters
abOn- true to turn power on; false to turn it off.
Returns
0 for success; non-zero for failure.

Reimplemented from SocCamera::tcSensorBoard.

◆ recall()

teNackCode tcSavableSensorBoard::recall ( int32  anConfiguration)
virtual

Recall a configuration identified by anConfiguration.

Parameters
anConfiguration- an int32 specifying the config to recall
Returns
the teNackCode that fits the situation.

Implements SocCamera::tcSensorBoard.

◆ save()

teNackCode tcSavableSensorBoard::save ( int32  anConfiguration)
virtual

Saves a configuration identified by anConfiguration.

Parameters
anConfiguration- an int32 specifying the config to recall
Returns
the teNackCode that fits the situation

Implements SocCamera::tcSensorBoard.

◆ self()

tcSensorBoard * tcSavableSensorBoard::self ( )
virtual

Returns itself or a pointer to the object being controlled.

Returns
a pointer to the underlying sensorboard.

Reimplemented from SocCamera::tcSensorBoard.

◆ setBPP()

teNackCode tcSavableSensorBoard::setBPP ( teBPPMode  eeMode)
virtual

A request to set the BPP mode of the camera.

Parameters
eeMode- an int32 from eeBPPMode for the mode to enter
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setExposure()

teNackCode tcSavableSensorBoard::setExposure ( int32  anMicroseconds,
uint32_t  anExpIndex = 0 
)
overridevirtual

Sets the exposure time to the nearest valid exposure time which is greater than the parameter.

Parameters
anMicroseconds- an int32 - the number of microseconds the exposure should be
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setFrameInterval()

teNackCode tcSavableSensorBoard::setFrameInterval ( int32  anMicroseconds)
virtual

Sets the frame interval to the nearest valid interval time which is shorter than the paramter.

Parameters
anMicroseconds- an int32 - the number of microseconds the frame interval time should be
Returns
an int32 for the status; 0 if successful, non-zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setHorizontalBin()

teNackCode tcSavableSensorBoard::setHorizontalBin ( int32  anPixels)
virtual

A request to set the horizontal binning factor of the camera.

Parameters
anPixels- an int32 - the number of pixels to bin horizontally
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setIODirection()

teNackCode tcSavableSensorBoard::setIODirection ( int32  anPin,
int32  anDirection 
)
virtual

Sets the direction of the pins. Use 0 to set the pin to input and 1 to set an output. Uses the input as a bit mask.

Bits in the mask set beyond 0 through (length-1) are ignored and no error is reported.

Parameters
anMask- an int32 - the mask to use.
Returns
Zero if successful, non-zero otherwise.

Reimplemented from SocCamera::tcSensorBoard.

◆ setIOValue()

teNackCode tcSavableSensorBoard::setIOValue ( int32  anPin,
int32  anValue 
)
virtual

Sets the value of the pins which are outputs. If the pin is an input, the value is ignored.

Bits in the mask set beyond 0 through (length-1) are ignored and no error is reported.

Parameters
anMask- the mask of values to write out to the outputs.
Returns
Zero if successful, non-zero otherwise.

Reimplemented from SocCamera::tcSensorBoard.

◆ setROI()

teNackCode tcSavableSensorBoard::setROI ( ROI  region)
virtual

Sets the ROI from the sensor's perspective; binning will reduce the the actual number of pixels in a frame.

Parameters
region- ROI struct - dictates the top left of the region and the size.
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setShutterMode()

teNackCode tcSavableSensorBoard::setShutterMode ( teShutterMode  eeMode)
virtual

A request to set the shutter mode of the camera.

Parameters
eeMode- an int32 from eeShutterMode to place the camera into.
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setTestPattern()

teNackCode tcSavableSensorBoard::setTestPattern ( teTestPattern  eeSelection)
virtual

Request to set the test pattern from eeTestPatterns.

Parameters
eeSelection- an int32 from eeTestPatterns for which pattern to use
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setTrigger()

teNackCode tcSavableSensorBoard::setTrigger ( teTriggerMode  eeTrigger)
virtual

Selects the trigger mode to use.

Parameters
eeTrigger- an int32 from eeTriggerModes
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ setVerticalBin()

teNackCode tcSavableSensorBoard::setVerticalBin ( int32  anPixels)
virtual

A request to set the vertical binning factor of the camera.

Parameters
anPixels- an int32 - the number of pixels to bin vertically
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ snap()

void tcSavableSensorBoard::snap ( tsCaptureRequest  asSnapRequest)
virtual

Queue the request for images to be asynchronously fulfilled.

Parameters
asSnapRequest- the snap request message.

Reimplemented from SocCamera::tcSensorBoard.

◆ start()

teNackCode tcSavableSensorBoard::start ( )
virtual

Request to start capturing if configuration is valid.

Returns
an int32 for the status; 0 if successful and camera is now capturing, non zero corresponding to the appropriate NACK value if not capturing.

Implements SocCamera::tcSensorBoard.

◆ stop()

teNackCode tcSavableSensorBoard::stop ( )
virtual

Request to stop the camera from capturing.

Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.

◆ validate()

int32 tcSavableSensorBoard::validate ( )
virtual

Checks if the current configuration is valid and can be applied when trying to begin capturing.

Returns
an int32 for the status; 0 if valid, non zero corresponding to the appropriate NACK value.

Implements SocCamera::tcSensorBoard.


The documentation for this class was generated from the following files: