DCMI for f446re ,ov7670

Dependencies:   ILI9341_SPI OV7670_SCCB mbed

Committer:
tmnt
Date:
Sun Nov 20 12:06:27 2016 +0000
Revision:
2:a75d27406b2f
Parent:
0:4e2fae6764b6
ADD PINMAP

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 2:a75d27406b2f 11 /*******ov7670********
tmnt 2:a75d27406b2f 12 +3V3 - 3V3 GND-GND
tmnt 2:a75d27406b2f 13 PC_12 - SIOC SIDO - PC10
tmnt 2:a75d27406b2f 14 PB_7 - VSYNC HREF - PA_4
tmnt 2:a75d27406b2f 15 PA_6 - PCLK XCLK - PA_8
tmnt 2:a75d27406b2f 16 PB_9 - D7 D6 - PB_8
tmnt 2:a75d27406b2f 17 PB_6 - D5 D4 - PC_11
tmnt 2:a75d27406b2f 18 PC_9 - D3 D2 - PC_8
tmnt 2:a75d27406b2f 19 PC_7 - D1 D0 - PC_6
tmnt 2:a75d27406b2f 20 +3V3-330Ω-RESET
tmnt 2:a75d27406b2f 21
tmnt 2:a75d27406b2f 22 ********ILI9341*********
tmnt 2:a75d27406b2f 23 SDO - PB_5
tmnt 2:a75d27406b2f 24 LED - 10kΩ - +3V3
tmnt 2:a75d27406b2f 25 SCK - PB_3
tmnt 2:a75d27406b2f 26 SDI - PB_4
tmnt 2:a75d27406b2f 27 DC - PA_7
tmnt 2:a75d27406b2f 28 RS - PA_12
tmnt 2:a75d27406b2f 29 CS - PA_11
tmnt 2:a75d27406b2f 30 GND - GND
tmnt 2:a75d27406b2f 31 VCC - +3V3
tmnt 2:a75d27406b2f 32 */
tmnt 2:a75d27406b2f 33
tmnt 0:4e2fae6764b6 34 SPI spi(PB_5,PB_4,PB_3);
tmnt 0:4e2fae6764b6 35 ili9341_spi lcd(spi,PA_11,PA_7,PA_12);
tmnt 0:4e2fae6764b6 36 ov7670_sccb sccb(PC_10,PC_12);
tmnt 0:4e2fae6764b6 37 //Don't use PA8
tmnt 0:4e2fae6764b6 38 int main(){
tmnt 0:4e2fae6764b6 39 spi.format(8,3);
tmnt 0:4e2fae6764b6 40 spi.frequency(10000000);
tmnt 0:4e2fae6764b6 41 lcd.tft_reset();
tmnt 0:4e2fae6764b6 42 sccb.cam_init();
tmnt 0:4e2fae6764b6 43 wait(1);
tmnt 0:4e2fae6764b6 44 lcd.wr_cmd(0x2C);
tmnt 0:4e2fae6764b6 45 lcd.fillrect(0,0,149,144,0xf800);
tmnt 0:4e2fae6764b6 46 lcd.wr_cmd(0x2C);
tmnt 0:4e2fae6764b6 47
tmnt 0:4e2fae6764b6 48 dcmi_Init();
tmnt 0:4e2fae6764b6 49 spi_Init();
tmnt 0:4e2fae6764b6 50 HAL_SPI_Transmit_DMA(&spi1, (uint8_t*)frame_buffer, sizeof(frame_buffer));
tmnt 0:4e2fae6764b6 51 while(1){
tmnt 0:4e2fae6764b6 52 }
tmnt 0:4e2fae6764b6 53
tmnt 0:4e2fae6764b6 54 }
tmnt 0:4e2fae6764b6 55
tmnt 0:4e2fae6764b6 56