stm32f4xx-hal
stm32f4xx-hal copied to clipboard
How to read and write 9-bit words to UART port
I need to use the WordLength::DataBits9 config option to achieve 9 data bits in UART communication.
Once the serial port is configured, how am I supposed to send (or receive) 9 bits of data? I noticed that the Read and Write traits are only implemented for u8, while I'd expect to use u16 to send 9 bits.
Am I missing something, or am I expected to interact directly with the registers?
You're correct that the serial driver does not currently support 9-bit words. I've created a pull request to add support: https://github.com/stm32-rs/stm32f4xx-hal/pull/299