Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
BadPixelReplacement.h
Go to the documentation of this file.
1 /*
2  * BadPixelReplacement.h
3  *
4  * Created on: Dec 5, 2017
5  * Author: mitydsp
6  * Reference: http://wanda/svn/camera/soc_camera/trunk/hw/fpga/ip/bad_pixel_replacement/BadPixelReplacementDocumentation.pdf
7  */
8 
9 #ifndef BADPIXELREPLACEMENT_H_
10 #define BADPIXELREPLACEMENT_H_
11 
12 #include <stdint.h>
13 #include <memory>
14 #include <string>
15 
16 #include <libfpga/fpgaregister.h>
17 #include "CameraTypes.h"
18 
19 #include "libfpga/sgdma_dispatcher.h"
20 
22 public:
30  tcBadPixelReplacement(uint32_t anAddress, uint32_t anReadMasterAddr, uint32_t anReadMasterDescriptors, uint32_t anMapAddress, SocCamera::ROI asMaxROI);
31  virtual ~tcBadPixelReplacement();
32 
36  bool initialize();
37 
41  void reset(bool abReset);
42  bool readReset();
43 
51  void setData(std::string acFile);
52 
56  void setRoi(SocCamera::ROI acROI);
57 
64  void setMapState(bool abOn);
65 
70  bool mapState();
71 
76  bool onState();
77 
83  void setColor(bool abColor);
84  bool readColorMode();
85 
90  std::string defaultData();
91 
99  void setExtension(uint8_t anExtension);
100  uint8_t readExtension();
101 
106  bool readHeaderDecodeErr();
107 
114 
121 
129  uint8_t readRowFifoAlmostFull();
130 
138  uint8_t readRowFifoFull();
139 
143  void dumpRegisters();
144 
145 private:
146  uint32_t numPixelsWords(SocCamera::ROI &acROI);
147 
148  uint32_t byteIdx(int x, int y);
149  uint32_t wordIdx(int x, int y);
150 
151  std::string mcFilename;
152  bool mbOn;
153  tcFPGARegister<uint32_t> mcReg;
154  volatile uint8_t * mpMemory;
155  unsigned int mnMapAddress;
156  unsigned int mnDataSize;
157  bool mbInitialized;
158 
159  SocCamera::ROI mcROI;
160 
161  // Leave this as uint8_t, it doesn't work correctly unless its uint8_t
162  typedef uint8_t BackingDataType;
163 
164  std::unique_ptr<BackingDataType[]> mpBadPixelMap;
165 
166  SocCamera::ROI msMaxRoi;
167 
168  uint32_t mnReadMasterAddr;
169  uint32_t mnReadMasterDescriptors;
170  std::unique_ptr<tcSGDMADispatcher> mpSgdma;
171 };
172 
173 #endif /* BADPIXELREPLACEMENT_H_ */
tcBadPixelReplacement::tcBadPixelReplacement
tcBadPixelReplacement(uint32_t anAddress, uint32_t anReadMasterAddr, uint32_t anReadMasterDescriptors, uint32_t anMapAddress, SocCamera::ROI asMaxROI)
Definition: BadPixelReplacement.cpp:36
tcBadPixelReplacement::setData
void setData(std::string acFile)
Definition: BadPixelReplacement.cpp:107
tcBadPixelReplacement::readRowFifoFull
uint8_t readRowFifoFull()
readRowFifoFull Returns logic high if FIFO used to buffer row data fills. Indicates g_max_row_num_pix...
Definition: BadPixelReplacement.cpp:246
tcBadPixelReplacement::readHeaderDecodeErr
bool readHeaderDecodeErr()
readHeaderDecodeErr Returns logic high if error occurred in decoding incoming frame packet....
Definition: BadPixelReplacement.cpp:226
CameraTypes.h
tcBadPixelReplacement::initialize
bool initialize()
Definition: BadPixelReplacement.cpp:75
tcBadPixelReplacement::setExtension
void setExtension(uint8_t anExtension)
setExtension Set Flush Cycles Allows for adjusting number of cycles required to data from Pixel Proce...
Definition: BadPixelReplacement.cpp:215
tcBadPixelReplacement::setColor
void setColor(bool abColor)
setColor Enable bayer mode Active high enable for handling data from sensor with Bayer filter.
Definition: BadPixelReplacement.cpp:200
tcBadPixelReplacement::readExtension
uint8_t readExtension()
Definition: BadPixelReplacement.cpp:221
tcBadPixelReplacement::readColorMode
bool readColorMode()
Definition: BadPixelReplacement.cpp:205
tcBadPixelReplacement::reset
void reset(bool abReset)
Definition: BadPixelReplacement.cpp:91
tcBadPixelReplacement::setMapState
void setMapState(bool abOn)
setMapState Enable debug black and white mode Allows for changing all pixel values to be all 0’s or a...
Definition: BadPixelReplacement.cpp:185
tcBadPixelReplacement::readBadPixelUnderflowErr
bool readBadPixelUnderflowErr()
Definition: BadPixelReplacement.cpp:236
tcBadPixelReplacement
Definition: BadPixelReplacement.h:21
tcBadPixelReplacement::setRoi
void setRoi(SocCamera::ROI acROI)
Definition: BadPixelReplacement.cpp:163
tcBadPixelReplacement::~tcBadPixelReplacement
virtual ~tcBadPixelReplacement()
Definition: BadPixelReplacement.cpp:71
tcBadPixelReplacement::readReset
bool readReset()
Definition: BadPixelReplacement.cpp:102
SocCamera::ROI
Definition: ROI.h:10
tcBadPixelReplacement::mapState
bool mapState()
mapState Is map state enabled
Definition: BadPixelReplacement.cpp:190
tcBadPixelReplacement::defaultData
std::string defaultData()
defaultData Get data filename
Definition: BadPixelReplacement.cpp:210
tcBadPixelReplacement::readConsecutiveFrameDelayErr
bool readConsecutiveFrameDelayErr()
readConsecutiveFrameDelayErr Returns logic high if not enough time was present between two consecutiv...
Definition: BadPixelReplacement.cpp:231
tcBadPixelReplacement::dumpRegisters
void dumpRegisters()
Definition: BadPixelReplacement.cpp:251
tcBadPixelReplacement::readRowFifoAlmostFull
uint8_t readRowFifoAlmostFull()
readRowFifoAlmostFull Returns logic high if FIFO used to buffer row data almost fills....
Definition: BadPixelReplacement.cpp:241
tcBadPixelReplacement::onState
bool onState()
onState Is core running
Definition: BadPixelReplacement.cpp:195