Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
SocCamera::tcSensorBoard Class Referenceabstract

#include <SensorBoard.h>

Inheritance diagram for SocCamera::tcSensorBoard:
Collaboration diagram for SocCamera::tcSensorBoard:

Public Member Functions

 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 int GetCameraInfo (tsCameraInfo *apInfo)=0
 
virtual void update (tsUpdate asMessage)
 
virtual teNackCode calibrate ()
 
virtual teNackCode whiteLevelCalibrate ()
 
virtual teNackCode setClockSetting (int32 anSetting)
 
virtual teNackCode getClockSetting (int32 &arSetting)
 
virtual void snap (tsCaptureRequest asSnapRequest)
 start a capture More...
 
virtual int32 initialize ()=0
 
virtual teNackCode setExposure (int32 anMicroseconds, uint32_t anExpIndex=0)=0
 
teNackCode setExposure (std::chrono::microseconds anMicroseconds, uint32_t anExpIndex=0)
 
virtual int32 getExposure (uint32_t anExpIndex=0)=0
 
virtual uint32 getMinFrameIntervalMicroS ()
 
std::chrono::microseconds getMinFrameInterval ()
 
virtual teNackCode setFrameInterval (int32 anMicroseconds)=0
 
teNackCode setFrameInterval (std::chrono::microseconds anMicroseconds)
 
virtual int32 getFrameInterval ()=0
 
virtual teNackCode setROI (ROI region)=0
 
virtual ROI getROI ()=0
 
virtual ROI getImageROI ()
 
virtual teNackCode setVerticalBin (int32 anPixels)=0
 
virtual int32 getVerticalBin ()=0
 
virtual teNackCode setHorizontalBin (int32 anPixels)=0
 
virtual int32 getHorizontalBin ()=0
 
virtual teNackCode setShutterMode (teShutterMode eeMode)=0
 
virtual int32 getShutterMode ()=0
 
virtual teNackCode setBPP (teBPPMode eeMode)=0
 
virtual teNackCode setColor (bool)
 
virtual teNackCode setTestPattern (teTestPattern eeSelection)=0
 
virtual int32 getTestPattern ()=0
 
virtual teNackCode setTrigger (teTriggerMode eeTrigger)=0
 
virtual int32 getTrigger ()=0
 
virtual teNackCode peek (int32 anRegister, int *apValue)
 
virtual teNackCode poke (int32 anRegister, int32 anValue)
 
virtual int32 validate ()=0
 
virtual bool isCapturing ()=0
 
virtual teNackCode start ()=0
 
virtual teNackCode stop ()=0
 
virtual std::string getTemperature (int32 anSensor=0)=0
 
virtual float getTempCelsius ()
 
virtual float getBoardTempCelsius ()
 
virtual std::string getVersion ()=0
 
virtual teNackCode save (int32 anConfiguration)=0
 
virtual teNackCode recall (int32 anConfiguration)=0
 
virtual teNackCode setIODirection (int32 anPin, int32 anDirection)
 tcSensorBoard::setIODirection Sets the camera GPIO direction. More...
 
virtual teNackCode setIOValue (int32 anPinNum, int32 anValue)
 tcSensorBoard::setIOValue Sets the output value of the gpio-camio linux module controlling the cam-gpio.vhd critical link camera IO block. More...
 
virtual teNackCode setIOInverter (int32 anPinNum, int32 anInvertEnable)
 tcSensorBoard::setIOInverter Sets the camera GPIO invert state. More...
 
virtual teNackCode power (bool abOn)
 
virtual int32 getIODirection ()
 
virtual int32 getIOValue ()
 tcSensorBoard::getIOValue 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 tcRAMStreamergetStreamer ()
 
virtual tcTimestamp * getTimestamper ()
 
virtual void setTimestamper (tcTimestamp *apStamper)
 
virtual tcSensorBoardself ()
 
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 ()
 

Static Public Attributes

static const std::string NO_TEMPERATURE_SENSOR
 
static const std::string TEMPERATURE_SENSOR_ERROR
 

Protected Member Functions

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

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

◆ tcSensorBoard() [1/2]

tcSensorBoard::tcSensorBoard ( int  aeType,
uint32  anStreamAddr,
int32  length,
int32 aaGpioNum 
)

