Mbed OS Reference
Loading...
Searching...
No Matches
Scheduler

Data Structures

struct  __scheduler
 
struct  __nfc_task
 

Scheduler

typedef struct __nfc_timer nfc_scheduler_timer_t
 
typedef struct __nfc_task nfc_task_t
 
typedef struct __scheduler nfc_scheduler_t
 
typedef void(* nfc_task_fn) (uint32_t events, void *pUserData)
 
void nfc_scheduler_timer_init (nfc_scheduler_timer_t *timer)
 
void nfc_scheduler_timer_start (nfc_scheduler_timer_t *timer)
 
uint32_t nfc_scheduler_timer_get (nfc_scheduler_timer_t *timer)
 
void nfc_scheduler_timer_stop (nfc_scheduler_timer_t *timer)
 
void nfc_scheduler_timer_reset (nfc_scheduler_timer_t *timer)
 
void nfc_scheduler_init (nfc_scheduler_t *pScheduler, nfc_scheduler_timer_t *pTimer)
 Init scheduler. More...
 
uint32_t nfc_scheduler_iteration (nfc_scheduler_t *pScheduler, uint32_t events)
 Iterate through all tasks. More...
 
void nfc_scheduler_queue_task (nfc_scheduler_t *pScheduler, nfc_task_t *pTask)
 Queue a task to execute. More...
 
void nfc_scheduler_dequeue_task (nfc_scheduler_t *pScheduler, bool abort, nfc_task_t *pTask)
 Remove a task to execute. More...
 
void task_init (nfc_task_t *pTask, uint32_t events, uint32_t timeout, nfc_task_fn fn, void *pUserData)
 Initialize task with the following parameters. More...
 
#define EVENT_NONE   0
 
#define EVENT_TIMEOUT   1
 
#define EVENT_ABORTED   2
 
#define EVENT_HW_INTERRUPT   4
 

Detailed Description

Function Documentation

◆ nfc_scheduler_init()

void nfc_scheduler_init ( nfc_scheduler_t pScheduler,
nfc_scheduler_timer_t *  pTimer 
)

Init scheduler.

Parameters
pSchedulerscheduler instance to init
pTimertimer instance

◆ nfc_scheduler_iteration()

uint32_t nfc_scheduler_iteration ( nfc_scheduler_t pScheduler,
uint32_t  events 
)

Iterate through all tasks.

Parameters
pSchedulerscheduler instance
eventsmask of events (except EVENT_TIMEOUT) that have been raised since this function last returned (0 on first call)
Returns
time after which this function must be called again if no other event arises

◆ nfc_scheduler_queue_task()

void nfc_scheduler_queue_task ( nfc_scheduler_t pScheduler,
nfc_task_t pTask 
)

Queue a task to execute.

Parameters
pSchedulerscheduler instance
pTasktask to queue

◆ nfc_scheduler_dequeue_task()

void nfc_scheduler_dequeue_task ( nfc_scheduler_t pScheduler,
bool  abort,
nfc_task_t pTask 
)

Remove a task to execute.

Parameters
pSchedulerscheduler instance
pTasktask to remove
abortabort task if queued

◆ task_init()

void task_init ( nfc_task_t pTask,
uint32_t  events,
uint32_t  timeout,
nfc_task_fn  fn,
void *  pUserData 
)

Initialize task with the following parameters.

Parameters
pTasktask to initialize
eventsevents on which to call task
timeoutif relevant
fnfunction to be called
pUserDatadata that will be passed to function