Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
IOChannel.h
Go to the documentation of this file.
1 #ifndef IOCHANNEL_H
2 #define IOCHANNEL_H
3 
4 #include <string>
5 #include <list>
6 
7 #include "CameraTypes.h"
8 #include "IOCallback.h"
9 
10 #include "Utility/Thread.h"
11 #include "Utility/Observer.h"
12 #include "Utility/Types.h"
13 #include "Utility/Mutex.h"
14 #include "Utility/Condition.h"
15 #include "Utility/Sem.h"
16 
17 #include "Sensors/SensorBoard.h"
18 
19 #include "IOChannelThread.h"
20 
35 {
36 private:
37  friend class tcIOChannelThread;
38 
39 public:
41  SocCamera::tcSensorBoard *apSensor);
42  virtual ~tcIOChannel();
43 
51  virtual SocCamera::teNackCode capture(tsCaptureRequest asRequest) = 0;
52 
58  virtual SocCamera::teNackCode setBpp(SocCamera::teBPPMode aeBppMode) = 0;
59 
60  virtual void initialized();
61 
67 
72  virtual void sendUpdate(tsNewFrameMsg *apMsg) = 0;
73 
77  virtual void processUpdate(tsNewFrameMsg *apMsg);
78 
79  void setEnable(bool abEnable);
80 
89  tcImage *grabImage();
90 
96 
100  virtual void invalidateCache(void* apMem, size_t anSize);
101 
105  virtual void* memory();
106 protected:
107  std::string m_name; // Human name for interface for debugging, should be short to keep log messages short.
108 
109  void invalidateCache(tsNewFrameMsg *apMsg);
110 
111  void invalidateCache();
112 
115 
117 
119  std::list<tsNewFrameMsg> mlUpdates;
122 
123  void *mpMemory;
124 
126 
128 
131  static bool CMEM_USED;
132  static bool MMAP_USED;
133 
134  bool mbSimRAM;
135 
136 
137  void Report (const char* fmt, ...);
138  void ReportError (const char* fmt, ...);
139 };
140 
141 #endif // IOCHANNEL_H
tcIOChannel::mpSensor
SocCamera::tcSensorBoard * mpSensor
Definition: IOChannel.h:114
tcIOChannel::Report
void Report(const char *fmt,...)
This method routes text to stderr.
Definition: IOChannel.cpp:320
tcIOChannel::mcCond
tcCondition mcCond
Definition: IOChannel.h:121
tcIOChannel::mcMutex
tcMutex mcMutex
Definition: IOChannel.h:120
tcIOCallback
Definition: IOCallback.h:32
Types.h
tcIOChannel::meBppMode
SocCamera::teBPPMode meBppMode
Definition: IOChannel.h:116
SocCamera::teIOChannels
teIOChannels
Definition: CameraTypes.h:29
tcIOChannel::processUpdate
virtual void processUpdate(tsNewFrameMsg *apMsg)
Definition: IOChannel.cpp:231
tcIOChannel::invalidateCache
void invalidateCache()
Definition: IOChannel.cpp:241
tcIOChannel::MEMORY_BLOCK_SIZE
static uint32 MEMORY_BLOCK_SIZE
Definition: IOChannel.h:130
tcIOChannel::m_name
std::string m_name
Definition: IOChannel.h:107
SensorBoard.h
tcIOChannel::mbSimRAM
bool mbSimRAM
Definition: IOChannel.h:134
tcIOChannel::memory
virtual void * memory()
Definition: IOChannel.cpp:290
tcIOChannel::id
SocCamera::teIOChannels id()
Definition: IOChannel.cpp:226
Observer.h
tcIOChannel::CAPTURE_START_ADDR
static uint32 CAPTURE_START_ADDR
Definition: IOChannel.h:129
CameraTypes.h
tcIOChannel::setBpp
virtual SocCamera::teNackCode setBpp(SocCamera::teBPPMode aeBppMode)=0
tcIOChannel::mcThread
tcIOChannelThread mcThread
Definition: IOChannel.h:125
tcIOChannel::grabImage
tcImage * grabImage()
Definition: IOChannel.cpp:246
tcIOChannel::mpMemory
void * mpMemory
Definition: IOChannel.h:123
tcIOChannel::getBpp
SocCamera::teBPPMode getBpp()
Definition: IOChannel.cpp:221
SocCamera::teNackCode
teNackCode
Definition: CameraTypes.h:62
tcIOChannel
Camera Output IO channel management class.
Definition: IOChannel.h:34
SocCamera::teBPPMode
teBPPMode
Definition: CameraTypes.h:133
tcIOChannel::mnImgCount
int64 mnImgCount
Definition: IOChannel.h:118
Thread.h
tcIOChannel::tcIOChannel
tcIOChannel(SocCamera::teIOChannels aeIOId, SocCamera::tcSensorBoard *apSensor)
Construct a new tcIOChannel::tcIOChannel object.
Definition: IOChannel.cpp:41
tcIOChannel::sendUpdate
virtual void sendUpdate(tsNewFrameMsg *apMsg)=0
tcIOChannel::ReportError
void ReportError(const char *fmt,...)
Definition: IOChannel.cpp:343
tcIOChannelThread
Definition: IOChannelThread.h:15
tcImage
Definition: Image.h:34
Mutex.h
tcIOChannel::MMAP_USED
static bool MMAP_USED
Definition: IOChannel.h:132
int64
int64_t int64
Definition: Types.h:12
IOCallback.h
tcIOChannel::setEnable
void setEnable(bool abEnable)
Definition: IOChannel.cpp:272
uint32
uint32_t uint32
Definition: Types.h:11
IOChannelThread.h
tcIOChannel::mlUpdates
std::list< tsNewFrameMsg > mlUpdates
Definition: IOChannel.h:119
tcIOChannel::meIOId
SocCamera::teIOChannels meIOId
Definition: IOChannel.h:113
tsNewFrameMsg
Definition: IOCallback.h:11
tcIOChannel::capture
virtual SocCamera::teNackCode capture(tsCaptureRequest asRequest)=0
tcCondition
Definition: Condition.h:8
SocCamera::tcSensorBoard
Definition: SensorBoard.h:40
Sem.h
tcMutex
Definition: Mutex.h:11
tcIOChannel::CMEM_USED
static bool CMEM_USED
Definition: IOChannel.h:131
tcIOChannel::~tcIOChannel
virtual ~tcIOChannel()
Definition: IOChannel.cpp:186
tcIOChannel::msLastUpdate
tsNewFrameMsg msLastUpdate
Definition: IOChannel.h:127
tsCaptureRequest
Definition: IOCallback.h:56
tcIOChannel::initialized
virtual void initialized()
Definition: IOChannel.cpp:338
Condition.h