for the Cyclone V, there is no hwmon / kernel driver used for the AD741X, so we try to use the I2C device directly with the mpTempSensor class. This will fail if the sensor is taken by a hwmon/lmsensor kernel driver, and will be handled below.

Attempt to locate the sensor chip name and subfeature indexes for our HWMON / lmsensors based temperature sensor. We are using the libsensors library instead of sysfs because the order of the two sensors (e.g., hwmon1, hwmon0) is not gauranteed. Instead of crawling around sysfs use the libsensor API to figure out the right pathnames / references.

Note: this is really only for the A10, the current Cyclone V exposes the AD741X chip directly (no hwmon / kernel I2C driver is specified in the device tree), so the mpTempSensor, above, is used.

◆ tcSensorBoard() [2/2]

tcSensorBoard::tcSensorBoard ( int  aeType,
uint32_t  anFpgaBaseAddr,
uint32_t  anRamStreamAddr,
int32  length,
int32 aaGpioNum 
)

◆ ~tcSensorBoard()

tcSensorBoard::~tcSensorBoard ( )
virtual

Member Function Documentation

◆ calibrate()

teNackCode tcSensorBoard::calibrate ( )
virtual

Perform calibration routine for the camera.

Returns
the nack code.

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ ConvertPixelFormat()

uint32 SocCamera::tcSensorBoard::ConvertPixelFormat ( uint32  anFormat,
bool  abFlipX,
bool  abFlipY 
)
protected

Utility routine to convert PFNC pixel format given flip options.

Parameters
anFormatthe input format
abFlipXinvert the X parameter
abFlipYinvert the Y parameter
Returns
the resulting pattern PFNC

◆ fpgaVersion()

uint64_t tcSensorBoard::fpgaVersion ( )
virtual

◆ GetA10BoardTemp()

teNackCode SocCamera::tcSensorBoard::GetA10BoardTemp ( uint32  anIndex,
float &  anTemp 
)
protected

Utility routine to get the temp sensor readings off an A10 processor card.

Note
cyclone v boards use the mpTempSensor class, A10 boards use /sys/class/hwmon*
Parameters
anIndex[in]temp sensor index. 1 = AD7415 board temp, 2 = A10 Diode / CPU temp, 3 = LM95235 board temp
anTemp[out]measured temperature in degrees C
Returns
eeNoError when successful.

make sure valid pointers. If we had problems locating lmsensor info during construction, we're not going to get good data

◆ getBoardTempCelsius()

float SocCamera::tcSensorBoard::getBoardTempCelsius ( )
virtual

Gets the SoC board temperature in degrees celsius. If the i2c temperature sensor does not exist (ie: old revision of the board), returns -275.

Returns
the current SoC board temperature.

◆ GetCameraInfo()

virtual int SocCamera::tcSensorBoard::GetCameraInfo ( tsCameraInfo apInfo)
pure virtual

Get the camera info for the given sensor board.

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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcStdOutSensorBoard, and SocCamera::tcSavableSensorBoard.

◆ getClockSetting()

teNackCode tcSensorBoard::getClockSetting ( int32 arSetting)
virtual

Gets the current clock setting.

Parameters
areference to an integer to store the setting
Returns
the nack code of the operation.

◆ getCustomHandlers()

tcAbstractHandler * tcSensorBoard::getCustomHandlers ( tcAbstractHandler apTailHandler,
std::map< std::string, tcAbstractHandler * > *  apStringMap 
)
virtual

◆ getDemoMode()

virtual teNackCode SocCamera::tcSensorBoard::getDemoMode ( int32 arMode)
inlinevirtual

Return the currently set demo mode.

Parameters
referenceto an int for the demo mode state.
Returns
a nack code for the operation.

◆ getExposure()

virtual int32 SocCamera::tcSensorBoard::getExposure ( uint32_t  anExpIndex = 0)
pure virtual

Returns the currently set exposure time in microseconds.

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

Implemented in SocCamera::tcSavableSensorBoard, SocCamera::tcSimSensorSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getFrameInterval()

virtual int32 SocCamera::tcSensorBoard::getFrameInterval ( )
pure virtual

Returns the frame interval time in microseconds.

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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getFrameSizeBytes()

uint32 SocCamera::tcSensorBoard::getFrameSizeBytes ( )

Returns the returned image size in bytes.

Returns
the size of the returned image in bytes without the header.

◆ getHorizontalBin()

