Event System Driver

The Event system driver allows to configure the event system of an MCU.

Event System Basics and Best Practice

The Event system allows autonomous, low-latency, and configurable communication between peripherals.

Communication is made without CPU intervention and without consuming system resources such as bus or RAM bandwidth. This reduces the load on the CPU and system resources, compared to a traditional interrupt-based system.

The Event system consists of several channels, which route the internal events from generators to users. Each event generator can be selected as source for multiple channels, but a channel cannot be set to use multiple event generators at the same time.

Several peripherals can be configured to generate and/or respond to signals known as events. The exact condition to generate an event, or the action taken upon receiving an event, is specific to each peripheral. Peripherals that respond to events are event users, peripherals that generate events are called event generators. A peripheral can have one or more event generators and can have one or more event users.

Event Channels

The Event module in each device consists of several channels, which can be freely linked to an event generator (i.e. a peripheral within the device that is capable of generating events). Each channel can be individually configured to select the generator peripheral, signal path, and edge detection applied to the input event signal, before being passed to any event user(s).

Event channels can support multiple users within the device in a standardized manner. When an Event User is linked to an Event Channel, the channel will automatically handshake with all attached users to ensure that all modules correctly receive and acknowledge the event.

Event Users

Event Users are able to subscribe to an Event Channel, once it has been configured. Each Event User consists of a fixed connection to one of the peripherals within the device (for example, an ADC module, or Timer module) and is capable of being connected to a single Event Channel.

Summary of the API's Functional Features

The API provides functions to:
  • Initialize and deinitialize the driver and associated hardware

  • Enable and disable the generator and user for a given channel

Summary of Configuration Options

Below is a list of the main Event parameters that can be configured in START. All of these are used by the event_system_init function when initializing the driver and underlying hardware.
  • Select clock source for each Event channel

  • Select Event parameters for each channel
    • Edge detection

    • Path selection

    • Event generator

    • Interrupt setting for Event, etc.

  • Event channel selection for peripheral users

Driver Implementation Description

All Event configuration is static and configured in START. Event API functions can be used to enable or disable a specific generator or user for a given channel.

Example of Usage

Refer example in DAC Asynchronous Driver of using the RTC period 0 event to trigger DAC convention.

Dependencies

  • Event peripheral and its related clocks

  • Related peripheral generator and user, such as RTC, ADC, DAC, etc.