1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Merge pull request #9524 from jflyper/bfdev-h7-lpuart-support

[H7] LPUART support
This commit is contained in:
Michael Keller 2020-03-03 00:54:17 +13:00 committed by GitHub
commit 94e7d7c24b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 3 deletions

View file

@ -334,6 +334,36 @@ const uartHardware_t uartHardware[UARTDEV_COUNT] = {
.rxBufferSize = sizeof(uart8RxBuffer),
},
#endif
#ifdef USE_UART9
// On H7, UART9 is implemented with LPUART1
{
.device = UARTDEV_9,
.reg = LPUART1,
#ifdef USE_DMA
.rxDMAChannel = BDMA_REQUEST_LPUART1_RX,
.rxDMAResource = (dmaResource_t *)NULL, // No DMA support yet (Need BDMA support)
.txDMAChannel = BDMA_REQUEST_LPUART1_TX,
.txDMAResource = (dmaResource_t *)NULL, // No DMA support yet (Need BDMA support)
#endif
.rxPins = {
{ DEFIO_TAG_E(PA10), GPIO_AF3_LPUART },
{ DEFIO_TAG_E(PB7), GPIO_AF8_LPUART }
},
.txPins = {
{ DEFIO_TAG_E(PA9), GPIO_AF3_LPUART },
{ DEFIO_TAG_E(PB6), GPIO_AF8_LPUART }
},
.rcc = RCC_APB4(LPUART1),
.rxIrq = LPUART1_IRQn,
.txPriority = NVIC_PRIO_SERIALUART8_TXDMA, // Not used until DMA is supported
.rxPriority = NVIC_PRIO_SERIALUART8, // Not used until DMA is supported
.txBuffer = uart9TxBuffer,
.rxBuffer = uart9RxBuffer,
.txBufferSize = sizeof(uart9TxBuffer),
.rxBufferSize = sizeof(uart9RxBuffer),
},
#endif
};
// XXX Should serialUART be consolidated?

View file

@ -52,8 +52,8 @@
#define UART2_TX_PIN PD5
#define USE_UART3
#define UART3_RX_PIN PD9
#define UART3_TX_PIN PD8
#define UART3_RX_PIN PD9 // ST-LINK Virtual COM Port
#define UART3_TX_PIN PD8 // ST-LINK Virtual COM Port
#define USE_UART4
#define UART4_RX_PIN PC11
@ -75,12 +75,16 @@
#define UART8_RX_PIN PE0
#define UART8_TX_PIN PE1
#define USE_UART9 // LPUART1
#define UART9_RX_PIN PB7 // PA10 (Shared with UART1)
#define UART9_TX_PIN PB6 // PA9 (Shared with UART1)
#define USE_VCP
#define USE_SOFTSERIAL1
#define USE_SOFTSERIAL2
#define SERIAL_PORT_COUNT 11
#define SERIAL_PORT_COUNT 12
#define USE_SPI