DCMI for f446re ,ov7670

Dependencies:   ILI9341_SPI OV7670_SCCB mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include <stdlib.h>
00003 #include <stdio.h>
00004 #include <math.h>
00005 #include "DCMI.h"
00006 #include "ILI9341.h"
00007 #include "SCCB.h"
00008 #include "SPI_DMAInit.h"
00009 
00010 
00011   /*******ov7670********
00012    +3V3 - 3V3         GND-GND
00013   PC_12 - SIOC        SIDO - PC10
00014    PB_7 - VSYNC       HREF - PA_4
00015    PA_6 - PCLK        XCLK - PA_8
00016    PB_9 - D7          D6 - PB_8
00017    PB_6 - D5          D4 - PC_11
00018    PC_9 - D3          D2 - PC_8
00019    PC_7 - D1          D0 - PC_6
00020 +3V3-330Ω-RESET
00021 
00022   ********ILI9341*********
00023 SDO - PB_5
00024 LED - 10kΩ - +3V3
00025 SCK - PB_3
00026 SDI - PB_4
00027 DC  - PA_7
00028 RS  - PA_12
00029 CS  - PA_11
00030 GND - GND
00031 VCC - +3V3
00032 */ 
00033 
00034 SPI spi(PB_5,PB_4,PB_3);
00035 ili9341_spi lcd(spi,PA_11,PA_7,PA_12);
00036 ov7670_sccb sccb(PC_10,PC_12);
00037 //Don't use PA8
00038 int main(){
00039     spi.format(8,3);
00040     spi.frequency(10000000); 
00041     lcd.tft_reset(); 
00042     sccb.cam_init();
00043     wait(1);
00044     lcd.wr_cmd(0x2C);
00045     lcd.fillrect(0,0,149,144,0xf800);
00046     lcd.wr_cmd(0x2C);
00047     
00048     dcmi_Init();
00049     spi_Init();
00050     HAL_SPI_Transmit_DMA(&spi1, (uint8_t*)frame_buffer, sizeof(frame_buffer));
00051     while(1){
00052         }
00053     
00054     }
00055     
00056