TMNTmaker ! / NUCLEO-F446RE_testDCMI

DCMI for f446re ,ov7670

Dependencies:   ILI9341_SPI OV7670_SCCB mbed

main.cpp

Committer:
tmnt
Date:
5 months ago
Revision:
2:a75d27406b2f
Parent:
0:4e2fae6764b6

File content as of revision 2:a75d27406b2f:

#include "mbed.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "DCMI.h"
#include "ILI9341.h"
#include "SCCB.h"
#include "SPI_DMAInit.h"


  /*******ov7670********
   +3V3 - 3V3         GND-GND
  PC_12 - SIOC        SIDO - PC10
   PB_7 - VSYNC       HREF - PA_4
   PA_6 - PCLK        XCLK - PA_8
   PB_9 - D7          D6 - PB_8
   PB_6 - D5          D4 - PC_11
   PC_9 - D3          D2 - PC_8
   PC_7 - D1          D0 - PC_6
+3V3-330Ω-RESET

  ********ILI9341*********
SDO - PB_5
LED - 10kΩ - +3V3
SCK - PB_3
SDI - PB_4
DC  - PA_7
RS  - PA_12
CS  - PA_11
GND - GND
VCC - +3V3
*/ 

SPI spi(PB_5,PB_4,PB_3);
ili9341_spi lcd(spi,PA_11,PA_7,PA_12);
ov7670_sccb sccb(PC_10,PC_12);
//Don't use PA8
int main(){
    spi.format(8,3);
    spi.frequency(10000000); 
    lcd.tft_reset(); 
    sccb.cam_init();
    wait(1);
    lcd.wr_cmd(0x2C);
    lcd.fillrect(0,0,149,144,0xf800);
    lcd.wr_cmd(0x2C);
    
    dcmi_Init();
    spi_Init();
    HAL_SPI_Transmit_DMA(&spi1, (uint8_t*)frame_buffer, sizeof(frame_buffer));
    while(1){
        }
    
    }