34 #ifndef MT9F002_OUTPUT_HEIGHT
35 #define MT9F002_OUTPUT_HEIGHT 822 // full resolution 3288
38 #ifndef MT9F002_OUTPUT_WIDTH
39 #define MT9F002_OUTPUT_WIDTH 1152 // full resolution 4608
42 #ifndef MT9F002_INITIAL_OFFSET_X
43 #define MT9F002_INITIAL_OFFSET_X 0. // signed fractional offset from centre of image of original sensor [-0.5,0.5]
46 #ifndef MT9F002_INITIAL_OFFSET_Y
47 #define MT9F002_INITIAL_OFFSET_Y 0. // signed fractional offset from centre of image of original sensor [-0.5,0.5]
61 #ifndef MT9F002_OUTPUT_SCALER
62 #define MT9F002_OUTPUT_SCALER 1.
70 #ifndef MT9F002_TARGET_EXPOSURE
71 #define MT9F002_TARGET_EXPOSURE 30
74 #ifndef MT9F002_TARGET_FPS
75 #define MT9F002_TARGET_FPS 15
79 #ifndef MT9F002_GAIN_GREEN1
80 #define MT9F002_GAIN_GREEN1 3.0
83 #ifndef MT9F002_GAIN_GREEN2
84 #define MT9F002_GAIN_GREEN2 3.0
87 #ifndef MT9F002_GAIN_RED
88 #define MT9F002_GAIN_RED 3.0
91 #ifndef MT9F002_GAIN_BLUE
92 #define MT9F002_GAIN_BLUE 4.0
97 #ifndef MT9F002_X_ODD_INC_VAL
98 #define MT9F002_X_ODD_INC_VAL 1
102 #ifndef MT9F002_Y_ODD_INC_VAL
103 #define MT9F002_Y_ODD_INC_VAL 1
107 #ifndef MT9F002_FOCAL_X
108 #define MT9F002_FOCAL_X 311.59304538f
110 #ifndef MT9F002_FOCAL_Y
111 #define MT9F002_FOCAL_Y 313.01338397f
113 #ifndef MT9F002_CENTER_X
114 #define MT9F002_CENTER_X 158.37457814f
116 #ifndef MT9F002_CENTER_Y
117 #define MT9F002_CENTER_Y 326.49375925f
119 #ifndef MT9F002_DHANE_K
120 #define MT9F002_DHANE_K 1.25f
uint8_t x_odd_inc
X increment for subsampling (1,3,7,15,31 accepted)
uint16_t output_height
Output height.
uint16_t op_sys_clk_div
Fixed PLL config from calculator tool.
uint8_t rowSpeed_2_0
Fixed PLL config from calculator tool.
uint16_t vt_pix_clk_div
Fixed PLL config from calculator tool.
uint16_t pll_multiplier
Fixed PLL config from calculator tool.
void mt9f002_set_exposure(struct mt9f002_t *mt)
Set the exposure configuration Depends on the blanking (and therefore the FPS)
uint16_t scaled_width
Width after corrected scaling.
float gain_blue
Gain for the Blue pixels [1.5 -> 63.50].
float offset_y
Offset from top in pixels.
uint8_t y_odd_inc
Y increment for subsampling (1,3,7 accepted)
uint16_t vt_sys_clk_div
Fixed PLL config from calculator tool.
void mt9f002_init(struct mt9f002_t *mt)
Initialisation of the Aptina MT9F002 CMOS sensor (front camera)
float offset_x
Offset from left in pixels.
float output_scaler
Output scale.
uint8_t shift_vt_pix_clk_div
Fixed PLL config from calculator tool.
uint8_t row_speed_10_8
Fixed PLL config from calculator tool.
void mt9f002_set_resolution(struct mt9f002_t *mt)
enum mt9f002_interface interface
Interface used to connect.
uint16_t line_length
Calculated line length of blanking.
float real_fps
Real calculated FPS.
float gain_green1
Gain for the GreenR pixels [1.5 -> 63.50].
uint16_t output_width
Output width.
float vt_pix_clk
Calculated based on PLL.
float target_fps
FPS wanted.
float gain_red
Gain for the Red pixels [1.5 -> 63.50].
I2C transaction structure.
struct i2c_periph * i2c_periph
I2C peripheral used to communicate over.
float gain_green2
Gain for the GreenB pixels [1.5 -> 63.50].
float real_exposure
Real exposure time in ms.
I2C peripheral structure.
struct i2c_transaction i2c_trans
I2C transaction for comminication with CMOS chip.
uint16_t op_pix_clk_div
Fixed PLL config from calculator tool.
float op_pix_clk
Calculated based on PLL.
uint16_t pre_pll_clk_div
Fixed PLL config from calculator tool.
Parallel type connection.
uint16_t scaled_height
Height after corrected scaling.
uint16_t frame_length
Calculated frame length of blanking.
float input_clk_freq
Input clock frequency.
float target_exposure
Target exposure time in ms.
void mt9f002_set_gains(struct mt9f002_t *mt)
Sets the GreenR, Blue, Red and GreenB gains.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.