virtual int32 SocCamera::tcSensorBoard::getHorizontalBin ( )
pure virtual

Gets the currently set horizontal binning factor being used.

Returns
an int32 - the number of pixels being binned horizontally

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getImageROI()

virtual ROI SocCamera::tcSensorBoard::getImageROI ( )
inlinevirtual

By default this function returns this->getROI(). For Multiple ROI Sensors, this should return an ROI that defines the image.

Returns
this->getROI() by default.

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ getIODirection()

int32 tcSensorBoard::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 in SocCamera::tcSavableSensorBoard, SocCamera::tcStdOutSensorBoard, and tcCamLinkTestSensorBoard.

◆ getIOValue()

int32 tcSensorBoard::getIOValue ( )
virtual

tcSensorBoard::getIOValue

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.
bitmask of GPIO state. GPIO4..1

Reimplemented in SocCamera::tcSavableSensorBoard, SocCamera::tcStdOutSensorBoard, and tcCamLinkTestSensorBoard.

◆ getMaxImgCount()

uint32 SocCamera::tcSensorBoard::getMaxImgCount ( )

Returns the maximum image count.

Returns
the number of images that can fit into memory.

◆ getMinFrameInterval()

std::chrono::microseconds SocCamera::tcSensorBoard::getMinFrameInterval ( )
inline

◆ getMinFrameIntervalMicroS()

virtual uint32 SocCamera::tcSensorBoard::getMinFrameIntervalMicroS ( )
inlinevirtual

Returns the minimum frame interval period in microseconds

Note
Defaults to 1000uS (1000fps) as thats whats in most of the xml pages. This should be overridden by the individual sensors.
The FrameIntervalHandler will update the register file any time the host requests it by calling update_word(SENS_MIN_FRAME_PERIOD_ADDR, getMinFrameIntervalMicroS()). Ideally, the sensor XML file should specify which fields invalidate this value.
Returns
Minimum frame interval period in microseconds

Reimplemented in SocCamera::tcSimSensorSensorBoard.

◆ getMirroring()

virtual teNackCode SocCamera::tcSensorBoard::getMirroring ( bool  isX,
bool *  Enabled 
)
inlinevirtual

Gets mirroring state.

Parameters
isXwhen true operation is for X direction, else Y
Enabledwhether to flip
Returns
zero on success. Nack Code on failure

◆ getNoiseReduct()

virtual teNackCode SocCamera::tcSensorBoard::getNoiseReduct ( bool &  enHi,
uint16_t &  threshhi,
bool &  enLo,
uint16_t &  threshlo 
)
inlinevirtual

Get Noise Reduction options

Parameters
enHienable Hi side noise reduction
threshhihigh side threshold
enLoenable Low side noise reduction
threshlolow side threshold
Returns
zero on success. Nack Code on failure

◆ getNumPins()

int32 SocCamera::tcSensorBoard::getNumPins ( )
virtual

Returns the number of pins.

◆ getNumSnapFramesLeft()

uint32 SocCamera::tcSensorBoard::getNumSnapFramesLeft ( )
Returns
the current number of snap frames remaining.

◆ getPixelFormat()

uint32 SocCamera::tcSensorBoard::getPixelFormat ( void  )
virtual

Get the pixel format generated by the pixel pipeline.

Note
this routine will account for X/Y flipping and is mostly of concern for bayer sensors
Returns
the PFNC standardized pixel format code

◆ getROI()

virtual ROI SocCamera::tcSensorBoard::getROI ( )
pure virtual

Returns the currently set region of interest for the camera.

Returns
the ROI the sensor will produce.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getSensorHeight()

virtual int32_t SocCamera::tcSensorBoard::getSensorHeight ( )
inlinevirtual
Returns
The height of the sensor in pixels. Note that this was added to support a SensorBoard that can have different sensors of different sizes installed. This is reported in GenICam XML as standard register SensorHeight. Legacy way of handling this was to hardcode in XML.

◆ getSensorWidth()

virtual int32_t SocCamera::tcSensorBoard::getSensorWidth ( )
inlinevirtual
Returns
The width of the sensor in pixels. Note that this was added to support a SensorBoard that can have different sensors of different sizes installed. This is reported in GenICam XML as standard register SensorWidth. Legacy way of handling this was to hardcode in XML.

◆ getShutterMode()

virtual int32 SocCamera::tcSensorBoard::getShutterMode ( )
pure virtual

