|
stm32f407驅(qū)動(dòng)山外鷹眼二值化攝像頭,使用山外的多功能調(diào)試助手顯示,特此分享
無(wú)標(biāo)題.jpg (149.79 KB, 下載次數(shù): 137)
下載附件
2017-8-14 14:21 上傳
0.png (38.04 KB, 下載次數(shù): 122)
下載附件
2017-8-14 16:38 上傳
stm32f407芯片主程序:
- #include "main.h"
- uint8_t pic[OV7725_DATASIZE];
- bool busy = false;
- void ov7725_isr(void)
- {
- uint8_t *ptr = (uint8_t*)&pic[0];
- if(!busy)
- {
- OV7725_GetImg(ptr);
- busy = true;
- }
- }
- int main(void)
- {
- uint16_t i;
-
- GPIO_InitTypeDef GPIO_InitStruct;
- USART_InitTypeDef USART_InitStruct;
-
- //GPIO initialize
- RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);
- GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
- GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;
- GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP;
- GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
- GPIO_Init(GPIOA, &GPIO_InitStruct);
-
- //USART1 initialize
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);
- USART_InitStruct.USART_BaudRate = 256000UL;
- USART_InitStruct.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
- USART_InitStruct.USART_Mode = USART_Mode_Tx;
- USART_InitStruct.USART_Parity = USART_Parity_No;
- USART_InitStruct.USART_StopBits = USART_StopBits_1;
- USART_InitStruct.USART_WordLength = USART_WordLength_8b;
- USART_Init(USART1, &USART_InitStruct);
- USART_Cmd(USART1, ENABLE);
-
- printf("Hello, world!\r\n");
-
- if(OV7725_Init())
- printf("Camera init failed\r\n");
- else
- {
- OV7725_Callback_Install(ov7725_isr);
- //OV7725_Cmd(ENABLE);
- printf("Done!\r\n");
- }
-
- while(1)
- {
- if(busy)
- {
- putchar(0x01);
- putchar(0xFE);
- for(i = 0; i < OV7725_DATASIZE; i++)
- putchar(pic[i]);
- putchar(0xFE);
- putchar(0x01);
- busy = false;
- }
- }
- }
復(fù)制代碼
全部資料下載地址(源碼):
STM32F407-OV7725.zip
(815.37 KB, 下載次數(shù): 294)
2017-8-14 14:18 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
評(píng)分
-
查看全部評(píng)分
|