c - xError When compiling Dcmi -
excuse english.
i want set dcmi in hal, because use coocox have copy code generator cubemx
the compiler not line:
__hal_linkdma(hdcmi, dma_handle, hdma_dcmi);
code:
void dcmi_dma_init(void){ gpio_inittypedef gpio_initstruct; __gpioe_clk_enable(); __gpioa_clk_enable(); __gpioc_clk_enable(); __gpiod_clk_enable(); __dcmi_clk_enable(); __dma2_clk_enable(); hal_nvic_setprioritygrouping(nvic_prioritygroup_2); hal_nvic_setpriority(dcmi_irqn, 0, 0); hal_nvic_enableirq(dcmi_irqn); /* pe4 ------> dcmi_d4 pe5 ------> dcmi_d6 pe6 ------> dcmi_d7 pa6 ------> dcmi_pixck pc6 ------> dcmi_d0 pc7 ------> dcmi_d1 pc8 ------> dcmi_d2 pc9 ------> dcmi_d3 pd3 ------> dcmi_d5 */ gpio_initstruct.pin = gpio_pin_4 | gpio_pin_5 | gpio_pin_6; gpio_initstruct.mode = gpio_mode_af_pp; gpio_initstruct.pull = gpio_nopull; gpio_initstruct.speed = gpio_speed_high; gpio_initstruct.alternate = gpio_af13_dcmi; hal_gpio_init(gpioe, &gpio_initstruct); gpio_initstruct.pin = gpio_pin_6; gpio_initstruct.mode = gpio_mode_af_pp; gpio_initstruct.pull = gpio_nopull; gpio_initstruct.speed = gpio_speed_high; gpio_initstruct.alternate = gpio_af13_dcmi; hal_gpio_init(gpioa, &gpio_initstruct); gpio_initstruct.pin = gpio_pin_6 | gpio_pin_7 | gpio_pin_8 | gpio_pin_9; gpio_initstruct.mode = gpio_mode_af_pp; gpio_initstruct.pull = gpio_nopull; gpio_initstruct.speed = gpio_speed_high; gpio_initstruct.alternate = gpio_af13_dcmi; hal_gpio_init(gpioc, &gpio_initstruct); gpio_initstruct.pin = gpio_pin_3; gpio_initstruct.mode = gpio_mode_af_pp; gpio_initstruct.pull = gpio_nopull; gpio_initstruct.speed = gpio_speed_high; gpio_initstruct.alternate = gpio_af13_dcmi; hal_gpio_init(gpiod, &gpio_initstruct); hdcmi.instance = dcmi; hdcmi.init.synchromode = dcmi_synchro_hardware; hdcmi.init.pckpolarity = dcmi_pckpolarity_falling; hdcmi.init.vspolarity = dcmi_vspolarity_high; hdcmi.init.hspolarity = dcmi_hspolarity_high; hdcmi.init.capturerate = dcmi_cr_all_frame; hdcmi.init.extendeddatamode = dcmi_extend_data_8b; hdcmi.init.jpegmode = dcmi_jpeg_disable; hal_dcmi_init(&hdcmi); hdma_dcmi.instance = dma2_stream1; hdma_dcmi.init.channel = dma_channel_1; hdma_dcmi.init.direction = dma_periph_to_memory; hdma_dcmi.init.periphinc = dma_pinc_enable; hdma_dcmi.init.meminc = dma_minc_enable; hdma_dcmi.init.periphdataalignment = dma_pdataalign_word; hdma_dcmi.init.memdataalignment = dma_mdataalign_word; hdma_dcmi.init.mode = dma_normal; hdma_dcmi.init.priority = dma_priority_very_high; hdma_dcmi.init.fifomode = dma_fifomode_enable; hdma_dcmi.init.fifothreshold = dma_fifo_threshold_full; hdma_dcmi.init.memburst = dma_mburst_single; hdma_dcmi.init.periphburst = dma_pburst_single; hal_dma_init(&hdma_dcmi); // macro code: //hdcmi->dma_handle = &hdma_dcmi; //hdma_dcmi.parent = hdcmi; __hal_linkdma(hdcmi, dma_handle, hdma_dcmi); }
error:
[cc] c:\.......\libs\ov7670\ov7670_control.c: in function 'dcmi_dma_init': [cc] c:\.......\stm32f429xx_cmsisboot\source\hal/stm32f4xx_hal_def.h:95:43: error: invalid type argument of '->' (have 'dcmi_handletypedef') [cc] (__handle__)->__ppp_dma_field__ = &(__dma_handle__); \ [cc] ^ [cc] c:\.......\libs\ov7670\ov7670_control.c:249:2: note: in expansion of macro '__hal_linkdma' [cc] __hal_linkdma(hdcmi, dma_handle, hdma_dcmi); [cc] ^ [cc] c:\.......\stm32f429xx_cmsisboot\source\hal/stm32f4xx_hal_def.h:96:55: error: incompatible types when assigning type 'void *' type 'dcmi_handletypedef' [cc] (__dma_handle__).parent = (__handle__); \ [cc] ^ [cc] c:\.......\libs\ov7670\ov7670_control.c:249:2: note: in expansion of macro '__hal_linkdma' [cc] __hal_linkdma(hdcmi, dma_handle, hdma_dcmi); [cc] ^
using __hal_linkdma(&hdcmi, dma_handle, hdma_dcmi); instead seems solve.
Comments
Post a Comment