Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Initialization and configuration of the MT9F002 CMOS Chip. More...
Go to the source code of this file.
Data Structures | |
struct | mt9f002_t |
Enumerations | |
enum | mt9f002_interface { MT9F002_MIPI, MT9F002_HiSPi, MT9F002_PARALLEL } |
Functions | |
void | mt9f002_init (struct mt9f002_t *mt) |
Initialisation of the Aptina MT9F002 CMOS sensor (front camera) More... | |
void | mt9f002_reset_exposure (struct mt9f002_t *mt) |
void | mt9f002_set_exposure (struct mt9f002_t *mt) |
Set the exposure configuration Depends on the blanking (and therefore the FPS) More... | |
void | mt9f002_reset_color (struct mt9f002_t *mt) |
void | mt9f002_set_gains (struct mt9f002_t *mt) |
Sets the GreenR, Blue, Red and GreenB gains. More... | |
void | mt9f002_setting_update_resolution (float in) |
void | mt9f002_setting_update_color (float in) |
void | mt9f002_setting_update_exposure (float in) |
Variables | |
struct mt9f002_t | mt9f002 |
float | mt9f002_send_resolution |
float | mt9f002_send_color |
float | mt9f002_send_exposure |
Initialization and configuration of the MT9F002 CMOS Chip.
Definition in file mt9f002.h.
struct mt9f002_t |
Data Fields | ||
---|---|---|
uint16_t | frame_length | Calculated frame length of blanking. |
float | gain_blue | Gain for the Blue pixels [1., 63.50]. |
float | gain_green1 | Gain for the GreenR pixels [1., 63.50]. |
float | gain_green2 | Gain for the GreenB pixels [1., 63.50]. |
float | gain_red | Gain for the Red pixels [1., 63.50]. |
struct i2c_periph * | i2c_periph | I2C peripheral used to communicate over. |
struct i2c_transaction | i2c_trans | I2C transaction for communication with CMOS chip. |
float | input_clk_freq | Input clock frequency. |
enum mt9f002_interface | interface | Interface used to connect. |
uint16_t | line_length | Calculated line length of blanking. |
uint16_t | offset_x | Offset from left in pixels. |
uint16_t | offset_y | Offset from top in pixels. |
float | op_pix_clk | Calculated based on PLL. |
uint16_t | op_pix_clk_div | Fixed PLL config from calculator tool. |
uint16_t | op_sys_clk_div | Fixed PLL config from calculator tool. |
uint16_t | output_height | Output height. |
uint16_t | output_scaler | Output scaler. |
uint16_t | output_width | Output width. |
uint16_t | pll_multiplier | Fixed PLL config from calculator tool. |
uint16_t | pre_pll_clk_div | Fixed PLL config from calculator tool. |
float | real_exposure | Real exposure time in ms. |
float | real_fps | Real calculated FPS. |
uint8_t | row_speed_10_8 | Fixed PLL config from calculator tool. |
uint8_t | rowSpeed_2_0 | Fixed PLL config from calculator tool. |
uint16_t | scaled_height | Height after corrected scaling. |
uint16_t | scaled_width | Width after corrected scaling. |
uint16_t | sensor_height | |
uint16_t | sensor_width | |
float | set_offset_x | Signed fractional offset from centre of image of original sensor [-0.5,0.5]. |
float | set_offset_y | Signed fractional offset from centre of image of original sensor [-0.5,0.5]. |
float | set_zoom | Image zoom set point. |
uint8_t | shift_vt_pix_clk_div | Fixed PLL config from calculator tool. |
float | target_exposure | Target exposure time in ms. |
float | target_fps | FPS wanted. |
float | vt_pix_clk | Calculated based on PLL. |
uint16_t | vt_pix_clk_div | Fixed PLL config from calculator tool. |
uint16_t | vt_sys_clk_div | Fixed PLL config from calculator tool. |
uint8_t | x_odd_inc | X increment for subsampling (1,3,7,15,31 accepted) |
uint8_t | y_odd_inc | Y increment for subsampling (1,3,7,15,31 accepted) |
#define CFG_MT9F002_PIXEL_ARRAY_HEIGHT 3288 |
Definition at line 38 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_setting_update_resolution().
#define CFG_MT9F002_PIXEL_ARRAY_WIDTH 4608 |
Definition at line 39 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_setting_update_resolution().
#define CFG_MT9F002_WINDOW_HEIGHT_MIN 1 |
Definition at line 37 of file mt9f002.h.
Referenced by mt9f002_calc_resolution().
#define CFG_MT9F002_WINDOW_WIDTH_MIN 1 |
Definition at line 36 of file mt9f002.h.
Referenced by mt9f002_calc_resolution().
#define CFG_MT9F002_X_ADDR_MAX 4647 |
Definition at line 41 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_set_resolution().
#define CFG_MT9F002_X_ADDR_MIN 24 |
Definition at line 40 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_set_resolution().
#define CFG_MT9F002_Y_ADDR_MAX CFG_MT9F002_PIXEL_ARRAY_HEIGHT |
Definition at line 43 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_set_resolution().
#define CFG_MT9F002_Y_ADDR_MIN 0 |
Definition at line 42 of file mt9f002.h.
Referenced by mt9f002_calc_resolution(), and mt9f002_set_resolution().
#define CFG_SCALER_M_MAX 128 |
Definition at line 35 of file mt9f002.h.
Referenced by mt9f002_calc_resolution().
#define MT9F002_CENTER_X (MT9F002_OUTPUT_WIDTH * (.5f - MT9F002_ZOOM * MT9F002_OFFSET_X)) |
#define MT9F002_CENTER_Y (MT9F002_OUTPUT_HEIGHT * (.5f - MT9F002_ZOOM * MT9F002_OFFSET_Y)) |
#define MT9F002_FOCAL_X (MT9F002_ZOOM * MT9F002_OUTPUT_WIDTH / 2.f) |
#define MT9F002_FOCAL_Y (MT9F002_ZOOM * MT9F002_OUTPUT_HEIGHT / 2.f) |
#define MT9F002_TARGET_FPS 30 |
Definition at line 105 of file mt9f002.h.
Referenced by init_gazebo().
enum mt9f002_interface |
void mt9f002_init | ( | struct mt9f002_t * | mt | ) |
Initialisation of the Aptina MT9F002 CMOS sensor (front camera)
Definition at line 1036 of file mt9f002.c.
References mt9f002_t::i2c_trans, I2CTransDone, mt9f002_t::interface, isp_request_statistics_yuv_window(), mt9f002_calc_resolution(), MT9F002_HiSPi, MT9F002_MIPI, mt9f002_mipi_stage1(), mt9f002_mipi_stage2(), mt9f002_mipi_stage3(), MT9F002_MODE_SELECT, mt9f002_parallel_stage1(), mt9f002_parallel_stage2(), mt9f002_set_blanking(), mt9f002_set_exposure(), mt9f002_set_gains(), mt9f002_set_pll(), mt9f002_set_resolution(), MT9F002_SOFTWARE_RESET, mt9f002_t::sensor_height, mt9f002_t::sensor_width, i2c_transaction::status, VERBOSE_PRINT, and write_reg().
void mt9f002_reset_color | ( | struct mt9f002_t * | mt | ) |
Definition at line 1093 of file mt9f002.c.
References mt9f002_t::gain_blue, mt9f002_t::gain_green1, mt9f002_t::gain_green2, mt9f002_t::gain_red, MT9F002_GAIN_BLUE, MT9F002_GAIN_GREEN1, MT9F002_GAIN_GREEN2, MT9F002_GAIN_RED, and mt9f002_set_gains().
Referenced by update_ae_awb().
void mt9f002_reset_exposure | ( | struct mt9f002_t * | mt | ) |
Definition at line 1102 of file mt9f002.c.
References mt9f002_set_exposure(), MT9F002_TARGET_EXPOSURE, and mt9f002_t::target_exposure.
Referenced by update_ae_awb().
void mt9f002_set_exposure | ( | struct mt9f002_t * | mt | ) |
Set the exposure configuration Depends on the blanking (and therefore the FPS)
Definition at line 799 of file mt9f002.c.
References blanking_t::fine_integration_time_max_margin, blanking_t::fine_integration_time_min, mt9f002_t::frame_length, mt9f002_t::line_length, mt9f002_blanking, MT9F002_COARSE_INTEGRATION_TIME, MT9F002_COARSE_INTEGRATION_TIME_MAX_MARGIN, MT9F002_COARSE_INTEGRATION_TIME_MIN, MT9F002_FINE_INTEGRATION_TIME_, read_reg(), mt9f002_t::real_exposure, mt9f002_t::target_exposure, mt9f002_t::vt_pix_clk, and write_reg().
Referenced by mt9f002_init(), mt9f002_reset_exposure(), mt9f002_setting_update_exposure(), and update_ae_awb().
void mt9f002_set_gains | ( | struct mt9f002_t * | mt | ) |
Sets the GreenR, Blue, Red and GreenB gains.
Definition at line 906 of file mt9f002.c.
References mt9f002_t::gain_blue, mt9f002_t::gain_green1, mt9f002_t::gain_green2, mt9f002_t::gain_red, MT9F002_BLUE_GAIN, mt9f002_calc_gain(), MT9F002_GREEN1_GAIN, MT9F002_GREEN2_GAIN, MT9F002_RED_GAIN, and write_reg().
Referenced by mt9f002_init(), mt9f002_reset_color(), mt9f002_setting_update_color(), and update_ae_awb().
void mt9f002_setting_update_color | ( | float | in | ) |
Definition at line 1133 of file mt9f002.c.
References mt9f002_set_gains().
void mt9f002_setting_update_exposure | ( | float | in | ) |
Definition at line 1138 of file mt9f002.c.
References mt9f002_set_exposure().
void mt9f002_setting_update_resolution | ( | float | in | ) |
Definition at line 1111 of file mt9f002.c.
References CFG_MT9F002_PIXEL_ARRAY_HEIGHT, CFG_MT9F002_PIXEL_ARRAY_WIDTH, isp_request_statistics_yuv_window(), Max, mt9f002_calc_resolution(), mt9f002_set_blanking(), mt9f002_set_resolution(), mt9f002_t::offset_x, mt9f002_t::offset_y, mt9f002_t::sensor_height, mt9f002_t::sensor_width, mt9f002_t::set_offset_x, mt9f002_t::set_offset_y, and mt9f002_t::set_zoom.
struct mt9f002_t mt9f002 |
Definition at line 123 of file mt9f002.c.
Referenced by update_ae_awb().