Module etm

Source
Available on crate feature unstable only.
Expand description

§Event Task Matrix Function

§Overview

The system timer supports the Event Task Matrix (ETM) function, which allows the system timer’s ETM events to trigger any peripherals’ ETM tasks.

The system timer can generate the following ETM events:

  • SYSTIMER_EVT_CNT_CMPx: Indicates the alarm pulses generated by COMPx

§Example

let syst = SystemTimer::new(peripherals.SYSTIMER);
let etm = Etm::new(peripherals.SOC_ETM);
let gpio_ext = Channels::new(peripherals.GPIO_SD);
let alarm0 = syst.alarm0;
let mut led = peripherals.GPIO1;

let timer_event = Event::new(&alarm0);
let led_task = gpio_ext.channel0_task.toggle(
    led,
    OutputConfig {
        open_drain: false,
        pull: Pull::None,
        initial_state: Level::High,
    },
);

let _configured_etm_channel = etm.channel0.setup(&timer_event,
&led_task);

let timer = PeriodicTimer::new(alarm0);
// configure the timer as usual
// when it fires it will toggle the GPIO

Structs§

Event
An ETM controlled SYSTIMER event