wheel_legged_gimbal/bsp/spi/bsp_spi.md

9 lines
546 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# bsp spi
> 预计增加模拟spi
初始化传入参数中的GPIOxGPIOAGPIOB...和cs_pinGPIO_PIN_1,GPIO_PIN_2, ...都是HAL库内建的宏在CubeMX初始化的时候若有给gpio分配标签则填入对应名字即可否则填入原本的宏。
注意如果你没有在CubeMX中为spi分配dma通道请不要使用dma模式
后续添加安全检查通过判断hspi的dma handler是否为空来选择模式如果为空则自动将DMA转为IT模式以继续传输并通过log warning 提醒用户)