Returns the current shutter mode of the camera.

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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ GetSkipFrames()

virtual uint32 SocCamera::tcSensorBoard::GetSkipFrames ( bool &  reload)
inlineprotectedvirtual

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.

Parameters
reload[out]set to true if skip valid should be reloaded each capture interval
Returns
number of frames to skip after the run has started

◆ getSqrtCompression()

virtual teNackCode SocCamera::tcSensorBoard::getSqrtCompression ( bool &  enable)
inlinevirtual

Get Enable state of square root compression

Parameters
enableset to true when compression is enabled
Returns
zero on success. Nack Code on failure

◆ getStreamer()

tcRAMStreamer * tcSensorBoard::getStreamer ( )
virtual

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

Returns
A pointer to the shared RAMStreamer object.

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ getSysIdNumber()

int SocCamera::tcSensorBoard::getSysIdNumber ( unsigned short &  major,
unsigned short &  minor 
)

Converts the SYS_ID version number register

Parameters
majorlocation to store major portion of number
minorlocation to store minor portion of number
Returns
zero on success

◆ getTempCelsius()

float tcSensorBoard::getTempCelsius ( )
virtual

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

Returns
-275.0f (no sensor)

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ getTemperature()

virtual std::string SocCamera::tcSensorBoard::getTemperature ( int32  anSensor = 0)
pure 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.

Implemented in SocCamera::tcStdOutSensorBoard, SocCamera::tcSimSensorSensorBoard, and SocCamera::tcSavableSensorBoard.

◆ getTempSensor()

virtual tcTemperatureSensor* SocCamera::tcSensorBoard::getTempSensor ( )
inlinevirtual

get the tcTemperature monitor object for this sensor

Returns
pointer to the tcTemperatureSensor for this Sensor (may be nullptr)

◆ getTestPattern()

virtual int32 SocCamera::tcSensorBoard::getTestPattern ( )
pure virtual

Get the currently set test pattern from eeTestPatterns.

Returns
an int32 - the current test pattern from eeTestPatterns

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getTimestamper()

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

Gets the Timestamp component to share with other objects.

Returns
a pointer to the shared Timestamp object.

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ getTrigger()

virtual int32 SocCamera::tcSensorBoard::getTrigger ( )
pure virtual

Returns the currently set trigger mode.

Returns
an int32 - the current trigger from eeTriggerModes

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getVersion()

virtual std::string SocCamera::tcSensorBoard::getVersion ( )
pure virtual

Get the chip version of the sensor board if possible.

Returns
a string with the chip version.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getVerticalBin()

virtual int32 SocCamera::tcSensorBoard::getVerticalBin ( )
pure virtual

Gets the currently set vertical binnign factor being used.

Returns
an int32 - the number of pixels being binned vertically

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ getVoltageSensor()

virtual tcVoltageSensor* SocCamera::tcSensorBoard::getVoltageSensor ( )
inlinevirtual

get the temperature monitor object for this sensor

Returns
pointer to the tcVoltageSensor for this Sensor (may be nullptr)

◆ Handler()

void SocCamera::tcSensorBoard::Handler ( unsigned int  gpionum,
unsigned int  val 
)
virtual

Handler GPIO Handler notifies changes on any gpio with edges enabled.

Parameters
gpionumthe logical / linux gpionum raising the interrupt
valthe current value of the GPIO pin

◆ id()

int tcSensorBoard::id ( )

◆ init()

int32 SocCamera::tcSensorBoard::init ( )

◆ initGpios()

void tcSensorBoard::initGpios ( int32  length,
int32 aaGpioNum 
)
protected

