AutosarOS
Alarm.h File Reference

Alarm management. More...

#include "Types.h"
Include dependency graph for Alarm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

StatusType Alarm_GetAlarmBase (AlarmType alarmID, AlarmBaseRefType info)
 Get alarm base. More...
 
StatusType Alarm_GetAlarm (AlarmType alarmID, TickRefType tick)
 Get alarm. More...
 
StatusType Alarm_SetRelAlarm (AlarmType alarmID, TickType increment, TickType cycle)
 Set relative alarm. More...
 
StatusType Alarm_SetAbsAlarm (AlarmType alarmID, TickType start, TickType cycle)
 Set absolute alarm. More...
 
StatusType Alarm_CancelAlarm (AlarmType alarmID)
 Cancel alarm. More...
 
void Alarm_evaluateAlarm (CounterType counter)
 Evaluate alarms with user generated counter. More...
 
void Alarm_evaluateSysTickAlarm (void)
 Evaluate alarm with SYSTEM_COUNTER. More...
 
void Alarm_startup (void)
 Startup function for alarm management. More...
 

Detailed Description

Alarm management.

Date
2020-06-15
Author
Pascal Romahn

Definition in file Alarm.h.

Function Documentation

◆ Alarm_CancelAlarm()

StatusType Alarm_CancelAlarm ( AlarmType  alarmID)

Cancel alarm.

Parameters
alarmIDAlarm to cancel
Returns
E_OK No error
E_OS_ID alarmID is invalid
E_OS_NOFUNC Alarm is not used

Definition at line 184 of file Alarm.c.

◆ Alarm_evaluateAlarm()

void Alarm_evaluateAlarm ( CounterType  counter)

Evaluate alarms with user generated counter.

This will evaluate all alarms with a user generated counter and handle expiration if necessary.

counter may not equal SYSTEM_COUNTER. Alarm_evaluateSysTickAlarm() must be used instead.

Parameters
counterID of the counter that triggered the alarm evaluation

Definition at line 211 of file Alarm.c.

Here is the caller graph for this function:

◆ Alarm_evaluateSysTickAlarm()

void Alarm_evaluateSysTickAlarm ( void  )

Evaluate alarm with SYSTEM_COUNTER.

This will evaluate all alarms with the SYSTEM_COUNTER as their base and handle expiration if necessary.

Definition at line 235 of file Alarm.c.

◆ Alarm_GetAlarm()

StatusType Alarm_GetAlarm ( AlarmType  alarmID,
TickRefType  tick 
)

Get alarm.

Get relative value in ticks before alarm expires.

Note
The value of tick is not defined if the alarm is not in use.
Parameters
alarmIDAlarm which remaining ticks should be read
tickPointer to write remaining ticks into
Returns
E_OK No error
E_OS_ID alarmID is invalid
E_OS_NOFUNC Alarm is not used
E_OS_PARAM_POINT Pointer parameter is invalid

Definition at line 60 of file Alarm.c.

◆ Alarm_GetAlarmBase()

StatusType Alarm_GetAlarmBase ( AlarmType  alarmID,
AlarmBaseRefType  info 
)

Get alarm base.

This service will get a copy of the counter configuration used as the alarm base.

Parameters
alarmIDAlarm which base should be read
infoPointer to copy base info into
Returns
E_OK No error
E_OS_ID alarmID is invalid
E_OS_PARAM_POINTER Pointer parameter is invalid

Definition at line 37 of file Alarm.c.

Here is the caller graph for this function:

◆ Alarm_SetAbsAlarm()

StatusType Alarm_SetAbsAlarm ( AlarmType  alarmID,
TickType  start,
TickType  cycle 
)

Set absolute alarm.

Set an absolute alarm. The alarm will expire once the base counter reaches the start value. If cycle does not equal zero the alarm will be restarted to expire in cycle ticks after it expires.

Parameters
alarmIDAlarm to set
startAbsolute value in ticks (must be between zero and maxallowedvalue of the base)
cycleCycle value for cyclic alarm (must be between mincycle and maxallowedvalue of the base)
Returns
E_OK No error
E_OS_ID alarmID is invalid
E_OS_STATE Alarm is already in use
E_OS_VALUE Values of increment or cycle are outside of the admissible range

Definition at line 139 of file Alarm.c.

Here is the caller graph for this function:

◆ Alarm_SetRelAlarm()

StatusType Alarm_SetRelAlarm ( AlarmType  alarmID,
TickType  increment,
TickType  cycle 
)

Set relative alarm.

Set a relative alarm. The alarm will expire in increment ticks. If cycle does not equal zero the alarm will be restarted to expire in cycle ticks after it expires.

Parameters
alarmIDAlarm to set
incrementRelative value in ticks (must be between one and maxallowedvalue of the base)
cycleCycle value for cyclic alarm (must be between mincycle and maxallowedvalue of the base)
Returns
E_OK No error
E_OS_ID alarmID is invalid
E_OS_STATE Alarm is already in use
E_OS_VALUE Values of increment or cycle are outside of the admissible range

Definition at line 103 of file Alarm.c.

Here is the call graph for this function:

◆ Alarm_startup()

void Alarm_startup ( void  )

Startup function for alarm management.

Definition at line 259 of file Alarm.c.