ruuvi.drivers.c ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Loading...
Searching...
No Matches
ruuvi_interface_communication_nfc.h
Go to the documentation of this file.
1
7#ifndef RUUVI_INTERFACE_COMMUNICATION_NFC_H
8#define RUUVI_INTERFACE_COMMUNICATION_NFC_H
10#include "ruuvi_driver_error.h"
12#include <stdint.h>
13
14#if RI_NFC_ENABLED
15# define RUUVI_NRF5_SDK15_NFC_ENABLED RUUVI_NRF5_SDK15_ENABLED
16#endif
17
18#define RI_NFC_ID_FIELD_CODE {'i', 'd'}
19#define RI_NFC_ADDR_FIELD_CODE {'a', 'd'}
20#define RI_NFC_SW_FIELD_CODE {'s', 'w'}
21#define RI_NFC_DATA_FIELD_CODE {'d', 't'}
22
23
24/*
25 * Initializes NFC hardware.
26 *
27 * @retval RD_SUCCESS on success,
28 * @retval RD_ERROR_INVALID_STATE if NFC is already initialized
29 */
31
32/*
33 * Uninitializes NFC hardware.
34 *
35 * Returns RD_SUCCESS on success.
36 */
38
39// Encodes the given data fields into NFC buffer. Clears previous data.
41
49
59rd_status_t ri_nfc_fw_version_set (const uint8_t * const version, const uint8_t length);
60
70rd_status_t ri_nfc_address_set (const uint8_t * const address, const uint8_t length);
71
81rd_status_t ri_nfc_id_set (const uint8_t * const id,
82 const uint8_t length);
83
84// Not implemented
86
87#endif
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
rd_status_t ri_nfc_address_set(const uint8_t *const address, const uint8_t length)
rd_status_t ri_nfc_init(ri_comm_channel_t *const channel)
rd_status_t ri_nfc_data_set(void)
rd_status_t ri_nfc_send(ri_comm_message_t *messge)
rd_status_t ri_nfc_fw_version_set(const uint8_t *const version, const uint8_t length)
rd_status_t ri_nfc_receive(ri_comm_message_t *messge)
rd_status_t ri_nfc_uninit(ri_comm_channel_t *const channel)
rd_status_t ri_nfc_id_set(const uint8_t *const id, const uint8_t length)
control API for communication via outside world
Application message structure used for communication.