ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include "ruuvi_interface_communication.h"
#include <stdbool.h>
Go to the source code of this file.
Functions | |
rd_status_t | rt_nfc_init (ri_comm_dis_init_t *const init_data) |
Initializes NFC and configures FW, ADDR and ID records according to application_config.h constants. More... | |
rd_status_t | rt_nfc_send (ri_comm_message_t *message) |
Sets given message to NFC RAM buffer. Clears previous message. More... | |
void | rt_nfc_set_on_connected_isr (const ri_comm_cb_t cb) |
Setup connection event handler. More... | |
void | rt_nfc_set_on_disconn_isr (const ri_comm_cb_t cb) |
Setup disconnection event handler. More... | |
void | rt_nfc_set_on_received_isr (const ri_comm_cb_t cb) |
Setup data received event handler. More... | |
void | rt_nfc_set_on_sent_isr (const ri_comm_cb_t cb) |
Setup data sent event handler. More... | |
bool | rt_nfc_is_connected (void) |
check if NFC is connected, i.e. a reader is in range. NFC data cannot be changed during connection, setup data to be sent while NFC is not connected. More... | |
When NFC reader is in range return 4 UTF-textfields with content
Definition in file ruuvi_task_nfc.c.
rd_status_t rt_nfc_init | ( | ri_comm_dis_init_t *const | init_data | ) |
Initializes NFC and configures FW, ADDR and ID records according to application_config.h constants.
RD_SUCCESS | on success. |
RD_ERROR_NULL | if init_data is NULL |
RD_ERROR_INVALID_STATE | if NFC is already initialized. |
Definition at line 288 of file ruuvi_task_nfc.c.
bool rt_nfc_is_connected | ( | ) |
check if NFC is connected, i.e. a reader is in range. NFC data cannot be changed during connection, setup data to be sent while NFC is not connected.
Definition at line 319 of file ruuvi_task_nfc.c.
rd_status_t rt_nfc_send | ( | ri_comm_message_t * | message | ) |
Sets given message to NFC RAM buffer. Clears previous message.
NFC data cannot be sent while NFC is connected, setup data before reader enters range.
Definition at line 293 of file ruuvi_task_nfc.c.
void rt_nfc_set_on_connected_isr | ( | const ri_comm_cb_t | cb | ) |
Setup connection event handler.
The event handler has signature of
where event data is NULL and event_size is 0. The event handler is called in interrupt context.
[in] | cb | Callback which gets called on connection in interrupt context. |
Definition at line 298 of file ruuvi_task_nfc.c.
void rt_nfc_set_on_disconn_isr | ( | const ri_comm_cb_t | cb | ) |
Setup disconnection event handler.
The event handler has signature of
where event data is NULL and event_size is 0. The event handler is called in interrupt context.
[in] | cb | Callback which gets called on disconnection in interrupt context. |
Definition at line 304 of file ruuvi_task_nfc.c.
void rt_nfc_set_on_received_isr | ( | const ri_comm_cb_t | cb | ) |
Setup data received event handler.
The event handler has signature of
where event data is NULL and event_size is 0. The event handler is called in interrupt context.
[in] | cb | Callback which gets called on data received in interrupt context. |
Definition at line 309 of file ruuvi_task_nfc.c.
void rt_nfc_set_on_sent_isr | ( | const ri_comm_cb_t | cb | ) |
Setup data sent event handler.
The event handler has signature of
where event data is NULL and event_size is 0. The event handler is called in interrupt context.
[in] | cb | Callback which gets called on data sent in interrupt context. |
Definition at line 314 of file ruuvi_task_nfc.c.