void Camera_init(void) { gpio_Interrupt_init(PORTD,14, GPI_UP,FALLING) ; //场中断 gpio_Interrupt_init(PORTD,13, GPI_DOWN, RING) ; //行中断 DMA_PORTx2BUFF_Init (DMA_CH4, (void *)&PTE_BYTE0_IN, BUFF, PTD12, DMA_BYTE1, DATACOUNT, DMA_rising_down); //初始化DMA模块 }
void Ov7725_exti_Init() { //DMA通道0初始化,PTB0上升沿触发DMA传输,源地址为PTD_BYTE0_IN,目的地址为:BUFF ,每次传输1Byte,传输320次后停止传输,保存目的地址不变 DMA_PORTx2BUFF_Init(CAMERA_DMA_CH, (void *)&PTB_BYTE0_IN, (void *)IMG_BUFF, PTB8, DMA_BYTE1, 320*2-2, DMA_rising_down_keepon); DMA_DIS(DMA_CH0); //先关闭 DMA DMA_IRQ_DIS(DMA_CH0); //不需要使用DMA中断,由行中断来控制DMA传输 exti_init(PORTA,29,rising_down); //场中断,内部下拉,上升沿触发中断 exti_init(PORTA,28,rising_down); //行中断,内部下拉,上升沿触发中断 }