NNP STM Generic Remote Module git-main
Loading...
Searching...
No Matches
timer.h File Reference
#include "timerscfg.h"
#include "applicfg.h"
#include <can_stm.h>

Go to the source code of this file.

Classes

struct  struct_s_timer_entry
 timer struct More...
 

Macros

#define TIMER_HANDLE   INTEGER16
 
#define TASK_HANDLE   INTEGER16
 
#define TIMER_FREE   0
 
#define TIMER_ARMED   1
 
#define TIMER_TRIG   2
 
#define TIMER_TRIG_PERIOD   3
 
#define TIMER_NONE   -1
 

Typedefs

typedef void(* TimerCallback_t) (CO_Data *d, UNS32 id)
 
typedef struct struct_s_timer_entry s_timer_entry
 

Functions

TIMER_HANDLE SetAlarm (CO_Data *d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period)
 Set an alarm to execute a callback function when expired.
 
TIMER_HANDLE DelAlarm (TIMER_HANDLE handle)
 Delete an alarm before expiring.
 
void TimeDispatch (void)
 TimeDispatch is called on each timer expiration -—.
 
void setTimer (TIMEVAL value)
 Set the timer peripheral for the next interrupt.
 
TIMEVAL getElapsedTime (void)
 Return the elapsed time to tell the Stack how much time is spent since last call.
 
UNS8 isTimedOut (UNS32 *tRef, UNS32 tAlarm)
 Checks if a timer has timed out.
 
void resetTimeOut (UNS32 *tRef)
 Resets a timed out timer.
 

Variables

unsigned char osc_value
 

Detailed Description

Created on: Oct 9, 2024 Author: jenej

Definition in file timer.h.

Macro Definition Documentation

◆ TASK_HANDLE

#define TASK_HANDLE   INTEGER16

Definition at line 16 of file timer.h.

◆ TIMER_ARMED

#define TIMER_ARMED   1

Definition at line 22 of file timer.h.

◆ TIMER_FREE

#define TIMER_FREE   0

Definition at line 21 of file timer.h.

◆ TIMER_HANDLE

#define TIMER_HANDLE   INTEGER16

Definition at line 15 of file timer.h.

◆ TIMER_NONE

#define TIMER_NONE   -1

Definition at line 26 of file timer.h.

◆ TIMER_TRIG

#define TIMER_TRIG   2

Definition at line 23 of file timer.h.

◆ TIMER_TRIG_PERIOD

#define TIMER_TRIG_PERIOD   3

Definition at line 24 of file timer.h.

Typedef Documentation

◆ s_timer_entry

Definition at line 42 of file timer.h.

◆ TimerCallback_t

typedef void(* TimerCallback_t) (CO_Data *d, UNS32 id)

Definition at line 28 of file timer.h.

Function Documentation

◆ getElapsedTime()

TIMEVAL getElapsedTime ( void )

Return the elapsed time to tell the Stack how much time is spent since last call.

Returns
value TIMEVAL (unsigned long) the elapsed time

Definition at line 65 of file timer_stm.c.

Referenced by SetAlarm(), and TimeDispatch().

Here is the caller graph for this function:

◆ isTimedOut()

UNS8 isTimedOut ( UNS32 * tRef,
UNS32 tAlarm )

Checks if a timer has timed out.

Definition at line 41 of file timer_stm.c.

Referenced by runAppTask(), updateAccelerometer(), updateDiagnostics(), and updateTemperature().

Here is the caller graph for this function:

◆ resetTimeOut()

void resetTimeOut ( UNS32 * tRef)

Resets a timed out timer.

Definition at line 56 of file timer_stm.c.

Referenced by runAppTask(), updateAccelerometer(), updateDiagnostics(), and updateTemperature().

Here is the caller graph for this function:

◆ setTimer()

void setTimer ( TIMEVAL value)

Set the timer peripheral for the next interrupt.

Definition at line 23 of file timer_stm.c.

Referenced by SetAlarm(), and TimeDispatch().

Here is the caller graph for this function: