Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
SavableSensorBoard.h
Go to the documentation of this file.
1 /*
2  * SavableSensorBoard.h
3  *
4  * Created on: May 12, 2014
5  * Author: mitycam
6  */
7 
8 #ifndef SAVABLESENSORBOARD_H_
9 #define SAVABLESENSORBOARD_H_
10 
11 #include "SensorBoard.h"
12 
13 namespace SocCamera {
14 
15 #define SAVED_CONFIG (9)
16 
18 public:
20  virtual ~tcSavableSensorBoard();
21 
27  virtual int GetCameraInfo(tsCameraInfo* apInfo)
28  {
29  return mpSensorBoard->GetCameraInfo(apInfo);
30  }
31 
36  virtual teNackCode calibrate();
37 
42  virtual void snap(tsCaptureRequest asSnapRequest);
43 
49  virtual int32 initialize();
50 
59  virtual teNackCode setExposure(int32 anMicroseconds, uint32_t anExpIndex = 0) override;
60 
65  virtual int32 getExposure(uint32_t anExpIndex = 0) override;
66 
75  virtual teNackCode setFrameInterval(int32 anMicroseconds);
76 
81  virtual int32 getFrameInterval();
82 
91  virtual teNackCode setROI(ROI region);
92 
97  virtual ROI getROI();
98 
103  virtual ROI getImageROI();
104 
111  virtual teNackCode setVerticalBin(int32 anPixels);
112 
117  virtual int32 getVerticalBin();
118 
125  virtual teNackCode setHorizontalBin(int32 anPixels);
126 
131  virtual int32 getHorizontalBin();
132 
139  virtual teNackCode setShutterMode(teShutterMode eeMode);
140 
146  virtual int32 getShutterMode();
147 
154  virtual teNackCode setBPP(teBPPMode eeMode);
155 
162  virtual teNackCode setTestPattern(teTestPattern eeSelection);
163 
168  virtual int32 getTestPattern();
169 
176  virtual teNackCode setTrigger(teTriggerMode eeTrigger);
177 
182  virtual int32 getTrigger();
183 
192  virtual teNackCode peek(int32 anRegister, int* apValue);
193 
202  virtual teNackCode poke(int32 anRegister, int32 anValue);
203 
210  virtual int32 validate();
211 
218  virtual bool isCapturing();
219 
226  virtual teNackCode start();
227 
233  virtual teNackCode stop();
234 
243  virtual std::string getTemperature(int32 anSensor = 0);
244 
249  virtual float getTempCelsius();
250 
255  virtual std::string getVersion();
256 
262  virtual teNackCode save(int32 anConfiguration);
263 
269  virtual teNackCode recall(int32 anConfiguration);
270 
271  // GPIO functions can be handled abstractly from the rest of the sensor board...
272  // If they are done in sysfs.
273 
284  virtual teNackCode setIODirection(int32 anPin, int32 anDirection);
285 
296  virtual teNackCode setIOValue(int32 anPin, int32 anValue);
297 
303  virtual teNackCode power(bool abOn);
304 
312  virtual int32 getIODirection();
313 
320  virtual int32 getIOValue();
321 
326  virtual tcRAMStreamer *getStreamer();
327 
332  virtual tcTimestamp *getTimestamper();
333 
338  virtual tcSensorBoard* self();
339 
340 private:
341  inline teNackCode checkAndSave(teNackCode eeCode) {
342  if(eeCode == eeNoError) {
343  this->save(SAVED_CONFIG);
344  }
345 
346  return eeCode;
347  }
348 
349  tcSensorBoard *mpSensorBoard;
350 };
351 
352 }
353 
354 #endif /* SAVABLESENSORBOARD_H_ */
SocCamera::tcSavableSensorBoard::setVerticalBin
virtual teNackCode setVerticalBin(int32 anPixels)
Definition: SavableSensorBoard.cpp:62
SocCamera::tcSavableSensorBoard::getTempCelsius
virtual float getTempCelsius()
Definition: SavableSensorBoard.cpp:139
int32
int32_t int32
Definition: Types.h:8
SocCamera::tcSavableSensorBoard::setIOValue
virtual teNackCode setIOValue(int32 anPin, int32 anValue)
Definition: SavableSensorBoard.cpp:159
SocCamera::tsCameraInfo
Definition: CameraTypes.h:52
SocCamera::tcSavableSensorBoard::setROI
virtual teNackCode setROI(ROI region)
Definition: SavableSensorBoard.cpp:54
SocCamera::tcSavableSensorBoard::save
virtual teNackCode save(int32 anConfiguration)
Definition: SavableSensorBoard.cpp:147
SocCamera::tcSavableSensorBoard::getTemperature
virtual std::string getTemperature(int32 anSensor=0)
Definition: SavableSensorBoard.cpp:135
SocCamera::tcSavableSensorBoard::getVerticalBin
virtual int32 getVerticalBin()
Definition: SavableSensorBoard.cpp:66
SocCamera::tcSavableSensorBoard::stop
virtual teNackCode stop()
Definition: SavableSensorBoard.cpp:131
SocCamera::tcSavableSensorBoard::getROI
virtual ROI getROI()
Definition: SavableSensorBoard.cpp:58
SocCamera::tcSavableSensorBoard::~tcSavableSensorBoard
virtual ~tcSavableSensorBoard()
Definition: SavableSensorBoard.cpp:16
SocCamera::tcSavableSensorBoard::getIOValue
virtual int32 getIOValue()
Definition: SavableSensorBoard.cpp:171
SocCamera::tcSavableSensorBoard::getIODirection
virtual int32 getIODirection()
Definition: SavableSensorBoard.cpp:167
SocCamera::teTestPattern
teTestPattern
Definition: CameraTypes.h:122
SocCamera::tcSavableSensorBoard::recall
virtual teNackCode recall(int32 anConfiguration)
Definition: SavableSensorBoard.cpp:151
SensorBoard.h
SocCamera::tcSavableSensorBoard::setIODirection
virtual teNackCode setIODirection(int32 anPin, int32 anDirection)
Definition: SavableSensorBoard.cpp:155
SocCamera::tcSavableSensorBoard::tcSavableSensorBoard
tcSavableSensorBoard(tcSensorBoard *apBoard)
Definition: SavableSensorBoard.cpp:11
SocCamera::tcSavableSensorBoard::getTimestamper
virtual tcTimestamp * getTimestamper()
Definition: SavableSensorBoard.cpp:180
tcRAMStreamer
Definition: RAMStreamer.h:8
SocCamera::tcSavableSensorBoard::initialize
virtual int32 initialize()
Definition: SavableSensorBoard.cpp:28
SocCamera::tcSavableSensorBoard::setHorizontalBin
virtual teNackCode setHorizontalBin(int32 anPixels)
Definition: SavableSensorBoard.cpp:70
SocCamera::tcSavableSensorBoard::start
virtual teNackCode start()
Definition: SavableSensorBoard.cpp:127
SocCamera::teNackCode
teNackCode
Definition: CameraTypes.h:62
SocCamera::teBPPMode
teBPPMode
Definition: CameraTypes.h:133
SocCamera::teShutterMode
teShutterMode
Definition: CameraTypes.h:141
SocCamera::tcSavableSensorBoard
Definition: SavableSensorBoard.h:17
SocCamera::tcSavableSensorBoard::setTrigger
virtual teNackCode setTrigger(teTriggerMode eeTrigger)
Definition: SavableSensorBoard.cpp:100
SocCamera::tcSavableSensorBoard::setFrameInterval
virtual teNackCode setFrameInterval(int32 anMicroseconds)
Definition: SavableSensorBoard.cpp:45
SocCamera::tcSavableSensorBoard::validate
virtual int32 validate()
Definition: SavableSensorBoard.cpp:119
SocCamera::tcSensorBoard::GetCameraInfo
virtual int GetCameraInfo(tsCameraInfo *apInfo)=0
SocCamera::tcSensorBoard::tcSensorBoard
tcSensorBoard(int aeType, uint32 anStreamAddr, int32 length, int32 *aaGpioNum)
Definition: SensorBoard.cpp:32
SocCamera::tcSavableSensorBoard::poke
virtual teNackCode poke(int32 anRegister, int32 anValue)
Definition: SavableSensorBoard.cpp:114
SocCamera::tcSavableSensorBoard::calibrate
virtual teNackCode calibrate()
Definition: SavableSensorBoard.cpp:20
SocCamera
Definition: CameraTypes.h:7
SocCamera::tcSavableSensorBoard::peek
virtual teNackCode peek(int32 anRegister, int *apValue)
Definition: SavableSensorBoard.cpp:109
SocCamera::tcSavableSensorBoard::getTestPattern
virtual int32 getTestPattern()
Definition: SavableSensorBoard.cpp:96
SocCamera::tcSavableSensorBoard::getTrigger
virtual int32 getTrigger()
Definition: SavableSensorBoard.cpp:105
SocCamera::tcSavableSensorBoard::setShutterMode
virtual teNackCode setShutterMode(teShutterMode eeMode)
Definition: SavableSensorBoard.cpp:78
SocCamera::tcSavableSensorBoard::isCapturing
virtual bool isCapturing()
Definition: SavableSensorBoard.cpp:123
SocCamera::tcSavableSensorBoard::getFrameInterval
virtual int32 getFrameInterval()
Definition: SavableSensorBoard.cpp:50
SocCamera::tcSavableSensorBoard::getImageROI
virtual ROI getImageROI()
Definition: SavableSensorBoard.cpp:185
SocCamera::tcSavableSensorBoard::getShutterMode
virtual int32 getShutterMode()
Definition: SavableSensorBoard.cpp:83
SocCamera::teTriggerMode
teTriggerMode
Definition: CameraTypes.h:113
SocCamera::tcSavableSensorBoard::setBPP
virtual teNackCode setBPP(teBPPMode eeMode)
Definition: SavableSensorBoard.cpp:87
SocCamera::ROI
Definition: ROI.h:10
SocCamera::tcSavableSensorBoard::getStreamer
virtual tcRAMStreamer * getStreamer()
Definition: SavableSensorBoard.cpp:175
SocCamera::eeNoError
@ eeNoError
Definition: CameraTypes.h:64
SocCamera::tcSavableSensorBoard::setTestPattern
virtual teNackCode setTestPattern(teTestPattern eeSelection)
Definition: SavableSensorBoard.cpp:91
SocCamera::tcSavableSensorBoard::GetCameraInfo
virtual int GetCameraInfo(tsCameraInfo *apInfo)
Definition: SavableSensorBoard.h:27
SAVED_CONFIG
#define SAVED_CONFIG
Definition: SavableSensorBoard.h:15
SocCamera::tcSavableSensorBoard::getExposure
virtual int32 getExposure(uint32_t anExpIndex=0) override
Definition: SavableSensorBoard.cpp:41
SocCamera::tcSavableSensorBoard::getHorizontalBin
virtual int32 getHorizontalBin()
Definition: SavableSensorBoard.cpp:74
SocCamera::tcSensorBoard
Definition: SensorBoard.h:40
SocCamera::tcSavableSensorBoard::setExposure
virtual teNackCode setExposure(int32 anMicroseconds, uint32_t anExpIndex=0) override
Definition: SavableSensorBoard.cpp:37
tsCaptureRequest
Definition: IOCallback.h:56
SocCamera::tcSavableSensorBoard::snap
virtual void snap(tsCaptureRequest asSnapRequest)
Definition: SavableSensorBoard.cpp:24
SocCamera::tcSavableSensorBoard::getVersion
virtual std::string getVersion()
Definition: SavableSensorBoard.cpp:143
SocCamera::tcSavableSensorBoard::power
virtual teNackCode power(bool abOn)
Definition: SavableSensorBoard.cpp:163