WIZlib Library API  ver 1.0
WIZlib Library API User Menual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

Event Alarm Module. More...

Collaboration diagram for Alarm:

Functions

int8 alarm_set (uint32 time, alarm_cbfunc cb, int8 arg)
 Add Alarm event to the waiting queue. More...
 
int8 alarm_del (alarm_cbfunc cb, int8 arg)
 Delete Alarm event from the waiting queue. More...
 
int8 alarm_chk (alarm_cbfunc cb, int8 arg)
 Count Alarm event which have same condition with param from the waiting queue. More...
 
void alarm_run (void)
 Alarm Module Handler. More...
 

Detailed Description

Event Alarm Module.

You can register delayed action through Alarm Module.

Function Documentation

int8 alarm_chk ( alarm_cbfunc  cb,
int8  arg 
)

Count Alarm event which have same condition with param from the waiting queue.

If there is not alarm event same with param, 0 value will be returned.

  • alarm_chk(NULL, -1) : Count all event registered in the queue.
Parameters
cbCallback function in alarm_cbfunc form
NULL value will be ignored
argThe value which was set when alarm event added as arg
-1 value will be ignored
Returns
RET_OK: Success
RET_NOK: Error

Definition at line 151 of file util.c.

int8 alarm_del ( alarm_cbfunc  cb,
int8  arg 
)

Delete Alarm event from the waiting queue.

This function delete every alarm event which have same condition with param

  • alarm_del(NULL, -1) : Delete all event registered in the queue.
Parameters
cbCallback function in alarm_cbfunc form
NULL value will be ignored
argThe value which was set when alarm event added as arg
-1 value will be ignored
Returns
RET_OK: Success
RET_NOK: Error

Definition at line 119 of file util.c.

Here is the caller graph for this function:

void alarm_run ( void  )

Alarm Module Handler.

If you use alarm, this function should run in the main loop

Definition at line 173 of file util.c.

int8 alarm_set ( uint32  time,
alarm_cbfunc  cb,
int8  arg 
)

Add Alarm event to the waiting queue.

Parameters
timeDelay time in tick.
Max time is defined in common.h
Zero time param is possible
cbCallback function in alarm_cbfunc form
argThe value which will be returned through callback function
This is for separation in same callback function
Returns
RET_OK: Success
RET_NOK: Error

Definition at line 78 of file util.c.

Here is the caller graph for this function: