stm32f4xx-hal icon indicating copy to clipboard operation
stm32f4xx-hal copied to clipboard

How to read and write 9-bit words to UART port

Open Maldus512 opened this issue 4 years ago • 1 comments

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?

Maldus512 avatar Mar 24 '21 10:03 Maldus512

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

samcrow avatar Apr 15 '21 22:04 samcrow