Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to control main clock #27

Open
hannobraun opened this issue Dec 13, 2017 · 1 comment
Open

Add API to control main clock #27

hannobraun opened this issue Dec 13, 2017 · 1 comment

Comments

@hannobraun
Copy link
Member

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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant