OV7740 image sensor capture example.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | _display() draw_frame_yuv_color_int() |
#define | DEFAULT_MODE_COLORED |
#define | PIO_PCMR_DSIZE_WORD PIO_PCMR_DSIZE(2) |
#define | TWI_CLK (400000UL) |
Functions | |
static void | board_configure_sram (void) |
Configure SMC interface for SRAM. More... | |
static void | button_handler (uint32_t ul_id, uint32_t ul_mask) |
Handler for button rising edge interrupt. More... | |
static void | capture_init (void) |
Initialize PIO capture and the OV7740 image sensor. More... | |
static uint8_t | clip32_to_8 (int32_t i) |
Take a 32 bit variable in parameters and returns a value between 0 and 255. More... | |
static void | configure_button (void) |
Configure push button and initialize button_handler interrupt. More... | |
static void | display_init (void) |
Intialize LCD display. More... | |
static void | draw_frame_yuv_color_int (void) |
Draw LCD in color with integral algorithm. More... | |
static void | init_vsync_interrupts (void) |
Intialize Vsync_Handler. More... | |
int | main (void) |
Application entry point for image sensor capture example. More... | |
static void | pio_capture_init (Pio *p_pio, uint32_t ul_id) |
Initialize PIO capture for the OV7740 image sensor communication. More... | |
static uint8_t | pio_capture_to_buffer (Pio *p_pio, uint8_t *uc_buf, uint32_t ul_size) |
Capture OV7740 data to a buffer. More... | |
static void | start_capture (void) |
Start picture capture. More... | |
static void | vsync_handler (uint32_t ul_id, uint32_t ul_mask) |
Handler for vertical synchronisation using by the OV7740 image sensor. More... | |
Variables | |
uint8_t * | g_p_uc_cap_dest_buf |
static volatile uint32_t | g_ul_push_button_trigger = false |
static volatile uint32_t | g_ul_vsync_flag = false |
uint16_t | g_us_cap_line = (IMAGE_WIDTH * 2) |
uint16_t | g_us_cap_rows = IMAGE_HEIGHT |
#define _display | ( | ) | draw_frame_yuv_color_int() |
Referenced by main().
#define DEFAULT_MODE_COLORED |
#define PIO_PCMR_DSIZE_WORD PIO_PCMR_DSIZE(2) |
Referenced by pio_capture_init().
#define TWI_CLK (400000UL) |
Referenced by capture_init().
|
static |
Configure SMC interface for SRAM.
References pmc_enable_periph_clk(), smc_set_cycle_timing(), smc_set_mode(), smc_set_pulse_timing(), and smc_set_setup_timing().
Referenced by main().
|
static |
Handler for button rising edge interrupt.
References g_ul_push_button_trigger, and unused.
Referenced by configure_button().
|
static |
Initialize PIO capture and the OV7740 image sensor.
References delay_ms, init_vsync_interrupts(), twi_options::master_clk, ov_configure(), ov_init(), ov_power(), pio_capture_init(), pmc_enable_periph_clk(), PMC_PCK_PRES_CLK_4, QVGA_YUV422_20FPS, twi_options::speed, sysclk_get_cpu_hz(), TWI_CLK, and twi_master_init().
Referenced by main().
|
inlinestatic |
Take a 32 bit variable in parameters and returns a value between 0 and 255.
i | Enter value . |
Referenced by draw_frame_yuv_color_int().
|
static |
Configure push button and initialize button_handler interrupt.
References button_handler(), pio_enable_interrupt(), pio_set_debounce_filter(), and pmc_enable_periph_clk().
Referenced by main().
|
static |
Intialize LCD display.
References aat31xx_disable_backlight(), AAT31XX_MAX_BACKLIGHT_LEVEL, aat31xx_set_backlight(), ili9325_opt_t::background_color, COLOR_BLACK, COLOR_WHITE, ili9325_opt_t::foreground_color, ili9325_display_on(), ili9325_init(), ILI9325_LCD_CS, ILI9325_LCD_HEIGHT, ILI9325_LCD_WIDTH, pmc_enable_periph_clk(), smc_set_cycle_timing(), smc_set_mode(), smc_set_pulse_timing(), smc_set_setup_timing(), ili9325_opt_t::ul_height, and ili9325_opt_t::ul_width.
Referenced by main().
|
static |
Draw LCD in color with integral algorithm.
References clip32_to_8(), g_p_uc_cap_dest_buf, ili9325_draw_prepare(), ILI9325_ENTRY_MODE, ILI9325_ENTRY_MODE_AM, ILI9325_ENTRY_MODE_BGR, ILI9325_ENTRY_MODE_DFM, ILI9325_ENTRY_MODE_ORG, and ILI9325_ENTRY_MODE_TRI.
|
static |
int main | ( | void | ) |
Application entry point for image sensor capture example.
References _display, board_configure_sram(), board_init(), capture_init(), COLOR_TURQUOISE, configure_button(), display_init(), g_ul_push_button_trigger, ili9325_draw_string(), ili9325_fill(), pmc_enable_pllack(), start_capture(), and sysclk_init().
|
static |
Initialize PIO capture for the OV7740 image sensor communication.
p_pio | PIO instance to be configured in PIO capture mode. |
ul_id | Corresponding PIO ID. |
References PIO_PCMR_DSIZE_WORD, and pmc_enable_periph_clk().
Referenced by capture_init().
|
static |
Capture OV7740 data to a buffer.
p_pio | PIO instance which will capture data from OV7740 iamge sensor. |
p_uc_buf | Buffer address where captured data must be stored. |
ul_size | Data frame size. |
Referenced by start_capture().
|
static |
Start picture capture.
References g_p_uc_cap_dest_buf, g_ul_vsync_flag, g_us_cap_line, g_us_cap_rows, pio_capture_to_buffer(), pio_disable_interrupt(), and pio_enable_interrupt().
Referenced by main().
|
static |
Handler for vertical synchronisation using by the OV7740 image sensor.
References g_ul_vsync_flag, and unused.
Referenced by init_vsync_interrupts().
uint8_t* g_p_uc_cap_dest_buf |
Referenced by draw_frame_yuv_color_int(), and start_capture().
|
static |
Referenced by button_handler(), and main().
|
static |
Referenced by start_capture(), and vsync_handler().
uint16_t g_us_cap_line = (IMAGE_WIDTH * 2) |
Referenced by start_capture().
uint16_t g_us_cap_rows = IMAGE_HEIGHT |
Referenced by start_capture().