System Event Trigger

Description

Use system events to trigger Event Handler Code

This resource allows system event signals from the AON domain to trigger an Event Handler Code task code block.

This allows the Sensor Controller to wake up when:

  • The system power state changes
  • AON_BATMON has finished a battery voltage or temperature measurement

The trigger can be set up from within the Initialization Code , Execution Code or Event Handler Code task code blocks.

The trigger is one-shot.

Event Trigger Mapping

The CC13x2/CC26x2 and CC13x4/CC26x4 chip families support up to 3 event triggers in total per project. The Code Generator Panel displays an error message if this number is exceeded.

Access the Task Panel to map event trigger(s) to Event Handler Code task code blocks:

  • Ensure that one or more event trigger resources are enabled
  • Below these resources, select the number of simultaneous event triggers for the task
  • Map the event index(es) to Event Handler Code task code blocks. The event indexes start at 0 for each task.

While the number of event triggers and mapping of event indexes to task code blocks are static, the event indexes can be reused for different types of event triggers. For example, it is possible to alternate between a timer trigger and a GPIO trigger for one event index.

If a new event trigger is set up using an already active event index, the previously set up event trigger is cancelled.

The Termination Code must call evhCancelTrigger() for each used event index, so that the last set up event triggers do not occur after the task has been stopped.

Trigger Timing

Typical startup delays, from the system event trigger to execution of the Event Handler Code task code block, are shown in the tables below.

For startup to low-power mode:

Scenario No clock in standby mode SCLK_LF in standby mode*
From standby mode, SCLK_MF clock not running 32 us 47 - 77 us
From standby mode, SCLK_MF clock already running 30 us 45 - 75 us
Trigger occurs while Sensor Controller runs other code 24 us or more (already running code must finish)

For startup to active mode:

Scenario No clock in standby mode SCLK_LF in standby mode*
From standby mode, SCLK_HF clock not running 145 - 200 us 145 - 215 us
From standby mode, SCLK_HF clock already running 7 us 24 - 54 us
Trigger occurs while Sensor Controller runs other code 4 us or more (already running code must finish)

* SCLK_LF is used in standby mode when one or more of these resources are enabled:

  • Reference DAC
  • RTC Multi-Event Capture
  • Timer 0 Event Trigger
  • Timer 1 Event Trigger

Examples

AON_BATMON voltage update (Initialization Code)

// Run the Event Handler Code when the AON_BATMON voltage value is updated
evhSetupSystemTrigger(0, EVH_SYSTEM_EV_AON_BATMON_BAT_UPD);

AON_BATMON voltage update (Event Handler Code)

... Do something here ...

// Rerun the Event Handler Code when the AON_BATMON voltage value is updated again
evhSetupSystemTrigger(0, EVH_SYSTEM_EV_AON_BATMON_BAT_UPD);

AON_BATMON voltage update (Termination Code)

// The currently enabled event trigger must be cancelled manually
evhCancelTrigger(0);

Procedures Overview

Name Brief description
evhCancelTrigger() Cancels a previous call to an event trigger setup procedure (for example evhSetupGpioTrigger() ) with matching event index, including any pending Event Handler Code execution if the trigger already has occurred. More …
evhGetActiveTrigger() This procedure can be called from event handler code to determine which event index triggered the event handler code. More …
evhSetupSystemTrigger() Sets up a system event signal from the AON domain to trigger execution of the Event Handler Code . More …

Constants

Name Description
EVH_SYSTEM_EV_AON_BATMON_BAT_UPD System trigger: Generated when an AON_BATMON battery voltage measurement has finished
EVH_SYSTEM_EV_AON_BATMON_TEMP_UPD System trigger: Generated when an AON_BATMON temperature measurement has finished
EVH_SYSTEM_EV_PWR_SUPPLY_STANDBY System trigger: Generated when the power supply system enters standby mode
EVH_SYSTEM_EV_PWR_SUPPLY_WAKEUP System trigger: Generated when the power supply system enters active mode
EVH_SYSTEM_EV_SYS_STANDBY System trigger: Generated when all parts of the system (MCU domain, AUX domain and/or JTAG) have left active mode
EVH_SYSTEM_EV_SYS_WAKEUP System trigger: Generated when any part of the system (MCU domain, AUX domain and/or JTAG) enters active mode
EVH_SYSTEM_EV_VDDR_RECHARGE_END System trigger: Generated when VDDR recharging ends
EVH_SYSTEM_EV_VDDR_RECHARGE_START System trigger: Generated when VDDR recharging starts

Global Variables

None.

Procedures

evhCancelTrigger

Prototype: evhCancelTrigger(#evIndex)

Cancels a previous call to an event trigger setup procedure (for example evhSetupGpioTrigger() ) with matching event index, including any pending Event Handler Code execution if the trigger already has occurred.

This procedure should be called from the Termination Code if the task can be stopped by the application while an event trigger is enabled.

Parameter value(s)

  • #evIndex : Event index to be cancelled

evhGetActiveTrigger

Prototype: evhGetActiveTrigger(bvEvent)

This procedure can be called from event handler code to determine which event index triggered the event handler code.

Return value(s)

  • bvEvent : Bit-vector indicating the event index that triggered the event handler code

evhSetupSystemTrigger

Prototype: evhSetupSystemTrigger(#evIndex, aonEvSignal)

Sets up a system event signal from the AON domain to trigger execution of the Event Handler Code . The trigger is one-shot.

Parameter value(s)

  • #evIndex : Event index to be triggered
  • aonEvSignal : AON domain event signal to be used as trigger (EVH_SYSTEM_EV_XYZ).