Clock API

Open
#24 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
embedded-iot

Research direction

Start with the linked rust-lpc82x-hal clock API documentation and rust-lpc82x-hal issue 4, then compare the proposed Frequency, Enabled, and Ticks concepts with the listed clock and sleep use cases. The issue asks for design feedback rather than naming files or tests, so completion would require an agreed embedded-hal clock API and a defined implementation plan.

Written by the indexing model from the issue text.

Description

proposal

Clocks are an important part of all microcontrollers that I know of, and I believe this is a topic that should be covered in embedded-hal. I don't have a good enough overview over the topic to know everything that's required, but I have encountered some use cases that gave me a few ideas.

I've implemented a rough proposal as part of LPC82x HAL. This is not quite ready for inclusion into embedded-hal, but I've decided to open this issue to garner some feedback, and give others the opportunity to mention other use cases that I haven't covered.

Here's the API that I'd like to submit (eventually):

Use cases for the API:

  • Implementations of the traits: LowPowerClock, IrcDerivedClock
  • Sleep code that depends on various bits: Sleep
  • I also have an unrelease time library that depends on this infrastructure. I haven't had time to polish and release it yet, but I'll happily send the code to anyone who wants to take a look.

As I said, this is still a bit rough. https://github.com/braun-robotics/rust-lpc82x-hal/issues/4 has some
ideas for improvement. I'd love to hear what everyone thinks!

Dominant language
Rust
Stars
2.7k
Forks
282
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-embedded/embedded-hal

All issues in rust-embedded/embedded-hal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.