39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define RFID_SEND_CMD_CRTL 0x00
75#define RFID_RESET_CTRL 0x01
76#define RFID_READ_CTRL 0x02
77#define RFID_POLL_CTRL 0x03
96#define RFID_PROT_SELECT 0x02
97#define RFID_SEND_RECV 0x04
99#define RFID_RD_WAKEUP_REG 0x08
100#define RFID_WR_WAKEUP_REG 0x09
101#define RFID_SET_BAUD 0x0A
102#define RFID_ECHO 0x55
108#define RFID_FIELD_OFF 0x00
109#define RFID_ISO_15693 0x01
110#define RFID_ISO_14443A 0x02
111#define RFID_ISO_14443B 0x03
112#define RFID_ISO_18092NFC 0x04
118#define RFID_UART 0x00
125#define RFID_MAX_DATA_LEN 0xFF
131#define RFID_DATA_READY 0x08
132#define RFID_DATA_NOT_READY 0x00
150#define RFID_MAP_MIKROBUS( cfg, mikrobus ) \
151 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
152 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
153 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
154 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
155 cfg.ssi_1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
156 cfg.ssi_0 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
157 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
158 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
159 cfg.irq_in = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
160 cfg.irq_out = MIKROBUS( mikrobus, MIKROBUS_INT )
169#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition rfid.h:169
uint8_t rfid_data_ready(rfid_t *ctx)
RFID data ready function.
err_t rfid_auto_detect_filter(rfid_t *ctx)
Configure auto detect filter.
err_t rfid_init(rfid_t *ctx, rfid_cfg_t *cfg)
RFID initialization function.
err_t rfid_select_rfid_protocol(rfid_t *ctx, uint8_t rfid_protocol)
Select RF communication protocol.
err_t rfid_select_communication_interface(rfid_t *ctx, uint8_t com_interface)
Select communication interface.
err_t rfid_set_index_mod_and_gain(rfid_t *ctx)
Configure IndexMod and Gain.
err_t rfid_reset(rfid_t *ctx)
RFID reset function.
err_t rfid_send_command(rfid_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
RFID command writing function.
err_t rfid_default_cfg(rfid_t *ctx)
RFID default configuration function.
err_t rfid_read_data(rfid_t *ctx, uint8_t *data_out)
RFID data reading function.
err_t rfid_get_tag_uid(rfid_t *ctx, uint8_t rfid_protocol, uint8_t *tag_uid)
RFID get RFID tag uid function.
err_t rfid_check_echo(rfid_t *ctx)
RFID check echo response.
err_t rfid_calibration(rfid_t *ctx)
RFID calibration function.
void rfid_cfg_setup(rfid_cfg_t *cfg)
RFID configuration object setup function.
err_t rfid_get_device_id(rfid_t *ctx, uint8_t *device_id)
RFID get device id function.
rfid_return_value_t
RFID Click return value data.
Definition rfid.h:247
@ RFID_ERROR
Definition rfid.h:249
@ RFID_OK
Definition rfid.h:248
RFID Click configuration object.
Definition rfid.h:211
uint32_t baud_rate
Definition rfid.h:234
pin_name_t irq_in
Definition rfid.h:225
pin_name_t ssi_1
Definition rfid.h:223
spi_master_chip_select_polarity_t cs_polarity
Definition rfid.h:232
bool uart_blocking
Definition rfid.h:235
pin_name_t sck
Definition rfid.h:216
uart_data_bits_t data_bit
Definition rfid.h:236
spi_master_mode_t spi_mode
Definition rfid.h:231
pin_name_t tx_pin
Definition rfid.h:219
pin_name_t mosi
Definition rfid.h:215
uint32_t spi_speed
Definition rfid.h:230
pin_name_t rx_pin
Definition rfid.h:218
uart_stop_bits_t stop_bit
Definition rfid.h:238
pin_name_t miso
Definition rfid.h:214
uart_parity_t parity_bit
Definition rfid.h:237
pin_name_t ssi_0
Definition rfid.h:224
pin_name_t irq_out
Definition rfid.h:226
pin_name_t cs
Definition rfid.h:217
RFID Click context object.
Definition rfid.h:177
digital_in_t irq_out
Definition rfid.h:186
spi_master_t spi
Definition rfid.h:190
digital_out_t ssi_0
Definition rfid.h:181
digital_out_t irq_in
Definition rfid.h:182
uart_t uart
Definition rfid.h:194
digital_out_t ssi_1
Definition rfid.h:180
pin_name_t chip_select
Definition rfid.h:192
uint8_t com_interface
Definition rfid.h:201