Zephyr API 3.6.99
Loading...
Searching...
No Matches
counter_alarm_cfg Struct Reference

Alarm callback structure. More...

#include <counter.h>

Data Fields

counter_alarm_callback_t callback
 Callback called on alarm (cannot be NULL).
 
uint32_t ticks
 Number of ticks that triggers the alarm.
 
void * user_data
 User data returned in callback.
 
uint32_t flags
 Alarm flags (see COUNTER_ALARM_FLAGS).
 

Detailed Description

Alarm callback structure.

Field Documentation

◆ callback

counter_alarm_callback_t counter_alarm_cfg::callback

Callback called on alarm (cannot be NULL).

◆ flags

uint32_t counter_alarm_cfg::flags

Alarm flags (see COUNTER_ALARM_FLAGS).

◆ ticks

uint32_t counter_alarm_cfg::ticks

Number of ticks that triggers the alarm.

It can be relative (to now) or an absolute value (see COUNTER_ALARM_CFG_ABSOLUTE). Both, relative and absolute, alarm values can be any value between zero and the current top value (see counter_get_top_value). When setting an absolute alarm value close to the current counter value there is a risk that the counter will have counted past the given absolute value before the driver manages to activate the alarm. Therefore a guard period can be defined that lets the driver decide unambiguously whether it is late or not (see counter_set_guard_period). If the counter is clock driven then ticks can be converted to microseconds (see counter_ticks_to_us). Alternatively, the counter implementation may count asynchronous events.

◆ user_data

void* counter_alarm_cfg::user_data

User data returned in callback.


The documentation for this struct was generated from the following file: