Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
cascoda_tasklet.h File Reference

Helper 'tasklet' framework for scheduling simple events for the future. More...

#include <stdbool.h>
#include <stdint.h>
#include "ca821x_error.h"
Include dependency graph for cascoda_tasklet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ca_tasklet
 Internal tasklet state structure. More...
 

Typedefs

typedef ca_error(* ca_tasklet_callback) (void *context)
 Function pointer typedef for tasklet callbacks.
 
typedef struct ca_tasklet ca_tasklet
 Internal tasklet state structure.
 

Functions

ca_error TASKLET_Init (ca_tasklet *aTasklet, ca_tasklet_callback aCallback)
 Initialise a tasklet to a stable state, and register its associated callback function.
 
ca_error TASKLET_ScheduleDelta (ca_tasklet *aTasklet, uint32_t aTimeDelta, void *aContext)
 Schedule a tasklet to be called in the future, by aTimeDelta milliseconds.
 
ca_error TASKLET_ScheduleAbs (ca_tasklet *aTasklet, uint32_t aTimeNow, uint32_t aTimeAbs, void *aContext)
 Schedule a tasklet to be called in the future, at aTimeAbs milliseconds.
 
ca_error TASKLET_GetScheduledTime (ca_tasklet *aTasklet, uint32_t *aTimeAbs)
 Get the time that the tasklet is scheduled to be called.
 
ca_error TASKLET_GetScheduledTimeDelta (ca_tasklet *aTasklet, uint32_t *aTimeDelta)
 Get the time delta until a tasklet is scheduled to be called.
 
ca_error TASKLET_Cancel (ca_tasklet *aTasklet)
 Cancel a scheduled tasklet if it is scheduled.
 
bool TASKLET_IsQueued (ca_tasklet *aTasklet)
 Query whether a tasklet is currently scheduled.
 
ca_error TASKLET_GetTimeToNext (uint32_t *aTimeDelta)
 Get the time delta until the next tasklet is scheduled to occur.
 
ca_error TASKLET_Process (void)
 Process the callbacks for any tasklets that are scheduled to happen now or in the past.
 

Detailed Description

Helper 'tasklet' framework for scheduling simple events for the future.