Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
U3VDelegate.h
Go to the documentation of this file.
1 /*
2  * U3VDelegate.h
3  *
4  * Created on: Sep 26, 2017
5  * Author: mitydsp
6  */
7 
8 #ifndef U3VDELEGATE_H_
9 #define U3VDELEGATE_H_
10 
11 #include <map>
12 
13 #include "u3vision.h"
14 #include "INIReader.h"
15 
17 
18 namespace SocCamera
19 {
20 
21 class tcU3VisionInterface;
22 class tcU3VDelegate;
23 
24 typedef void (tcU3VDelegate::*delFunc)(tsU3VMsg *apMsg);
25 
32 public:
34  virtual ~tcU3VDelegate();
35 
36  delFunc getFunction(uint32_t prefix, uint16_t cmdId);
37 
38  void nack(tsU3VMsg* apMsg, uint16_t statusCode);
39 
40  virtual void pendingAckNeeded(const void *id);
41 
42 private:
43  // Internal messages for U3V
44  void log(tsU3VMsg* apMsg);
45  void sync(tsU3VMsg* apMsg);
46  void init(tsU3VMsg* apMsg);
47  void usbUpdate(tsU3VMsg* apMsg);
48 
49  // U3V messages
50  void readMem(tsU3VMsg* apMsg);
51  void writeMem(tsU3VMsg* apMsg);
52  void event(tsU3VMsg* apMsg);
53 
54  // Utility functions
55  void cpy_details(void * apDest, const INIReader &arIni, const std::string& arName, const std::string& arDefault);
56 
57  // Helper function for writeMem (to match how GEV works).
58  uint16_t execWriteRegCmd(uint32_t address, uint8_t *data);
59 
60  tcU3VisionInterface *mpIface;
61 
62  std::map< uint32_t, std::map<uint16_t, delFunc> > functions;
63 
64  SocCamera::tcPendingAckWatchdog<int> mcPendAckWatchdog;
65 
66  bool mbLogMemAccess;
67 };
68 
69 }
70 
71 
72 #endif /* U3VDELEGATE_H_ */
SocCamera::tcU3VDelegate::nack
void nack(tsU3VMsg *apMsg, uint16_t statusCode)
Definition: U3VDelegate.cpp:419
INIReader.h
SocCamera::delFunc
void(tcU3VDelegate::* delFunc)(tsU3VMsg *apMsg)
Definition: U3VDelegate.h:24
tcPendingAckWatchdog.h
SocCamera::tcU3VDelegate::getFunction
delFunc getFunction(uint32_t prefix, uint16_t cmdId)
Definition: U3VDelegate.cpp:48
SocCamera::tcU3VisionInterface
Definition: U3VisionInterface.h:25
SocCamera::tcU3VDelegate
Definition: U3VDelegate.h:31
INIReader
Definition: INIReader.h:16
SocCamera::tcPendingAckWatcher
Definition: tcPendingAckWatchdog.h:31
SocCamera::tcU3VDelegate::tcU3VDelegate
tcU3VDelegate(tcU3VisionInterface *apIface)
Definition: U3VDelegate.cpp:28
SocCamera
Definition: CameraTypes.h:7
SocCamera::tcPendingAckWatchdog< int >
SocCamera::tcU3VDelegate::pendingAckNeeded
virtual void pendingAckNeeded(const void *id)
Definition: U3VDelegate.cpp:362
SocCamera::tcU3VDelegate::~tcU3VDelegate
virtual ~tcU3VDelegate()
Definition: U3VDelegate.cpp:45