Sam Grove / Mbed 2 deprecated canopen_masternode

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Timer Management

Timer Management

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 setTimer (TIMEVAL value)
 Set a timerfor a given time.
TIMEVAL getElapsedTime (void)
 Get the time elapsed since latest timer occurence.
void EnterMutex (void)
 Acquire mutex.
void LeaveMutex (void)
 Release mutex.
void TimerInit (void)
 Initialize Timer.
void TimerCleanup (void)
 Cleanup Timer.
void StartTimerLoop (TimerCallback_t Callback)
 Start the timer task.
void StopTimerLoop (TimerCallback_t Callback)
 Stop the timer task.

Function Documentation

TIMER_HANDLE DelAlarm ( TIMER_HANDLE  handle )

Delete an alarm before expiring.

Parameters:
handleA timer handle
Returns:
The timer handle

----- Use this to remove an alarm ----

Parameters:
handle
Returns:

Definition at line 103 of file canopen_timer.c.

void EnterMutex ( void   )

Acquire mutex.

TIMEVAL getElapsedTime ( void   )

Get the time elapsed since latest timer occurence.

Returns:
time elapsed since latest timer occurence

Definition at line 79 of file timer_mbed.cpp.

void LeaveMutex ( void   )

Release mutex.

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.

Parameters:
*dPointer to a CAN object data structure
idThe alarm Id
callbackA callback function
valueCall the callback function at current time + value
periodCall periodically the callback function
Returns:
handle The timer handle

------- Use this to declare a new alarm ------

Parameters:
d
id
callback
value
period
Returns:

Definition at line 57 of file canopen_timer.c.

void setTimer ( TIMEVAL  value )

Set a timerfor a given time.

Parameters:
valueThe time value.

Definition at line 69 of file timer_mbed.cpp.

void StartTimerLoop ( TimerCallback_t  Callback )

Start the timer task.

Parameters:
CallbackA callback function
void StopTimerLoop ( TimerCallback_t  Callback )

Stop the timer task.

Parameters:
CallbackA callback function
void TimerCleanup ( void   )

Cleanup Timer.

void TimerInit ( void   )

Initialize Timer.