ChibiOS/HAL  7.1.5
ST Driver

Generic System Tick Driver. More...

Collaboration diagram for ST Driver:

Detailed Description

Generic System Tick Driver.

This module implements a system tick timer in order to support the underlying operating system.

Functions

void stInit (void)
 ST Driver initialization. More...
 
void stStartAlarm (systime_t abstime)
 Starts the alarm zero. More...
 
void stStopAlarm (void)
 Stops the alarm zero interrupt. More...
 
void stSetAlarm (systime_t abstime)
 Sets the alarm zero time. More...
 
systime_t stGetAlarm (void)
 Returns the alarm zero current time. More...
 
systime_t stGetCounter (void)
 Returns the time counter value. More...
 
bool stIsAlarmActive (void)
 Determines if the alarm zero is active. More...
 
bool stIsAlarmActiveN (unsigned alarm)
 Determines if the specified alarm is active. More...
 
void stStartAlarmN (unsigned alarm, systime_t abstime, st_callback_t cb)
 Starts an additional alarm. More...
 
void stStopAlarmN (unsigned alarm)
 Stops an additional alarm. More...
 
void stSetAlarmN (unsigned alarm, systime_t abstime)
 Sets an additional alarm time. More...
 
systime_t stGetAlarmN (unsigned alarm)
 Returns an additional alarm current time. More...
 
void st_lld_init (void)
 Low level ST driver initialization. More...
 
static systime_t st_lld_get_counter (void)
 Returns the time counter value. More...
 
static void st_lld_start_alarm (systime_t abstime)
 Starts the alarm. More...
 
static void st_lld_stop_alarm (void)
 Stops the alarm interrupt. More...
 
static void st_lld_set_alarm (systime_t abstime)
 Sets the alarm time. More...
 
static systime_t st_lld_get_alarm (void)
 Returns the current alarm time. More...
 
static bool st_lld_is_alarm_active (void)
 Determines if the alarm is active. More...
 

Function Documentation

◆ stInit()

void stInit ( void  )

ST Driver initialization.

Note
This function is implicitly invoked by halInit(), there is no need to explicitly initialize the driver.
Function Class:
Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 64 of file hal_st.c.

Referenced by halInit().

◆ stStartAlarm()

void stStartAlarm ( systime_t  abstime)

Starts the alarm zero.

Note
Makes sure that no spurious alarms are triggered after this call.
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]abstimethe time to be set for the first alarm
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 87 of file hal_st.c.

References osalDbgAssert, st_lld_start_alarm(), and stIsAlarmActive().

Here is the call graph for this function:

◆ stStopAlarm()

void stStopAlarm ( void  )

Stops the alarm zero interrupt.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 101 of file hal_st.c.

References st_lld_stop_alarm().

Here is the call graph for this function:

◆ stSetAlarm()

void stSetAlarm ( systime_t  abstime)

Sets the alarm zero time.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]abstimethe time to be set for the next alarm
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 115 of file hal_st.c.

References osalDbgAssert, st_lld_set_alarm(), and stIsAlarmActive().

Here is the call graph for this function:

◆ stGetAlarm()

systime_t stGetAlarm ( void  )

Returns the alarm zero current time.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Returns
The currently set alarm time.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 131 of file hal_st.c.

References osalDbgAssert, st_lld_get_alarm(), and stIsAlarmActive().

Here is the call graph for this function:

◆ stGetCounter()

systime_t stGetCounter ( void  )

Returns the time counter value.

Note
This functionality is only available in free running mode, the behaviour in periodic mode is undefined.
Returns
The counter value.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 147 of file hal_st.c.

References st_lld_get_counter().

Here is the call graph for this function:

◆ stIsAlarmActive()

bool stIsAlarmActive ( void  )

Determines if the alarm zero is active.

Returns
The alarm status.
Return values
falseif the alarm is not active.
trueis the alarm is active
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 161 of file hal_st.c.

References st_lld_is_alarm_active().

Referenced by stGetAlarm(), stSetAlarm(), and stStartAlarm().

