Mercurial > public > ostc4
comparison Small_CPU/Src/uart.c @ 894:9e2f9b91e827 Evo_2_23
GNSS UART DMA test
author | heinrichsweikamp |
---|---|
date | Wed, 18 Sep 2024 14:30:45 +0200 |
parents | 651d21777b61 |
children | 4832981f9af8 |
comparison
equal
deleted
inserted
replaced
890:651d21777b61 | 894:9e2f9b91e827 |
---|---|
128 PA12 ------> USART6_RX | 128 PA12 ------> USART6_RX |
129 */ | 129 */ |
130 GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; | 130 GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; |
131 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | 131 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; |
132 GPIO_InitStruct.Pull = GPIO_NOPULL; | 132 GPIO_InitStruct.Pull = GPIO_NOPULL; |
133 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | 133 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; |
134 GPIO_InitStruct.Alternate = GPIO_AF8_USART6; | 134 GPIO_InitStruct.Alternate = GPIO_AF8_USART6; |
135 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | 135 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); |
136 | 136 |
137 /* USART6 DMA Init */ | 137 /* USART6 DMA Init */ |
138 /* USART6_RX Init */ | 138 /* USART6_RX Init */ |
139 hdma_usart6_rx.Instance = DMA2_Stream2; | 139 hdma_usart6_rx.Instance = DMA2_Stream2; |
140 hdma_usart6_rx.Init.Channel = DMA_CHANNEL_5; | 140 hdma_usart6_rx.Init.Channel = DMA_CHANNEL_5; |
141 hdma_usart6_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; | 141 hdma_usart6_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; |
142 hdma_usart6_rx.Init.PeriphInc = DMA_PINC_DISABLE; | 142 hdma_usart6_rx.Init.PeriphInc = DMA_PINC_DISABLE; |
143 hdma_usart6_rx.Init.MemInc = DMA_MINC_ENABLE; | 143 hdma_usart6_rx.Init.MemInc = DMA_MINC_ENABLE; |
144 hdma_usart6_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | 144 hdma_usart6_rx.Init.PeriphDataAlignment = DMA_MDATAALIGN_BYTE; |
145 hdma_usart6_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | 145 hdma_usart6_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; |
146 hdma_usart6_rx.Init.Mode = DMA_NORMAL; | 146 hdma_usart6_rx.Init.Mode = DMA_NORMAL; |
147 hdma_usart6_rx.Init.Priority = DMA_PRIORITY_LOW; | 147 hdma_usart6_rx.Init.Priority = DMA_PRIORITY_LOW; |
148 hdma_usart6_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; | 148 hdma_usart6_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; |
149 HAL_DMA_Init(&hdma_usart6_rx); | 149 HAL_DMA_Init(&hdma_usart6_rx); |
154 hdma_usart6_tx.Instance = DMA2_Stream6; | 154 hdma_usart6_tx.Instance = DMA2_Stream6; |
155 hdma_usart6_tx.Init.Channel = DMA_CHANNEL_5; | 155 hdma_usart6_tx.Init.Channel = DMA_CHANNEL_5; |
156 hdma_usart6_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; | 156 hdma_usart6_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; |
157 hdma_usart6_tx.Init.PeriphInc = DMA_PINC_DISABLE; | 157 hdma_usart6_tx.Init.PeriphInc = DMA_PINC_DISABLE; |
158 hdma_usart6_tx.Init.MemInc = DMA_MINC_ENABLE; | 158 hdma_usart6_tx.Init.MemInc = DMA_MINC_ENABLE; |
159 hdma_usart6_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | 159 hdma_usart6_tx.Init.PeriphDataAlignment = DMA_MDATAALIGN_BYTE; |
160 hdma_usart6_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | 160 hdma_usart6_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; |
161 hdma_usart6_tx.Init.Mode = DMA_NORMAL; | 161 hdma_usart6_tx.Init.Mode = DMA_NORMAL; |
162 hdma_usart6_tx.Init.Priority = DMA_PRIORITY_LOW; | 162 hdma_usart6_tx.Init.Priority = DMA_PRIORITY_LOW; |
163 hdma_usart6_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; | 163 hdma_usart6_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; |
164 HAL_DMA_Init(&hdma_usart6_tx); | 164 HAL_DMA_Init(&hdma_usart6_tx); |