Expand description
§Embassy-rs support for the Vorago VA108xx MCU family
This repository contains the embassy-rs support for the VA108xx family. Currently, it contains the time driver to allow using embassy-rs. It uses the TIM peripherals provided by the VA108xx family for this purpose.
§Usage
This library exposes the init or the init_with_custom_irqs functions which set 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_with_custom_irqs and init method.
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-oc30-oc31 feature flag. This library exposes three combinations:
irq-oc30-oc31: Uses pac::Interrupt::OC30 and pac::Interrupt::OC31irq-oc29-oc30: Uses pac::Interrupt::OC29 and pac::Interrupt::OC30irq-oc28-oc29: Uses pac::Interrupt::OC28 and pac::Interrupt::OC20
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, init_with_custom_irqs must be used method to pass the IRQ numbers to the library.
§Examples
Macros§
- embassy_
time_ driver_ irqs - Macro to define the IRQ handlers for the time driver.
Functions§
- init
irqs-in-lib - Initialization method for embassy.
- init_
with_ custom_ irqs - Initialization method for embassy when using custom IRQ handlers.