Try to locate first 4 GPIOS from sysfs names. Note: going forward, using the GPIO names from the device tree / sysfs is preferred. this will allow survival through any changes to NR_GPIO (or it's removal) from the kernel in the future (as the GPIO numbering is not gauranteed to remain static from kernel to kernel).

register to by notified of changes, but by default, no changes will be reported. This will kick off the tcGpio monitoring thread, which will start kicking the callback if we set any of the GPIO pin's edge properties

◆ initialize()

virtual int32 SocCamera::tcSensorBoard::initialize ( )
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ isCapturing()

virtual bool SocCamera::tcSensorBoard::isCapturing ( )
pure 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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ loadColumnBias()

virtual teNackCode SocCamera::tcSensorBoard::loadColumnBias ( const char *  asFilename)
inlinevirtual

Load the column bias.

Parameters
filenameof the column biases.
Returns
zero on success. Nack Code on failure

◆ loadColumnGain()

virtual teNackCode SocCamera::tcSensorBoard::loadColumnGain ( const char *  asFilename)
inlinevirtual

Load the column gains.

Parameters
filenameof the column gains.
Returns
zero on success. Nack Code on failure

◆ loadPixelCal()

virtual teNackCode SocCamera::tcSensorBoard::loadPixelCal ( const char *  asFilename)
inlinevirtual

Load the column bias.

Parameters
filenameof the column biases.
Returns
zero on success. Nack Code on failure

◆ nextRequest()

void tcSensorBoard::nextRequest ( )
protected

◆ peek()

teNackCode tcSensorBoard::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 in SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ poke()

teNackCode tcSensorBoard::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 in SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ power()

teNackCode tcSensorBoard::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 in SocCamera::tcSavableSensorBoard.

◆ recall()

virtual teNackCode SocCamera::tcSensorBoard::recall ( int32  anConfiguration)
pure virtual

Recall a configuration identified by anConfiguration.

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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ resetFpga()

void SocCamera::tcSensorBoard::resetFpga ( )
virtual

Resets the FPGA if appropriate; this is needed to decouple certain pipeline components from the IOChannel object.

Function is an empty adapter; only some FPGA/IOChannel combos will need this

Reimplemented in SocCamera::tcSimSensorSensorBoard.

◆ runPeriodic()

virtual void SocCamera::tcSensorBoard::runPeriodic ( )
inlinevirtual

can be called by framework to do any periodic work.

Note
calling freq. is governed by CALLER!

◆ save()

virtual teNackCode SocCamera::tcSensorBoard::save ( int32  anConfiguration)
pure virtual

Saves a configuration identified by anConfiguration.

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

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ self()

tcSensorBoard * SocCamera::tcSensorBoard::self ( )
virtual

Returns itself or a pointer to the object being controlled.

Returns
a pointer to the underlying sensorboard.

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ setBPP()

virtual teNackCode SocCamera::tcSensorBoard::setBPP ( teBPPMode  eeMode)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setClockSetting()

teNackCode tcSensorBoard::setClockSetting ( int32  anSetting)
virtual

Camera-specific method of setting the clock. Some clocks may need to be set manually or for debug purposes, set the clock faster/slower as desired.

Parameters
anSetting- a camera specific setting.
Returns
the nack code for the operation.

◆ setColor()

virtual teNackCode SocCamera::tcSensorBoard::setColor ( bool  )
inlinevirtual

Sets whether sensor is in color mode. Used mostly for configuring bad pixel map

Parameters
abColorTrue if in color mode
Returns

◆ setDemoMode()

virtual teNackCode SocCamera::tcSensorBoard::setDemoMode ( int32  anMode)
inlinevirtual

If the camera supports it, set a special demo mode.

By convention, 0 should disable any demo-mode features.

Parameters
anMode- the demo mode to put the camera into.
Returns
a nack code for the operation.

◆ setExposure() [1/2]

virtual teNackCode SocCamera::tcSensorBoard::setExposure ( int32  anMicroseconds,
uint32_t  anExpIndex = 0 
)
pure virtual

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
anExpIndex- index of exposure control, typically 0 (default). Can be used for HDR type configuration to specific a second exposure setting
Returns
an int32 for the status; 0 if successful, non zero corresponding to the appropriate NACK value.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setExposure() [2/2]

teNackCode SocCamera::tcSensorBoard::setExposure ( std::chrono::microseconds  anMicroseconds,
uint32_t  anExpIndex = 0 
)
inline

◆ setFrameInterval() [1/2]

virtual teNackCode SocCamera::tcSensorBoard::setFrameInterval ( int32  anMicroseconds)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setFrameInterval() [2/2]

teNackCode SocCamera::tcSensorBoard::setFrameInterval ( std::chrono::microseconds  anMicroseconds)
inline

◆ setHorizontalBin()

virtual teNackCode SocCamera::tcSensorBoard::setHorizontalBin ( int32  anPixels)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setIODirection()

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

tcSensorBoard::setIODirection Sets the camera GPIO direction.

Note
The camera GPIO module supports 2 input paths, notionally called the nominal input and the alternate input. Typically, the alternate input paths are external inputs such as camera link CC0-3 channels or, on the USB3 board, the optically isolated input channels.
Parameters
anPinzero based GPIO pin number corresponding to gpio-camio index
anDirection0 = nominal input, 1 = output, 2 = alternate input
Returns
the teNackCode that fits the situation.
Note
The camera GPIO module supports 2 input paths, notionally called the nominal input and the alternate input. Typically, the alternate input paths are external inputs such as camera link CC0-3 channels or, on the USB3 board, the optically isolated input channels.
Parameters
anPinzero based GPIO pin number corresponding to gpio-camio index
anDirection0 = nominal input, 1 = output, 2 = alternate input
Returns

Reimplemented in SocCamera::tcSavableSensorBoard, and tcCamLinkTestSensorBoard.

◆ setIOInverter()

teNackCode tcSensorBoard::setIOInverter ( int32  anPinNum,
int32  anInvertEnable 
)
virtual

tcSensorBoard::setIOInverter Sets the camera GPIO invert state.

Sets the inversion state pin. This will invert the input, or the output depending on the pin's direction.

Note
are are using the active_low variable to store the desired pin state, but we do not use the sysfs active_low to control this, as we want the inverter to operate correctly on FPGA fabric inputs or outputs as well as the sysfs/value ARM controlled value.
Parameters
anPinNumZero Based GPIO pin number. 0-3 should map to camera GPIO 1-4
anInvertEnablewhen zero don't invert, otherwise invert
Returns
the teNackCode that fits the situation.

◆ setIOValue()

teNackCode tcSensorBoard::setIOValue ( int32  anPinNum,
int32  anValue 
)
virtual

tcSensorBoard::setIOValue Sets the output value of the gpio-camio linux module controlling the cam-gpio.vhd critical link camera IO block.

Note
The camera IO block has provisions for driving static low or high signals as well as driving FPGA generated signals (fabric inputs). It is assumed that on cameras supporting generating an exposure strobe, the strobe will be present on FPGA fabric input 0 (or anValue = 2). Other inputs are undefined or camera specific.
Parameters
anPinNumZero Based GPIO Pin Number. 0-3 should map to camera GPIO 1-4.
anValue0 -> static low output, 1 -> static high output, 2-5 : FPGA fabric inputs 0-3, respectively
Returns
the teNackCode that fits the situation.
Note
The camera IO block has provisions for driving static low or high signals as well as driving FPGA generated signals (fabric inputs). It is assumed that on cameras supporting generating an exposure strobe, the strobe will be present on FPGA fabric input 0 (or anValue = 2). Other inputs are undefined or camera specific.
Parameters
anPinNumZero Based GPIO Pin Number. 0-3 should map to camera GPIO 1-4.
anValue0 -> static low output, 1 -> static high output, 2-5 : FPGA fabric inputs 0-3, respectively
Returns

Reimplemented in tcCamLinkTestSensorBoard, and SocCamera::tcSavableSensorBoard.

◆ setMirroring()

virtual teNackCode SocCamera::tcSensorBoard::setMirroring ( bool  isX,
bool  Enabled 
)
inlinevirtual

Flips Image, if supported based on mask values.

Parameters
isXwhen true operation is for X direction, else Y
Enabledwhether to flip
Returns
zero on success. Nack Code on failure

◆ setNoiseReduct()

virtual teNackCode SocCamera::tcSensorBoard::setNoiseReduct ( bool  enHi,
uint16_t  threshhi,
bool  enLo,
uint16_t  threshlo 
)
inlinevirtual

Set Noise Reduction options

Parameters
enHienable Hi side noise reduction
threshhihigh side threshold
enLoenable Low side noise reduction
threshlolow side threshold
Returns
zero on success. Nack Code on failure

◆ setROI()

virtual teNackCode SocCamera::tcSensorBoard::setROI ( ROI  region)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setShutterMode()

virtual teNackCode SocCamera::tcSensorBoard::setShutterMode ( teShutterMode  eeMode)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setSqrtCompression()

virtual teNackCode SocCamera::tcSensorBoard::setSqrtCompression ( bool  enable)
inlinevirtual

Enable / Disable square root compression

Parameters
enableset to true to enable compression
Returns
zero on success. Nack Code on failure

◆ setTestPattern()

virtual teNackCode SocCamera::tcSensorBoard::setTestPattern ( teTestPattern  eeSelection)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setTimestamper()

void SocCamera::tcSensorBoard::setTimestamper ( tcTimestamp *  apStamper)
virtual

Sets a timestamper for external use.

◆ setTrigger()

virtual teNackCode SocCamera::tcSensorBoard::setTrigger ( teTriggerMode  eeTrigger)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ setVerticalBin()

virtual teNackCode SocCamera::tcSensorBoard::setVerticalBin ( int32  anPixels)
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ snap()

void tcSensorBoard::snap ( tsCaptureRequest  asSnapRequest)
virtual

start a capture

Queue the request for images to be asynchronously fulfilled.

Parameters
asSnapRequest- the snap request message.
asSnapRequest

Reimplemented in SocCamera::tcSavableSensorBoard.

◆ start()

virtual teNackCode SocCamera::tcSensorBoard::start ( )
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ stop()

virtual teNackCode SocCamera::tcSensorBoard::stop ( )
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ update()

void tcSensorBoard::update ( tsUpdate  asMessage)
virtual

Observers are updated of a change by an observable.

Parameters
asMessage- the message sent by the observable.

Implements tcObserver.

◆ validate()

virtual int32 SocCamera::tcSensorBoard::validate ( )
pure 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.

Implemented in SocCamera::tcSimSensorSensorBoard, SocCamera::tcSavableSensorBoard, and SocCamera::tcStdOutSensorBoard.

◆ whiteLevelCalibrate()

teNackCode tcSensorBoard::whiteLevelCalibrate ( )
virtual

Performs a white level calibration and applies the ratio to obtain a properly set gain.

Returns
the nack code.

Member Data Documentation

◆ maPinConfigs

MityDSP::tcGpio::PinConfig* SocCamera::tcSensorBoard::maPinConfigs
protected

◆ mbIsPowered

bool SocCamera::tcSensorBoard::mbIsPowered
protected

◆ mcInterruptThread

tcPollingInterruptThread SocCamera::tcSensorBoard::mcInterruptThread
protected

◆ mhMutex

tcMutex SocCamera::tcSensorBoard::mhMutex
protected

◆ mhPeekMap

std::map<int, std::pair<tcIntAccessor*, IntAccessorFunction> > SocCamera::tcSensorBoard::mhPeekMap
protected

◆ mhPokeMap

std::map<int, std::pair<tcIntSetter*, IntSetterFunction> > SocCamera::tcSensorBoard::mhPokeMap
protected

◆ mnAD7414_sf

int SocCamera::tcSensorBoard::mnAD7414_sf
protected

TEMP input subfeature number needed to get the actual temperature.

◆ mnLM95235_board_sf

int SocCamera::tcSensorBoard::mnLM95235_board_sf
protected

TEMP input subfeature for on-chip sensor.

◆ mnLM95235_die_sf

int SocCamera::tcSensorBoard::mnLM95235_die_sf
protected

TEMP input subfeature for die temperature (CPU) sensor.

◆ mnMaxImgCount

uint32 SocCamera::tcSensorBoard::mnMaxImgCount
protected

◆ mnPinCount

int32 SocCamera::tcSensorBoard::mnPinCount
protected

◆ mpCamIO

MityDSP::tcGpio* SocCamera::tcSensorBoard::mpCamIO
protected

◆ mpChipnameAD7414

const sensors_chip_name* SocCamera::tcSensorBoard::mpChipnameAD7414
protected

lmsensors chipname for AD7414 on A10/CV

◆ mpChipnameLM95235

const sensors_chip_name* SocCamera::tcSensorBoard::mpChipnameLM95235
protected

lmsensors chipname for LM95235 on A10

◆ mpStreamer

tcRAMStreamer* SocCamera::tcSensorBoard::mpStreamer
protected

◆ mpTempSensor

MityDSP::tcAD741x* SocCamera::tcSensorBoard::mpTempSensor
protected

◆ NO_TEMPERATURE_SENSOR

const std::string tcSensorBoard::NO_TEMPERATURE_SENSOR
static
Initial value:
=
"That is not a valid sensor to request."

◆ TEMPERATURE_SENSOR_ERROR

const std::string tcSensorBoard::TEMPERATURE_SENSOR_ERROR
static
Initial value:
=
"There was an error reading the sensor."

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