Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add parity to UartStmDma #56

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hal_st/stm32fxxx/UartStmDma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ namespace hal

uartHandle.Instance = peripheralUart[uartIndex];
uartHandle.Init.BaudRate = config.baudrate;
uartHandle.Init.WordLength = USART_WORDLENGTH_8B;
uartHandle.Init.WordLength = config.parity == USART_PARITY_NONE ? USART_WORDLENGTH_8B : USART_WORDLENGTH_9B;
uartHandle.Init.StopBits = USART_STOPBITS_1;
uartHandle.Init.Parity = USART_PARITY_NONE;
uartHandle.Init.Parity = config.parity;
uartHandle.Init.Mode = USART_MODE_TX_RX;
uartHandle.Init.HwFlowCtl = config.hwFlowControl;
#if defined(STM32F0) || defined(STM32F3) || defined(STM32F7)
Expand Down Expand Up @@ -73,9 +73,9 @@ namespace hal

uartHandle.Instance = peripheralUart[uartIndex];
uartHandle.Init.BaudRate = config.baudrate;
uartHandle.Init.WordLength = USART_WORDLENGTH_8B;
uartHandle.Init.WordLength = config.parity == USART_PARITY_NONE ? USART_WORDLENGTH_8B : USART_WORDLENGTH_9B;
uartHandle.Init.StopBits = USART_STOPBITS_1;
uartHandle.Init.Parity = USART_PARITY_NONE;
uartHandle.Init.Parity = config.parity;
uartHandle.Init.Mode = USART_MODE_TX_RX;
uartHandle.Init.HwFlowCtl = config.hwFlowControl;
#if defined(STM32F0) || defined(STM32F3) || defined(STM32F7)
Expand Down
1 change: 1 addition & 0 deletions hal_st/stm32fxxx/UartStmDma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace hal

uint32_t baudrate = 115200;
uint32_t hwFlowControl = UART_HWCONTROL_NONE;
uint32_t parity = USART_PARITY_NONE;
infra::Optional<DmaChannelId> dmaChannelTx;
infra::Optional<InterruptPriority> priority;
};
Expand Down