1 unstable release
new 0.1.0 | Feb 18, 2025 |
---|
#2052 in Embedded development
310KB
7K
SLoC
Embassy-rs support for the Vorago VA416xx MCU family
This repository contains the embassy-rs support for the VA416xx family. Currently, it contains the time driver to allow using embassy-rs. It uses the TIM peripherals provided by the VA416xx family for this purpose.
The documentation contains more information on how to use this crate.
lib.rs
:
Embassy-rs support for the Vorago VA416xx MCU family
This repository contains the embassy-rs support for the VA416xx family. Currently, it contains the time driver to allow using embassy-rs. It uses the TIM peripherals provided by the VA416xx family for this purpose.
Usage
This library only exposes the embassy::init method which sets up the time driver. This function must be called once at the start of the application.
This implementation requires two TIM peripherals provided by the VA108xx device. The user can freely specify the two used TIM peripheral by passing the concrete TIM instances into the [init] method. If the interrupt handlers are provided by the library, the ID of the used TIM peripherals has to match the ID of the passed timer peripherals. Currently, this can only be checked at run-time, and a run-time assertion will panic on the embassy initialization in case of a missmatch.
The application also requires two interrupt handlers to handle the timekeeper and alarm
interrupts. By default, this library will define the interrupt handler inside the library
itself by using the irq-tim14-tim15
feature flag. This library exposes three combinations:
irq-tim14-tim15
: Uses pac::Interrupt::TIM14 for alarm and pac::Interrupt::TIM15 for timekeeperirq-tim13-tim14
: Uses pac::Interrupt::TIM13 for alarm and pac::Interrupt::TIM14 for timekeeperirq-tim22-tim23
: Uses pac::Interrupt::TIM22 for alarm and pac::Interrupt::TIM23 for timekeeper
You can disable the default features and then specify one of the features above to use the documented combination of IRQs. It is also possible to specify custom IRQs by importing and using the [embassy_time_driver_irqs] macro to declare the IRQ handlers in the application code. If this is done, embassy::init_with_custom_irqs must be used method to pass the IRQ numbers to the library.
Examples
Dependencies
~7MB
~139K SLoC