Serial Driver Cannot Handle 9-bits?

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Serial Driver Cannot Handle 9-bits?

Post by avrhack »

I have an application which needs 9 data bits on the USART. From what I can see, the ChibiOS serial driver cannot be used for this as it explicitly uses 8 bit queues?

Could someone confirm I have to use the USART driver if I want to send/receive all 9 bits? if so that's a real pain and would be good if it's considered for a change in the future.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Serial Driver Cannot Handle 9-bits?

Post by Giovanni »

Hi,

The driver assumes queues of bytes, it is not possible to change it. You should look into the UART driver instead, that one could be enhanced.

Giovanni
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: Serial Driver Cannot Handle 9-bits?

Post by avrhack »

Yeah I've changed the code over to the UART driver - it was much easier than I thought, thanks to the good examples in the testhal folders. Thanks Giovanni!
Post Reply