DCMI for f446re ,ov7670

Dependencies:   ILI9341_SPI OV7670_SCCB mbed

Committer:
tmnt
Date:
Sun Nov 20 10:59:03 2016 +0000
Revision:
0:4e2fae6764b6
Child:
2:a75d27406b2f
DCMI for f446re

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tmnt 0:4e2fae6764b6 1 #include "mbed.h"
tmnt 0:4e2fae6764b6 2 #include <stdlib.h>
tmnt 0:4e2fae6764b6 3 #include <stdio.h>
tmnt 0:4e2fae6764b6 4 #include <math.h>
tmnt 0:4e2fae6764b6 5 #include "DCMI.h"
tmnt 0:4e2fae6764b6 6 #include "ILI9341.h"
tmnt 0:4e2fae6764b6 7 #include "SCCB.h"
tmnt 0:4e2fae6764b6 8 #include "SPI_DMAInit.h"
tmnt 0:4e2fae6764b6 9
tmnt 0:4e2fae6764b6 10
tmnt 0:4e2fae6764b6 11 SPI spi(PB_5,PB_4,PB_3);
tmnt 0:4e2fae6764b6 12 ili9341_spi lcd(spi,PA_11,PA_7,PA_12);
tmnt 0:4e2fae6764b6 13 ov7670_sccb sccb(PC_10,PC_12);
tmnt 0:4e2fae6764b6 14 //Don't use PA8
tmnt 0:4e2fae6764b6 15 int main(){
tmnt 0:4e2fae6764b6 16 spi.format(8,3);
tmnt 0:4e2fae6764b6 17 spi.frequency(10000000);
tmnt 0:4e2fae6764b6 18 lcd.tft_reset();
tmnt 0:4e2fae6764b6 19 sccb.cam_init();
tmnt 0:4e2fae6764b6 20 wait(1);
tmnt 0:4e2fae6764b6 21 lcd.wr_cmd(0x2C);
tmnt 0:4e2fae6764b6 22 lcd.fillrect(0,0,149,144,0xf800);
tmnt 0:4e2fae6764b6 23 lcd.wr_cmd(0x2C);
tmnt 0:4e2fae6764b6 24
tmnt 0:4e2fae6764b6 25 dcmi_Init();
tmnt 0:4e2fae6764b6 26 spi_Init();
tmnt 0:4e2fae6764b6 27 HAL_SPI_Transmit_DMA(&spi1, (uint8_t*)frame_buffer, sizeof(frame_buffer));
tmnt 0:4e2fae6764b6 28 while(1){
tmnt 0:4e2fae6764b6 29 }
tmnt 0:4e2fae6764b6 30
tmnt 0:4e2fae6764b6 31 }
tmnt 0:4e2fae6764b6 32
tmnt 0:4e2fae6764b6 33