embassy/embassy-time-driver
2024-01-11 23:54:15 +01:00
..
src time: docs improvements, add ci. 2024-01-11 17:17:58 +01:00
build.rs time: split driver into a separate embassy-time-driver crate. 2024-01-11 16:56:08 +01:00
Cargo.toml time-driver: remove unused deps. 2024-01-11 23:54:15 +01:00
gen_tick.py time: split driver into a separate embassy-time-driver crate. 2024-01-11 16:56:08 +01:00
README.md time: docs improvements, add ci. 2024-01-11 17:17:58 +01:00

embassy-time-driver

This crate contains the driver trait necessary for adding embassy-time support for a new hardware platform.

If you want to use embassy-time with already made drivers, you should depend on the main embassy-time crate, not on this crate.

If you are writing a driver, you should depend only on this crate, not on the main embassy-time crate. This will allow your driver to continue working for newer embassy-time major versions, without needing an update, if the driver trait has not had breaking changes.

How it works

embassy-time is backed by a global "time driver" specified at build time. Only one driver can be active in a program.

All methods and structs transparently call into the active driver. This makes it possible for libraries to use embassy-time in a driver-agnostic way without requiring generic parameters.