Module etm

Source
Available on crate feature unstable only.
Expand description

§Event Task Matrix (ETM)

§Overview

GPIO supports ETM function, that is, the ETM task of GPIO can be triggered by the ETM event of any peripheral, or the ETM task of any peripheral can be triggered by the ETM event of GPIO.

§Configuration

The GPIO ETM provides several task channels. The ETM tasks that each task channel can receive are:

  • SET: GPIO goes high when triggered
  • CLEAR: GPIO goes low when triggered
  • TOGGLE: GPIO toggle level when triggered.

GPIO has several event channels, and the ETM events that each event channel can generate are:

  • RISE_EDGE: Indicates that the output signal of the corresponding GPIO has a rising edge
  • FALL_EDGE: Indicates that the output signal of the corresponding GPIO has a falling edge
  • ANY_EDGE: Indicates that the output signal of the corresponding GPIO is reversed

§Examples

§Toggle an LED When a Button is Pressed


let gpio_ext = Channels::new(peripherals.GPIO_SD);
let led_task = gpio_ext.channel0_task.toggle(
    led,
    OutputConfig {
        open_drain: false,
        pull: Pull::None,
        initial_state: Level::Low,
    },
);
let button_event = gpio_ext
    .channel0_event
    .falling_edge(button, InputConfig { pull: Pull::Down });

Structs§

Channels
All the GPIO ETM channels
Event
Event for rising edge
EventChannel
An ETM controlled GPIO event
InputConfig
Configuration for an ETM controlled GPIO input pin
OutputConfig
Configuration for an ETM controlled GPIO output pin
Task
Task for set operation
TaskChannel
An ETM controlled GPIO task