Data Structures | |
struct | __scheduler |
struct | __nfc_task |
Error codes | |
typedef int | nfc_err_t |
Type for NFC errors. More... | |
#define | NFC_OK 0 |
No error. More... | |
#define | NFC_ERR_UNKNOWN 1 |
Unknown error. More... | |
#define | NFC_ERR_LENGTH 2 |
Length of parameter is wrong. More... | |
#define | NFC_ERR_NOT_FOUND 3 |
Could not find item. More... | |
#define | NFC_ERR_UNSUPPORTED 4 |
This action is not supported. More... | |
#define | NFC_ERR_PARAMS 5 |
These parameters are not correct. More... | |
#define | NFC_ERR_BUFFER_TOO_SMALL 6 |
The buffer is too small to store all data (buffer overflow) More... | |
#define | NFC_ERR_TIMEOUT 7 |
Timeout. More... | |
#define | NFC_ERR_CRC 8 |
Checksum does not match. More... | |
#define | NFC_ERR_NOPEER 9 |
No target/initiator in vicinity. More... | |
#define | NFC_ERR_PARITY 10 |
Parity error. More... | |
#define | NFC_ERR_FIELD 11 |
No RF field detected (or RF field lost) More... | |
#define | NFC_ERR_COLLISION 12 |
Collision detected. More... | |
#define | NFC_ERR_WRONG_COMM 13 |
Communication error. More... | |
#define | NFC_ERR_PROTOCOL 14 |
Protocol is not conformant. More... | |
#define | NFC_ERR_BUSY 15 |
Resource is busy. More... | |
#define | NFC_ERR_CONTROLLER 16 |
Controller failure. More... | |
#define | NFC_ERR_HALTED 17 |
Target has been halted. More... | |
#define | NFC_ERR_MAC 18 |
MAC does not match. More... | |
#define | NFC_ERR_UNDERFLOW 19 |
Could not send data in time. More... | |
#define | NFC_ERR_DISCONNECTED 20 |
Link has disconnected. More... | |
#define | NFC_ERR_ABORTED 21 |
Command was aborted. More... | |
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 |
#define NFC_ERR_ABORTED 21 |
Command was aborted.
Definition at line 55 of file nfc_errors.h.
#define NFC_ERR_BUFFER_TOO_SMALL 6 |
The buffer is too small to store all data (buffer overflow)
Definition at line 40 of file nfc_errors.h.
#define NFC_ERR_BUSY 15 |
Resource is busy.
Definition at line 49 of file nfc_errors.h.
#define NFC_ERR_COLLISION 12 |
Collision detected.
Definition at line 46 of file nfc_errors.h.
#define NFC_ERR_CONTROLLER 16 |
Controller failure.
Definition at line 50 of file nfc_errors.h.
#define NFC_ERR_CRC 8 |
Checksum does not match.
Definition at line 42 of file nfc_errors.h.
#define NFC_ERR_DISCONNECTED 20 |
Link has disconnected.
Definition at line 54 of file nfc_errors.h.
#define NFC_ERR_FIELD 11 |
No RF field detected (or RF field lost)
Definition at line 45 of file nfc_errors.h.
#define NFC_ERR_HALTED 17 |
Target has been halted.
Definition at line 51 of file nfc_errors.h.
#define NFC_ERR_LENGTH 2 |
Length of parameter is wrong.
Definition at line 36 of file nfc_errors.h.
#define NFC_ERR_MAC 18 |
MAC does not match.
Definition at line 52 of file nfc_errors.h.
#define NFC_ERR_NOPEER 9 |
No target/initiator in vicinity.
Definition at line 43 of file nfc_errors.h.
#define NFC_ERR_NOT_FOUND 3 |
Could not find item.
Definition at line 37 of file nfc_errors.h.
#define NFC_ERR_PARAMS 5 |
These parameters are not correct.
Definition at line 39 of file nfc_errors.h.
#define NFC_ERR_PARITY 10 |
Parity error.
Definition at line 44 of file nfc_errors.h.
#define NFC_ERR_PROTOCOL 14 |
Protocol is not conformant.
Definition at line 48 of file nfc_errors.h.
#define NFC_ERR_TIMEOUT 7 |
Timeout.
Definition at line 41 of file nfc_errors.h.
#define NFC_ERR_UNDERFLOW 19 |
Could not send data in time.
Definition at line 53 of file nfc_errors.h.
#define NFC_ERR_UNKNOWN 1 |
Unknown error.
Definition at line 35 of file nfc_errors.h.
#define NFC_ERR_UNSUPPORTED 4 |
This action is not supported.
Definition at line 38 of file nfc_errors.h.
#define NFC_ERR_WRONG_COMM 13 |
Communication error.
Definition at line 47 of file nfc_errors.h.
#define NFC_OK 0 |
No error.
Definition at line 33 of file nfc_errors.h.
typedef int nfc_err_t |
Type for NFC errors.
Definition at line 59 of file nfc_errors.h.
void nfc_scheduler_dequeue_task | ( | nfc_scheduler_t * | pScheduler, |
bool | abort, | ||
nfc_task_t * | pTask | ||
) |
Remove a task to execute.
pScheduler | scheduler instance |
pTask | task to remove |
abort | abort task if queued |
void nfc_scheduler_init | ( | nfc_scheduler_t * | pScheduler, |
nfc_scheduler_timer_t * | pTimer | ||
) |
Init scheduler.
pScheduler | scheduler instance to init |
pTimer | timer instance |
uint32_t nfc_scheduler_iteration | ( | nfc_scheduler_t * | pScheduler, |
uint32_t | events | ||
) |
Iterate through all tasks.
pScheduler | scheduler instance |
events | mask of events (except EVENT_TIMEOUT) that have been raised since this function last returned (0 on first call) |
void nfc_scheduler_queue_task | ( | nfc_scheduler_t * | pScheduler, |
nfc_task_t * | pTask | ||
) |
Queue a task to execute.
pScheduler | scheduler instance |
pTask | task to queue |
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.
pTask | task to initialize |
events | events on which to call task |
timeout | if relevant |
fn | function to be called |
pUserData | data that will be passed to function |