nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
503 stars 139 forks source link

UARTE: stopbits setting not exposed #354

Open jnordholz opened 3 years ago

jnordholz commented 3 years ago

Hi,

I'm working on a NRF52840-based design and need the UART configured as 8N2, but the UARTE driver doesn't expose CONFIG.STOP yet. I've created a simple PR (#353) that adds another parameter to the Uarte::new() constructor (next to the already existing "parity" parameter), but of course that's an incompatible API change.

Thanks for considering!

jnordholz commented 3 years ago

Ah, that's a 52840-specific feature (PR closed, sorry for the noise) - so then a cfg-guarded setter would be easier to integrate, however tweaking these settings usually requires disabling the peripheral, which is why these things are usually handled in the setup phase... I'll happily update my PR if you have an opinion where this should go.