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

Add API to control main clock

Open hannobraun opened this issue 7 years ago • 1 comments

It's currently not possible to control the main clock, and an API to do that should be added. Once that API exists, it can be used to create more convenient constructors for BaudRate.

U_PCLK, which controls UART baud rates, is derived from the main clock. The values required to create a specific baud rate (like 115200 baud) are therefore dependent on the frequency of the main clock. Since that information is not available right now, convenient constructors that create BaudRates for specific values don't exist, and the user is forced to set the values manually.

hannobraun avatar Dec 13 '17 05:12 hannobraun

I have more thoughts about baud rates: A device driver that communicates with its device via UART might need a specific baud rate to do so. It would be convenient, if the driver could express that requirement on the type-level somehow. Maybe as a type parameter on BaudRate (if the driver initializes a USART instance itself), or as a type parameter on USART.

hannobraun avatar Feb 16 '18 06:02 hannobraun