Here is the call graph for this function:

◆ stIsAlarmActiveN()

bool stIsAlarmActiveN ( unsigned  alarm)

Determines if the specified alarm is active.

Parameters
[in]alarmalarm channel number (1..ST_LLD_NUM_ALARMS)
Returns
The alarm status.
Return values
falseif the alarm is not active.
trueis the alarm is active
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 177 of file hal_st.c.

◆ stStartAlarmN()

void stStartAlarmN ( unsigned  alarm,
systime_t  abstime,
st_callback_t  cb 
)

Starts an additional alarm.

Note
Makes sure that no spurious alarms are triggered after this call.
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]abstimethe time to be set for the first alarm
[in]alarmalarm channel number (1..ST_LLD_NUM_ALARMS)
[in]cbalarm callback
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 195 of file hal_st.c.

◆ stStopAlarmN()

void stStopAlarmN ( unsigned  alarm)

Stops an additional alarm.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]alarmalarm channel number (1..ST_LLD_NUM_ALARMS)
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 213 of file hal_st.c.

References osalDbgCheck.

◆ stSetAlarmN()

void stSetAlarmN ( unsigned  alarm,
systime_t  abstime 
)

Sets an additional alarm time.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]alarmalarm channel number (1..ST_LLD_NUM_ALARMS)
[in]abstimethe time to be set for the next alarm
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 231 of file hal_st.c.

References osalDbgCheck.

◆ stGetAlarmN()

systime_t stGetAlarmN ( unsigned  alarm)

Returns an additional alarm current time.

Note
This functionality is only available in free running mode, the behavior in periodic mode is undefined.
Parameters
[in]alarmalarm channel number (1..ST_LLD_NUM_ALARMS)
Returns
The currently set alarm time.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 249 of file hal_st.c.

References osalDbgCheck.

◆ st_lld_init()

void st_lld_init ( void  )

Low level ST driver initialization.

Function Class:
Not an API, this function is for internal use only.

Definition at line 62 of file hal_st_lld.c.

◆ st_lld_get_counter()

static systime_t st_lld_get_counter ( void  )
inlinestatic

Returns the time counter value.

Returns
The counter value.
Function Class:
Not an API, this function is for internal use only.

Definition at line 73 of file hal_st_lld.h.

Referenced by stGetCounter().

◆ st_lld_start_alarm()

static void st_lld_start_alarm ( systime_t  abstime)
inlinestatic

Starts the alarm.

Note
Makes sure that no spurious alarms are triggered after this call.
Parameters
[in]abstimethe time to be set for the first alarm
Function Class:
Not an API, this function is for internal use only.

Definition at line 87 of file hal_st_lld.h.

Referenced by stStartAlarm().

◆ st_lld_stop_alarm()

static void st_lld_stop_alarm ( void  )
inlinestatic

Stops the alarm interrupt.

Function Class:
Not an API, this function is for internal use only.

Definition at line 97 of file hal_st_lld.h.

Referenced by stStopAlarm().

◆ st_lld_set_alarm()

static void st_lld_set_alarm ( systime_t  abstime)
inlinestatic

Sets the alarm time.

Parameters
[in]abstimethe time to be set for the next alarm
Function Class:
Not an API, this function is for internal use only.

Definition at line 108 of file hal_st_lld.h.

Referenced by stSetAlarm().

◆ st_lld_get_alarm()

static systime_t st_lld_get_alarm ( void  )
inlinestatic

Returns the current alarm time.

Returns
The currently set alarm time.
Function Class:
Not an API, this function is for internal use only.

Definition at line 120 of file hal_st_lld.h.

Referenced by stGetAlarm().

◆ st_lld_is_alarm_active()

static bool st_lld_is_alarm_active ( void  )
inlinestatic

Determines if the alarm is active.

Returns
The alarm status.
Return values
falseif the alarm is not active.
trueis the alarm is active
Function Class:
Not an API, this function is for internal use only.

Definition at line 134 of file hal_st_lld.h.

Referenced by stIsAlarmActive().