LibDriver MFRC522
Loading...
Searching...
No Matches
driver_mfrc522.h
Go to the documentation of this file.
1
36
37#ifndef DRIVER_MFRC522_H
38#define DRIVER_MFRC522_H
39
40#include <stdio.h>
41#include <stdint.h>
42#include <string.h>
43
44#ifdef __cplusplus
45extern "C"{
46#endif
47
53
58
68
72typedef enum
73{
77
95
109
118
134
143
152
166
179
183typedef enum
184{
187
201
215
224
235
246
263
277
291
303
313
326
336
357
361typedef struct mfrc522_handle_s
362{
363 uint8_t (*reset_gpio_init)(void);
364 uint8_t (*reset_gpio_deinit)(void);
365 uint8_t (*reset_gpio_write)(uint8_t data);
366 uint8_t (*iic_init)(void);
367 uint8_t (*iic_deinit)(void);
368 uint8_t (*iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
369 uint8_t (*iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
370 uint8_t (*uart_init)(void);
371 uint8_t (*uart_deinit)(void);
372 uint16_t (*uart_read)(uint8_t *buf, uint16_t len);
373 uint8_t (*uart_flush)(void);
374 uint8_t (*uart_write)(uint8_t *buf, uint16_t len);
375 uint8_t (*spi_init)(void);
376 uint8_t (*spi_deinit)(void);
377 uint8_t (*spi_read)(uint8_t reg, uint8_t *buf, uint16_t len);
378 uint8_t (*spi_write)(uint8_t reg, uint8_t *buf, uint16_t len);
379 void (*receive_callback)(uint16_t type);
380 void (*delay_ms)(uint32_t ms);
381 void (*debug_print)(const char *const fmt, ...);
382 uint8_t inited;
383 uint8_t iic_addr;
384 uint8_t iic_spi_uart;
385 uint16_t irq_flag;
387
403
407
414
421#define DRIVER_MFRC522_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
422
429#define DRIVER_MFRC522_LINK_RESET_GPIO_INIT(HANDLE, FUC) (HANDLE)->reset_gpio_init = FUC
430
437#define DRIVER_MFRC522_LINK_RESET_GPIO_DEINIT(HANDLE, FUC) (HANDLE)->reset_gpio_deinit = FUC
438
445#define DRIVER_MFRC522_LINK_RESET_GPIO_WRITE(HANDLE, FUC) (HANDLE)->reset_gpio_write = FUC
446
453#define DRIVER_MFRC522_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
454
461#define DRIVER_MFRC522_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
462
469#define DRIVER_MFRC522_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
470
477#define DRIVER_MFRC522_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
478
485#define DRIVER_MFRC522_LINK_UART_INIT(HANDLE, FUC) (HANDLE)->uart_init = FUC
486
493#define DRIVER_MFRC522_LINK_UART_DEINIT(HANDLE, FUC) (HANDLE)->uart_deinit = FUC
494
501#define DRIVER_MFRC522_LINK_UART_READ(HANDLE, FUC) (HANDLE)->uart_read = FUC
502
509#define DRIVER_MFRC522_LINK_UART_WRITE(HANDLE, FUC) (HANDLE)->uart_write = FUC
510
517#define DRIVER_MFRC522_LINK_UART_FLUSH(HANDLE, FUC) (HANDLE)->uart_flush = FUC
518
525#define DRIVER_MFRC522_LINK_SPI_INIT(HANDLE, FUC) (HANDLE)->spi_init = FUC
526
533#define DRIVER_MFRC522_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
534
541#define DRIVER_MFRC522_LINK_SPI_READ(HANDLE, FUC) (HANDLE)->spi_read = FUC
542
549#define DRIVER_MFRC522_LINK_SPI_WRITE(HANDLE, FUC) (HANDLE)->spi_write = FUC
550
557#define DRIVER_MFRC522_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
558
565#define DRIVER_MFRC522_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
566
573#define DRIVER_MFRC522_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
574
578
585
594uint8_t mfrc522_info(mfrc522_info_t *info);
595
606
617
627uint8_t mfrc522_set_addr_pin(mfrc522_handle_t *handle, uint8_t addr_pin);
628
638uint8_t mfrc522_get_addr_pin(mfrc522_handle_t *handle, uint8_t *addr_pin);
639
651
665uint8_t mfrc522_init(mfrc522_handle_t *handle);
666
679uint8_t mfrc522_deinit(mfrc522_handle_t *handle);
680
704 mfrc522_command_t command,
705 uint8_t *in_buf, uint8_t in_len,
706 uint8_t *out_buf, uint8_t *out_len,
707 uint8_t *err, uint32_t ms);
708
721
734
747
760
773
786
800
814
827
840
853
867
881
894
907
920
932uint8_t mfrc522_get_interrupt1_status(mfrc522_handle_t *handle, uint8_t *status);
933
945uint8_t mfrc522_get_interrupt2_status(mfrc522_handle_t *handle, uint8_t *status);
946
958uint8_t mfrc522_get_error(mfrc522_handle_t *handle, uint8_t *err);
959
971uint8_t mfrc522_get_status1(mfrc522_handle_t *handle, uint8_t *status);
972
984uint8_t mfrc522_get_status2(mfrc522_handle_t *handle, uint8_t *status);
985
998
1011
1024
1037
1050
1063
1077uint8_t mfrc522_set_fifo_data(mfrc522_handle_t *handle, uint8_t *data, uint8_t len);
1078
1092uint8_t mfrc522_get_fifo_data(mfrc522_handle_t *handle, uint8_t *data, uint8_t len);
1093
1105uint8_t mfrc522_get_fifo_level(mfrc522_handle_t *handle, uint8_t *level);
1106
1117uint8_t mfrc522_flush_fifo(mfrc522_handle_t *handle);
1118
1131uint8_t mfrc522_set_water_level(mfrc522_handle_t *handle, uint8_t level);
1132
1144uint8_t mfrc522_get_water_level(mfrc522_handle_t *handle, uint8_t *level);
1145
1156uint8_t mfrc522_stop_timer(mfrc522_handle_t *handle);
1157
1168uint8_t mfrc522_start_timer(mfrc522_handle_t *handle);
1169
1181uint8_t mfrc522_get_rx_last_bits(mfrc522_handle_t *handle, uint8_t *bits);
1182
1193uint8_t mfrc522_start_send(mfrc522_handle_t *handle);
1194
1205uint8_t mfrc522_stop_send(mfrc522_handle_t *handle);
1206
1219uint8_t mfrc522_set_tx_last_bits(mfrc522_handle_t *handle, uint8_t bits);
1220
1232uint8_t mfrc522_get_tx_last_bits(mfrc522_handle_t *handle, uint8_t *bits);
1233
1246
1259
1272
1285
1298
1310uint8_t mfrc522_get_collision_position(mfrc522_handle_t *handle, uint8_t *pos);
1311
1324
1337
1350
1363
1376
1389
1402
1415
1428
1441
1454
1467
1480
1493
1506
1519
1532
1545
1558
1571
1584
1597
1611
1625
1638
1651
1664
1677
1690
1703
1716
1729
1742uint8_t mfrc522_set_rx_wait(mfrc522_handle_t *handle, uint8_t t);
1743
1755uint8_t mfrc522_get_rx_wait(mfrc522_handle_t *handle, uint8_t *t);
1756
1769uint8_t mfrc522_set_min_level(mfrc522_handle_t *handle, uint8_t level);
1770
1782uint8_t mfrc522_get_min_level(mfrc522_handle_t *handle, uint8_t *level);
1783
1796uint8_t mfrc522_set_collision_level(mfrc522_handle_t *handle, uint8_t level);
1797
1809uint8_t mfrc522_get_collision_level(mfrc522_handle_t *handle, uint8_t *level);
1810
1823
1836
1848uint8_t mfrc522_set_fix_iq(mfrc522_handle_t *handle, mfrc522_bool_t enable);
1849
1861uint8_t mfrc522_get_fix_iq(mfrc522_handle_t *handle, mfrc522_bool_t *enable);
1862
1875
1888
1901uint8_t mfrc522_set_timer_constant_reception(mfrc522_handle_t *handle, uint8_t t);
1902
1914uint8_t mfrc522_get_timer_constant_reception(mfrc522_handle_t *handle, uint8_t *t);
1915
1928uint8_t mfrc522_set_timer_constant_sync(mfrc522_handle_t *handle, uint8_t t);
1929
1941uint8_t mfrc522_get_timer_constant_sync(mfrc522_handle_t *handle, uint8_t *t);
1942
1955uint8_t mfrc522_set_tx_wait(mfrc522_handle_t *handle, uint8_t t);
1956
1968uint8_t mfrc522_get_tx_wait(mfrc522_handle_t *handle, uint8_t *t);
1969
1982
1995
2022uint8_t mfrc522_set_serial_speed(mfrc522_handle_t *handle, uint8_t t0, uint8_t t1);
2023
2036uint8_t mfrc522_get_serial_speed(mfrc522_handle_t *handle, uint8_t *t0, uint8_t *t1);
2037
2049uint8_t mfrc522_get_crc(mfrc522_handle_t *handle, uint16_t *crc);
2050
2062uint8_t mfrc522_set_modulation_width(mfrc522_handle_t *handle, uint8_t width);
2063
2075uint8_t mfrc522_get_modulation_width(mfrc522_handle_t *handle, uint8_t *width);
2076
2089
2102
2115uint8_t mfrc522_set_cwgsn(mfrc522_handle_t *handle, uint8_t n);
2116
2128uint8_t mfrc522_get_cwgsn(mfrc522_handle_t *handle, uint8_t *n);
2129
2142uint8_t mfrc522_set_modgsn(mfrc522_handle_t *handle, uint8_t n);
2143
2155uint8_t mfrc522_get_modgsn(mfrc522_handle_t *handle, uint8_t *n);
2156
2169uint8_t mfrc522_set_cwgsp(mfrc522_handle_t *handle, uint8_t n);
2170
2182uint8_t mfrc522_get_cwgsp(mfrc522_handle_t *handle, uint8_t *n);
2183
2196uint8_t mfrc522_set_modgsp(mfrc522_handle_t *handle, uint8_t n);
2197
2209uint8_t mfrc522_get_modgsp(mfrc522_handle_t *handle, uint8_t *n);
2210
2223
2236
2249
2262
2275
2288
2301uint8_t mfrc522_set_timer_prescaler(mfrc522_handle_t *handle, uint16_t t);
2302
2314uint8_t mfrc522_get_timer_prescaler(mfrc522_handle_t *handle, uint16_t *t);
2315
2327uint8_t mfrc522_set_timer_reload(mfrc522_handle_t *handle, uint16_t reload);
2328
2340uint8_t mfrc522_get_timer_reload(mfrc522_handle_t *handle, uint16_t *reload);
2341
2353uint8_t mfrc522_get_timer_counter(mfrc522_handle_t *handle, uint16_t *cnt);
2354
2358
2365
2378uint8_t mfrc522_set_test_bus_signal_1(mfrc522_handle_t *handle, uint8_t s);
2379
2391uint8_t mfrc522_get_test_bus_signal_1(mfrc522_handle_t *handle, uint8_t *s);
2392
2405uint8_t mfrc522_set_test_bus_signal_2(mfrc522_handle_t *handle, uint8_t s);
2406
2418uint8_t mfrc522_get_test_bus_signal_2(mfrc522_handle_t *handle, uint8_t *s);
2419
2432
2445
2458
2471
2484
2497
2510
2523
2536uint8_t mfrc522_set_test_pin_enable(mfrc522_handle_t *handle, uint8_t pin);
2537
2549uint8_t mfrc522_get_test_pin_enable(mfrc522_handle_t *handle, uint8_t *pin);
2550
2563
2576
2589uint8_t mfrc522_set_test_pin_value(mfrc522_handle_t *handle, uint8_t value);
2590
2602uint8_t mfrc522_get_test_pin_value(mfrc522_handle_t *handle, uint8_t *value);
2603
2615uint8_t mfrc522_get_test_bus(mfrc522_handle_t *handle, uint8_t *bus);
2616
2629
2642
2655uint8_t mfrc522_set_self_test(mfrc522_handle_t *handle, uint8_t test);
2656
2668uint8_t mfrc522_get_self_test(mfrc522_handle_t *handle, uint8_t *test);
2669
2682uint8_t mfrc522_get_version(mfrc522_handle_t *handle, uint8_t *id, uint8_t *version);
2683
2696
2709
2722
2735
2748uint8_t mfrc522_set_test_dac_1(mfrc522_handle_t *handle, uint8_t dac);
2749
2761uint8_t mfrc522_get_test_dac_1(mfrc522_handle_t *handle, uint8_t *dac);
2762
2775uint8_t mfrc522_set_test_dac_2(mfrc522_handle_t *handle, uint8_t dac);
2776
2788uint8_t mfrc522_get_test_dac_2(mfrc522_handle_t *handle, uint8_t *dac);
2789
2802uint8_t mfrc522_get_test_adc(mfrc522_handle_t *handle, uint8_t *adc_i, uint8_t *adc_q);
2803
2807
2814
2828uint8_t mfrc522_set_reg(mfrc522_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
2829
2843uint8_t mfrc522_get_reg(mfrc522_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
2844
2848
2852
2853#ifdef __cplusplus
2854}
2855#endif
2856
2857#endif
uint8_t mfrc522_get_timer_auto(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the timer auto status
mfrc522_interface_t
mfrc522 interface enumeration definition
uint8_t mfrc522_get_force_100_ask(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the force 100 ask status
uint8_t mfrc522_get_water_level(mfrc522_handle_t *handle, uint8_t *level)
get the water level
mfrc522_command_t
mfrc522 command enumeration definition
uint8_t mfrc522_set_interrupt2(mfrc522_handle_t *handle, mfrc522_interrupt2_t type, mfrc522_bool_t enable)
enable or disable the interrupt2
uint8_t mfrc522_set_fix_iq(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable fix iq
uint8_t mfrc522_get_collision_level(mfrc522_handle_t *handle, uint8_t *level)
get the collision level
uint8_t mfrc522_get_modulation_invert(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the modulation invert status
uint8_t mfrc522_get_interrupt2(mfrc522_handle_t *handle, mfrc522_interrupt2_t type, mfrc522_bool_t *enable)
get the interrupt2 status
uint8_t mfrc522_get_timer_constant_sync(mfrc522_handle_t *handle, uint8_t *t)
get the timer constant sync
uint8_t mfrc522_get_timer_counter(mfrc522_handle_t *handle, uint16_t *cnt)
get the timer counter
mfrc522_test_analog_control_t
mfrc522 test analog control enumeration definition
mfrc522_bool_t
mfrc522 bool enumeration definition
uint8_t mfrc522_init(mfrc522_handle_t *handle)
initialize the chip
uint8_t mfrc522_set_mifare_crypto1_on(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable mifare crypto1 on
uint8_t mfrc522_get_clear_temperature_error(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the clear temperature error status
uint8_t mfrc522_set_rx_multiple(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable rx multiple
uint8_t mfrc522_get_modulation_width(mfrc522_handle_t *handle, uint8_t *width)
get the modulation width
uint8_t mfrc522_get_timer_prescal_even(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the timer prescal even status
uint8_t mfrc522_set_timer_constant_sync(mfrc522_handle_t *handle, uint8_t t)
set the timer constant sync
uint8_t mfrc522_set_interface(mfrc522_handle_t *handle, mfrc522_interface_t interface)
set the chip interface
uint8_t mfrc522_get_serial_speed(mfrc522_handle_t *handle, uint8_t *t0, uint8_t *t1)
get the serial speed
uint8_t mfrc522_set_interrupt_pin_type(mfrc522_handle_t *handle, mfrc522_interrupt_pin_type_t type)
set the interrupt pin type
uint8_t mfrc522_get_crc_preset(mfrc522_handle_t *handle, mfrc522_crc_preset_t *preset)
get the crc preset
uint8_t mfrc522_get_tx_wait_rf(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the rf tx wait status
uint8_t mfrc522_set_force_iic_high_speed(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable force iic high speed
uint8_t mfrc522_set_channel_reception(mfrc522_handle_t *handle, mfrc522_channel_reception_t reception)
set the channel reception
uint8_t mfrc522_set_rx_wait(mfrc522_handle_t *handle, uint8_t t)
set the rx wait
mfrc522_timer_gated_mode_t
mfrc522 timer gated mode enumeration definition
uint8_t mfrc522_irq_handler(mfrc522_handle_t *handle)
irq handler
uint8_t mfrc522_get_mfout_input(mfrc522_handle_t *handle, mfrc522_mfout_input_t *input)
get the mfout input
uint8_t mfrc522_set_force_100_ask(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable force 100 ask
uint8_t mfrc522_get_rx_no_error(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the rx no error status
uint8_t mfrc522_get_status2(mfrc522_handle_t *handle, uint8_t *status)
get the status2
uint8_t mfrc522_get_error(mfrc522_handle_t *handle, uint8_t *err)
get the error
uint8_t mfrc522_flush_fifo(mfrc522_handle_t *handle)
flush the fifo
uint8_t mfrc522_get_fix_iq(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the fix iq status
uint8_t mfrc522_get_collision_position_not_valid(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the collision position not valid bit status
uint8_t mfrc522_set_interrupt1(mfrc522_handle_t *handle, mfrc522_interrupt1_t type, mfrc522_bool_t enable)
enable or disable the interrupt1
uint8_t mfrc522_set_rx_speed(mfrc522_handle_t *handle, mfrc522_speed_t speed)
set the rx speed
uint8_t mfrc522_set_parity_disable(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable parity disable
uint8_t mfrc522_set_crc_preset(mfrc522_handle_t *handle, mfrc522_crc_preset_t preset)
set the crc preset
uint8_t mfrc522_get_crc(mfrc522_handle_t *handle, uint16_t *crc)
get the crc
uint8_t mfrc522_get_tx_last_bits(mfrc522_handle_t *handle, uint8_t *bits)
get the tx last bits
uint8_t mfrc522_get_tx_input(mfrc522_handle_t *handle, mfrc522_tx_input_t *input)
get the tx input
uint8_t mfrc522_set_water_level(mfrc522_handle_t *handle, uint8_t level)
set the water level
uint8_t mfrc522_set_tx_last_bits(mfrc522_handle_t *handle, uint8_t bits)
set the tx last bits
uint8_t mfrc522_set_interrupt1_pin_invert(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable interrupt1 pin invert
uint8_t mfrc522_transceiver(mfrc522_handle_t *handle, mfrc522_command_t command, uint8_t *in_buf, uint8_t in_len, uint8_t *out_buf, uint8_t *out_len, uint8_t *err, uint32_t ms)
mfrc522 transceiver
uint8_t mfrc522_set_rx_align(mfrc522_handle_t *handle, mfrc522_rx_align_t align)
set the rx align
uint8_t mfrc522_set_antenna_driver(mfrc522_handle_t *handle, mfrc522_antenna_driver_t driver, mfrc522_bool_t enable)
enable or disable the antenna driver
uint8_t mfrc522_set_modgsp(mfrc522_handle_t *handle, uint8_t n)
set the modgsp
mfrc522_tx_input_t
mfrc522 tx input enumeration definition
uint8_t mfrc522_get_interrupt1_pin_invert(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the interrupt1 pin invert status
uint8_t mfrc522_get_rx_align(mfrc522_handle_t *handle, mfrc522_rx_align_t *align)
get the rx align
uint8_t mfrc522_get_rx_last_bits(mfrc522_handle_t *handle, uint8_t *bits)
get the rx last bits
mfrc522_channel_reception_t
mfrc522 channel reception enumeration definition
mfrc522_interrupt_pin_type_t
mfrc522 interrupt pin type enumeration definition
uint8_t mfrc522_info(mfrc522_info_t *info)
get chip information
uint8_t mfrc522_get_timer_reload(mfrc522_handle_t *handle, uint16_t *reload)
get the timer reload
uint8_t mfrc522_set_mfin_polarity(mfrc522_handle_t *handle, mfrc522_mfin_polarity_t polarity)
set the mfin polarity
mfrc522_error_t
mfrc522 error enumeration definition
uint8_t mfrc522_get_rx_multiple(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the rx multiple status
uint8_t mfrc522_start_timer(mfrc522_handle_t *handle)
start the timer
mfrc522_crc_preset_t
mfrc522 crc preset enumeration definition
uint8_t mfrc522_set_timer_auto_restart(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable timer auto restart
uint8_t mfrc522_set_clear_temperature_error(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable clear temperature error
uint8_t mfrc522_get_rx_gain(mfrc522_handle_t *handle, mfrc522_rx_gain_t *gain)
get the rx gain
uint8_t mfrc522_get_timer_auto_restart(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the timer auto restart status
uint8_t mfrc522_set_modulation_invert(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable the modulation invert
uint8_t mfrc522_set_interrupt2_mark(mfrc522_handle_t *handle, mfrc522_interrupt_mark_t mark)
set the interrupt2 mark
uint8_t mfrc522_set_modulation_width(mfrc522_handle_t *handle, uint8_t width)
set the modulation width
mfrc522_modem_state_t
mfrc522 modem state enumeration definition
uint8_t mfrc522_get_modgsn(mfrc522_handle_t *handle, uint8_t *n)
get the modgsn
uint8_t mfrc522_set_value_clear_after_coll(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable value clear after coll
mfrc522_contactless_uart_input_t
mfrc522 contactless uart input enumeration definition
uint8_t mfrc522_get_status1(mfrc522_handle_t *handle, uint8_t *status)
get the status1
mfrc522_rx_gain_t
mfrc522 rx gain enumeration definition
mfrc522_antenna_driver_t
mfrc522 antenna driver enumeration definition
uint8_t mfrc522_set_fifo_data(mfrc522_handle_t *handle, uint8_t *data, uint8_t len)
set the fifo data
uint8_t mfrc522_get_collision_position(mfrc522_handle_t *handle, uint8_t *pos)
get the collision position
uint8_t mfrc522_get_tx_crc_generation(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the tx crc generation status
uint8_t mfrc522_set_tx_input(mfrc522_handle_t *handle, mfrc522_tx_input_t input)
set the tx input
uint8_t mfrc522_set_rx_crc_generation(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable the rx crc generation
uint8_t mfrc522_set_tx_wait(mfrc522_handle_t *handle, uint8_t t)
set the tx wait
uint8_t mfrc522_stop_timer(mfrc522_handle_t *handle)
stop the timer
uint8_t mfrc522_get_tx_speed(mfrc522_handle_t *handle, mfrc522_speed_t *speed)
get the tx speed
uint8_t mfrc522_get_interface(mfrc522_handle_t *handle, mfrc522_interface_t *interface)
get the chip interface
uint8_t mfrc522_set_cwgsn(mfrc522_handle_t *handle, uint8_t n)
set the cwgsn
uint8_t mfrc522_get_value_clear_after_coll(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the value clear after coll status
mfrc522_rx_align_t
mfrc522 rx align enumeration definition
uint8_t mfrc522_get_parity_disable(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the parity disable status
uint8_t mfrc522_get_addr_pin(mfrc522_handle_t *handle, uint8_t *addr_pin)
get the iic address pin
uint8_t mfrc522_get_command(mfrc522_handle_t *handle, mfrc522_command_t *command)
get the command
uint8_t mfrc522_set_cwgsp(mfrc522_handle_t *handle, uint8_t n)
set the cwgsp
uint8_t mfrc522_set_timer_gated_mode(mfrc522_handle_t *handle, mfrc522_timer_gated_mode_t mode)
set the timer gated mode
uint8_t mfrc522_set_tx_speed(mfrc522_handle_t *handle, mfrc522_speed_t speed)
set the tx speed
uint8_t mfrc522_get_interrupt1_status(mfrc522_handle_t *handle, uint8_t *status)
get the interrupt1 status
mfrc522_interrupt2_t
mfrc522 interrupt2 enumeration definition
uint8_t mfrc522_get_min_level(mfrc522_handle_t *handle, uint8_t *level)
get the min level
uint8_t mfrc522_get_mfin_polarity(mfrc522_handle_t *handle, mfrc522_mfin_polarity_t *polarity)
get the mfin polarity
uint8_t mfrc522_get_rx_wait(mfrc522_handle_t *handle, uint8_t *t)
get the rx wait
uint8_t mfrc522_get_timer_gated_mode(mfrc522_handle_t *handle, mfrc522_timer_gated_mode_t *mode)
get the timer gated mode
uint8_t mfrc522_get_cwgsn(mfrc522_handle_t *handle, uint8_t *n)
get the cwgsn
uint8_t mfrc522_set_addr_pin(mfrc522_handle_t *handle, uint8_t addr_pin)
set the iic address pin
uint8_t mfrc522_get_crc_msb_first(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the crc msb first
uint8_t mfrc522_set_tx_crc_generation(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable tx crc generation
uint8_t mfrc522_set_rx_gain(mfrc522_handle_t *handle, mfrc522_rx_gain_t gain)
set the rx gain
uint8_t mfrc522_get_timer_prescaler(mfrc522_handle_t *handle, uint16_t *t)
get the timer prescaler
uint8_t mfrc522_set_timer_auto(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable timer auto
uint8_t mfrc522_set_timer_reload(mfrc522_handle_t *handle, uint16_t reload)
set the timer reload
mfrc522_interrupt1_t
mfrc522 interrupt1 enumeration definition
uint8_t mfrc522_get_contactless_uart_input(mfrc522_handle_t *handle, mfrc522_contactless_uart_input_t *input)
get the contactless uart input
struct mfrc522_handle_s mfrc522_handle_t
mfrc522 handle structure definition
uint8_t mfrc522_set_command(mfrc522_handle_t *handle, mfrc522_command_t command)
set the command
mfrc522_status1_t
mfrc522 status1 enumeration definition
uint8_t mfrc522_get_interrupt_pin_type(mfrc522_handle_t *handle, mfrc522_interrupt_pin_type_t *type)
get the interrupt pin type
uint8_t mfrc522_get_channel_reception(mfrc522_handle_t *handle, mfrc522_channel_reception_t *reception)
get the channel reception
uint8_t mfrc522_get_modem_state(mfrc522_handle_t *handle, mfrc522_modem_state_t *state)
get the modem state
uint8_t mfrc522_get_cwgsp(mfrc522_handle_t *handle, uint8_t *n)
get the cwgsp
uint8_t mfrc522_set_tx_wait_rf(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable the rf tx wait
uint8_t mfrc522_get_fifo_data(mfrc522_handle_t *handle, uint8_t *data, uint8_t len)
get the fifo data
uint8_t mfrc522_get_interrupt1(mfrc522_handle_t *handle, mfrc522_interrupt1_t type, mfrc522_bool_t *enable)
get the interrupt1 status
uint8_t mfrc522_set_serial_speed(mfrc522_handle_t *handle, uint8_t t0, uint8_t t1)
set the serial speed
uint8_t mfrc522_get_antenna_driver(mfrc522_handle_t *handle, mfrc522_antenna_driver_t driver, mfrc522_bool_t *enable)
get the antenna driver status
mfrc522_interrupt_t
mfrc522 interrupt1 enumeration definition
uint8_t mfrc522_set_receiver_analog(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable the analog part of the receiver
uint8_t mfrc522_get_fifo_level(mfrc522_handle_t *handle, uint8_t *level)
get the fifo level
uint8_t mfrc522_set_crc_msb_first(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable the crc msb first
uint8_t mfrc522_set_rx_no_error(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable rx no error
uint8_t mfrc522_get_interrupt2_status(mfrc522_handle_t *handle, uint8_t *status)
get the interrupt2 status
uint8_t mfrc522_get_rx_crc_generation(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the rx crc generation status
uint8_t mfrc522_set_collision_level(mfrc522_handle_t *handle, uint8_t level)
set the collision level
uint8_t mfrc522_set_min_level(mfrc522_handle_t *handle, uint8_t level)
set the min level
uint8_t mfrc522_deinit(mfrc522_handle_t *handle)
close the chip
uint8_t mfrc522_set_modgsn(mfrc522_handle_t *handle, uint8_t n)
set the modgsn
uint8_t mfrc522_get_modgsp(mfrc522_handle_t *handle, uint8_t *n)
get the modgsp
uint8_t mfrc522_get_receiver_analog(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the analog part of the receiver status
uint8_t mfrc522_get_force_iic_high_speed(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the iic high speed status
uint8_t mfrc522_start_send(mfrc522_handle_t *handle)
start the transmission of data
uint8_t mfrc522_get_rx_speed(mfrc522_handle_t *handle, mfrc522_speed_t *speed)
get the rx speed
uint8_t mfrc522_set_interrupt1_mark(mfrc522_handle_t *handle, mfrc522_interrupt_mark_t mark)
set the interrupt1 mark
uint8_t mfrc522_set_timer_prescaler(mfrc522_handle_t *handle, uint16_t t)
set the timer prescaler
mfrc522_speed_t
mfrc522 speed enumeration definition
uint8_t mfrc522_set_timer_constant_reception(mfrc522_handle_t *handle, uint8_t t)
set the timer constant reception
uint8_t mfrc522_stop_send(mfrc522_handle_t *handle)
stop the transmission of data
mfrc522_mfin_polarity_t
mfrc522 mfin polarity enumeration definition
uint8_t mfrc522_get_power_down(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get power down status
uint8_t mfrc522_get_tx_wait(mfrc522_handle_t *handle, uint8_t *t)
get the tx wait
mfrc522_mfout_input_t
mfrc522 mfout input enumeration definition
mfrc522_status2_t
mfrc522 status2 enumeration definition
uint8_t mfrc522_set_contactless_uart_input(mfrc522_handle_t *handle, mfrc522_contactless_uart_input_t input)
set the contactless uart input
struct mfrc522_info_s mfrc522_info_t
mfrc522 information structure definition
uint8_t mfrc522_get_timer_constant_reception(mfrc522_handle_t *handle, uint8_t *t)
get the timer constant reception
uint8_t mfrc522_set_timer_prescal_even(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable timer prescal even
uint8_t mfrc522_set_power_down(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable power down
mfrc522_interrupt_mark_t
mfrc522 interrupt mark enumeration definition
uint8_t mfrc522_set_mfout_input(mfrc522_handle_t *handle, mfrc522_mfout_input_t input)
set the mfout input
@ MFRC522_INTERFACE_SPI
@ MFRC522_INTERFACE_UART
@ MFRC522_INTERFACE_IIC
@ MFRC522_COMMAND_IDLE
@ MFRC522_COMMAND_MF_AUTHENT
@ MFRC522_COMMAND_TRANSCEIVE
@ MFRC522_COMMAND_TRANSMIT
@ MFRC522_COMMAND_NO_CHANGE
@ MFRC522_COMMAND_SOFT_RESET
@ MFRC522_COMMAND_RANDOM_ID
@ MFRC522_COMMAND_MEM
@ MFRC522_COMMAND_RECEIVE
@ MFRC522_COMMAND_CALC_CRC
@ MFRC522_TEST_ANALOG_CONTROL_SUBCARRIER_DETECTED
@ MFRC522_TEST_ANALOG_CONTROL_DAC_TEST_SIGNAL_ADC_I
@ MFRC522_TEST_ANALOG_CONTROL_DAC_TEST_SIGNAL_ADC_Q
@ MFRC522_TEST_ANALOG_CONTROL_LOW
@ MFRC522_TEST_ANALOG_CONTROL_DAC_TEST_SIGNAL_MIN_LEVEL
@ MFRC522_TEST_ANALOG_CONTROL_OUTPUT
@ MFRC522_TEST_ANALOG_CONTROL_HIGH
@ MFRC522_TEST_ANALOG_CONTROL_RX_ACTIVE
@ MFRC522_TEST_ANALOG_CONTROL_SIGNAL_FOR_PRODUCTION
@ MFRC522_TEST_ANALOG_CONTROL_TX_ACTIVE
@ MFRC522_TEST_ANALOG_CONTROL_TEST_SIGNAL_CORR1
@ MFRC522_TEST_ANALOG_CONTROL_3_STATE
@ MFRC522_TEST_ANALOG_CONTROL_DEFINED_BIT
@ MFRC522_BOOL_TRUE
@ MFRC522_BOOL_FALSE
@ MFRC522_TIMER_GATED_MODE_MFIN
@ MFRC522_TIMER_GATED_MODE_AUX1
@ MFRC522_TIMER_GATED_MODE_NONE
@ MFRC522_TX_INPUT_MFIN_PIN
@ MFRC522_TX_INPUT_3_STATE
@ MFRC522_TX_INPUT_CONTROL
@ MFRC522_TX_INPUT_INTERNAL_ENCODER
@ MFRC522_CHANNEL_RECEPTION_STRONGER
@ MFRC522_CHANNEL_RECEPTION_STRONGER_FREEZE_SELECTED
@ MFRC522_INTERRUPT_PIN_TYPE_OPEN_DRAIN
@ MFRC522_INTERRUPT_PIN_TYPE_STANDARD_CMOS
@ MFRC522_ERROR_BUFFER_OVER_FLOW
@ MFRC522_ERROR_COLL
@ MFRC522_ERROR_PROTOCOL
@ MFRC522_ERROR_WR
@ MFRC522_ERROR_PARITY
@ MFRC522_ERROR_CRC
@ MFRC522_ERROR_TEMP
@ MFRC522_CRC_PRESET_A671
@ MFRC522_CRC_PRESET_0000
@ MFRC522_CRC_PRESET_6363
@ MFRC522_CRC_PRESET_FFFF
@ MFRC522_MODEM_STATE_TRANSMITTING
@ MFRC522_MODEM_STATE_RX_WAIT
@ MFRC522_MODEM_STATE_IDLE
@ MFRC522_MODEM_STATE_TX_WAIT
@ MFRC522_MODEM_STATE_WAIT_DATA
@ MFRC522_MODEM_STATE_WAIT_BIT_FRAMING
@ MFRC522_MODEM_STATE_RECEIVING
@ MFRC522_CONTACTLESS_UART_INTERNAL_ANALOG_MODULE
@ MFRC522_CONTACTLESS_UART_INPUT_CONSTANT_LOW
@ MFRC522_CONTACTLESS_UART_MFIN_PIN
@ MFRC522_CONTACTLESS_UART_NRZ
@ MFRC522_RX_GAIN_48_DB
@ MFRC522_RX_GAIN_33_DB
@ MFRC522_RX_GAIN_38_DB
@ MFRC522_RX_GAIN_43_DB
@ MFRC522_RX_GAIN_18_DB
@ MFRC522_RX_GAIN_23_DB
@ MFRC522_ANTENNA_DRIVER_TX2_RF
@ MFRC522_ANTENNA_DRIVER_INV_TX1_RF_OFF
@ MFRC522_ANTENNA_DRIVER_TX2_CW
@ MFRC522_ANTENNA_DRIVER_INV_TX2_RF_ON
@ MFRC522_ANTENNA_DRIVER_TX1_RF
@ MFRC522_ANTENNA_DRIVER_INV_TX2_RF_OFF
@ MFRC522_ANTENNA_DRIVER_INV_TX1_RF_ON
@ MFRC522_RX_ALIGN_7
@ MFRC522_RX_ALIGN_0
@ MFRC522_RX_ALIGN_1
@ MFRC522_INTERRUPT2_CRC
@ MFRC522_INTERRUPT2_MFIN_ACT
@ MFRC522_INTERRUPT1_LO_ALERT
@ MFRC522_INTERRUPT1_IDLE
@ MFRC522_INTERRUPT1_TX
@ MFRC522_INTERRUPT1_TIMER
@ MFRC522_INTERRUPT1_HI_ALERT
@ MFRC522_INTERRUPT1_RX
@ MFRC522_INTERRUPT1_ERR
@ MFRC522_STATUS1_CRC_OK
@ MFRC522_STATUS1_CRC_READY
@ MFRC522_STATUS1_LO_ALERT
@ MFRC522_STATUS1_HI_ALERT
@ MFRC522_STATUS1_IRQ
@ MFRC522_STATUS1_TRUNNING
@ MFRC522_INTERRUPT_IDLE
@ MFRC522_INTERRUPT_MFIN_ACT
@ MFRC522_INTERRUPT_TX
@ MFRC522_INTERRUPT_CRC
@ MFRC522_INTERRUPT_LO_ALERT
@ MFRC522_INTERRUPT_TIMER
@ MFRC522_INTERRUPT_RX
@ MFRC522_INTERRUPT_HI_ALERT
@ MFRC522_INTERRUPT_ERR
@ MFRC522_SPEED_848_KBD
@ MFRC522_SPEED_424_KBD
@ MFRC522_SPEED_106_KBD
@ MFRC522_SPEED_212_KBD
@ MFRC522_MFIN_POLARITY_LOW
@ MFRC522_MFIN_POLARITY_HIGH
@ MFRC522_MFOUT_INPUT_TEST
@ MFRC522_MFOUT_INPUT_HIGH
@ MFRC522_MFOUT_INPUT_TRANSMITTED
@ MFRC522_MFOUT_INPUT_LOW
@ MFRC522_MFOUT_INPUT_3_STATE
@ MFRC522_MFOUT_INPUT_INTERNAL_ENCODER
@ MFRC522_MFOUT_INPUT_RECEIVED
@ MFRC522_STATUS2_MFCRYPTO1_ON
@ MFRC522_INTERRUPT_MARK_SET
@ MFRC522_INTERRUPT_MARK_CLEARED
uint8_t mfrc522_set_test_port_io(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test port io
uint8_t mfrc522_set_test_bus_signal_1(mfrc522_handle_t *handle, uint8_t s)
set the test bus signal 1
uint8_t mfrc522_get_test_bus_signal_1(mfrc522_handle_t *handle, uint8_t *s)
get the test bus signal 1
uint8_t mfrc522_set_test_dac_2(mfrc522_handle_t *handle, uint8_t dac)
set the test dac 2
uint8_t mfrc522_set_test_prbs15(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test prbs15
uint8_t mfrc522_get_test_prbs9(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test prbs9 status
uint8_t mfrc522_get_test_dac_2(mfrc522_handle_t *handle, uint8_t *dac)
get the test dac 2
uint8_t mfrc522_get_self_test(mfrc522_handle_t *handle, uint8_t *test)
get the self test
uint8_t mfrc522_get_test_pin_enable(mfrc522_handle_t *handle, uint8_t *pin)
get the test pin enable
uint8_t mfrc522_get_test_adc(mfrc522_handle_t *handle, uint8_t *adc_i, uint8_t *adc_q)
get the test adc
uint8_t mfrc522_get_test_port_io(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test port io status
uint8_t mfrc522_get_test_analog_control_aux_1(mfrc522_handle_t *handle, mfrc522_test_analog_control_t *control)
get the test analog control aux 1
uint8_t mfrc522_set_test_bus_signal_2(mfrc522_handle_t *handle, uint8_t s)
set the test bus signal 2
uint8_t mfrc522_set_test_analog_control_aux_2(mfrc522_handle_t *handle, mfrc522_test_analog_control_t control)
set the test analog control aux 2
uint8_t mfrc522_get_test_pin_value(mfrc522_handle_t *handle, uint8_t *value)
get the test pin value
uint8_t mfrc522_get_test_analog_control_aux_2(mfrc522_handle_t *handle, mfrc522_test_analog_control_t *control)
get the test analog control aux 2
uint8_t mfrc522_set_test_analog_control_aux_1(mfrc522_handle_t *handle, mfrc522_test_analog_control_t control)
set the test analog control aux 1
uint8_t mfrc522_get_test_amp_rcv(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test amp rcv status
uint8_t mfrc522_get_test_bus(mfrc522_handle_t *handle, uint8_t *bus)
get the test bus
uint8_t mfrc522_get_test_prbs15(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test prbs15 status
uint8_t mfrc522_set_test_amp_rcv(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test amp rcv
uint8_t mfrc522_get_test_bus_flip(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test bus flip status
uint8_t mfrc522_set_self_test(mfrc522_handle_t *handle, uint8_t test)
set the self test
uint8_t mfrc522_get_version(mfrc522_handle_t *handle, uint8_t *id, uint8_t *version)
get the version
uint8_t mfrc522_get_test_dac_1(mfrc522_handle_t *handle, uint8_t *dac)
get the test dac 1
uint8_t mfrc522_set_test_prbs9(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test prbs9
uint8_t mfrc522_set_test_pin_enable(mfrc522_handle_t *handle, uint8_t pin)
set the test pin enable
uint8_t mfrc522_get_test_bus_signal_2(mfrc522_handle_t *handle, uint8_t *s)
get the test bus signal 2
uint8_t mfrc522_set_test_dac_1(mfrc522_handle_t *handle, uint8_t dac)
set the test dac 1
uint8_t mfrc522_set_test_rs232_line(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test rs232 line
uint8_t mfrc522_set_test_pin_value(mfrc522_handle_t *handle, uint8_t value)
set the test pin value
uint8_t mfrc522_set_test_bus_flip(mfrc522_handle_t *handle, mfrc522_bool_t enable)
enable or disable test bus flip
uint8_t mfrc522_get_test_rs232_line(mfrc522_handle_t *handle, mfrc522_bool_t *enable)
get the test rs232 line status
uint8_t mfrc522_set_reg(mfrc522_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
uint8_t mfrc522_get_reg(mfrc522_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
mfrc522 handle structure definition
uint8_t(* uart_flush)(void)
uint8_t(* uart_write)(uint8_t *buf, uint16_t len)
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* spi_read)(uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* spi_write)(uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* uart_deinit)(void)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
void(* receive_callback)(uint16_t type)
uint8_t(* iic_init)(void)
uint8_t(* spi_deinit)(void)
uint16_t(* uart_read)(uint8_t *buf, uint16_t len)
uint8_t(* reset_gpio_init)(void)
uint8_t(* uart_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* reset_gpio_write)(uint8_t data)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
mfrc522 information structure definition
uint32_t driver_version
char manufacturer_name[32]