基于STM32L452的timer flash gpio usart等外设驱动代码,直接添加可用。
串口使用环形缓冲区收发,增加串口方便简洁
P_UART P_UartTbl[ 3 ] = {
[ UART_1 ] = {
.USARTx = USART1,
.UARTx_IRQn = USART1_IRQn,
.RCC_Uartx = LL_APB2_GRP1_PERIPH_USART1,
.RCC_PinPort = LL_AHB2_GRP1_PERIPH_GPIOA,
.PreemPriority = 6,
.SubPriority = 0,
.PinPort = GPIOA,
.TxPin = GPIO_PIN_9,
.RxPin = GPIO_PIN_10,
.BaudRate = 9600,
.Parity = LL_USART_PARITY_NONE,
},
[ UART_2 ] = {
.USARTx = USART2,
.UARTx_IRQn = USART2_IRQn,
.RCC_Uartx = LL_APB1_GRP1_PERIPH_USART2,
.RCC_PinPort = LL_AHB2_GRP1_PERIPH_GPIOA,
.PreemPriority = 6,
.SubPriority = 0,
.PinPort = GPIOA,
.TxPin = GPIO_PIN_2,
.RxPin = GPIO_PIN_3,
.BaudRate = 115200,
.Parity = LL_USART_PARITY_NONE,
1