NFC HAL library (private definitions). More...
#include <furi.h>
#include <furi_hal_nfc.h>
#include <furi_hal_spi.h>
#include <drivers/st25r3916.h>
#include <drivers/st25r3916_reg.h>
Go to the source code of this file.
Data Structures | |
struct | FuriHalNfcEventInternal |
NFC HAL internal event structure. More... | |
struct | FuriHalNfc |
NFC HAL global state structure. More... | |
Macros | |
#define | FURI_HAL_NFC_POLLER_FDT_COMP_FC (-500) |
Common frame delay time compensation for pollers. | |
#define | FURI_HAL_NFC_POLLER_FWT_COMP_FC (FURI_HAL_NFC_POLLER_FDT_COMP_FC) |
Common frame wait time compensation for pollers. | |
#define | FURI_HAL_NFC_EVENT_INTERNAL_ALL |
Special bitmask value of all internal events. | |
Enumerations | |
enum | FuriHalNfcEventInternalType { FuriHalNfcEventInternalTypeAbort = (1U << 0) , FuriHalNfcEventInternalTypeIrq = (1U << 1) , FuriHalNfcEventInternalTypeTimerFwtExpired , FuriHalNfcEventInternalTypeTimerBlockTxExpired , FuriHalNfcEventInternalTypeTransparentDataReceived } |
Enumeration containing bitmask values for NFC HAL internal events. More... | |
Functions | |
void | furi_hal_nfc_event_init (void) |
Initialise NFC HAL event system. | |
void | furi_hal_nfc_event_set (FuriHalNfcEventInternalType event) |
Forcibly emit (a) particular internal event(s). | |
void | furi_hal_nfc_init_gpio_isr (void) |
Initialise GPIO to generate an interrupt from the NFC hardware. | |
void | furi_hal_nfc_deinit_gpio_isr (void) |
Disable interrupts from the NFC hardware. | |
void | furi_hal_nfc_timers_init (void) |
Initialise all NFC timers. | |
void | furi_hal_nfc_timers_deinit (void) |
Disable all NFC timers. | |
uint32_t | furi_hal_nfc_get_irq (FuriHalSpiBusHandle *handle) |
Get the interrupt bitmask from the NFC hardware. | |
bool | furi_hal_nfc_event_wait_for_specific_irq (FuriHalSpiBusHandle *handle, uint32_t mask, uint32_t timeout_ms) |
Wait until a specified type of interrupt occurs. | |
FuriHalNfcEvent | furi_hal_nfc_wait_event_common (uint32_t timeout_ms) |
Wait for any event to occur. | |
FuriHalNfcError | furi_hal_nfc_common_listener_rx_start (FuriHalSpiBusHandle *handle) |
Start reception in listener mode. | |
FuriHalNfcError | furi_hal_nfc_common_fifo_tx (FuriHalSpiBusHandle *handle, const uint8_t *tx_data, size_t tx_bits) |
Transmit data using on-chip FIFO. | |
FuriHalNfcError | furi_hal_nfc_common_fifo_rx (FuriHalSpiBusHandle *handle, uint8_t *rx_data, size_t rx_data_size, size_t *rx_bits) |
Receive data using on-chip FIFO. | |
FuriHalNfcError | furi_hal_nfc_poller_tx_common (FuriHalSpiBusHandle *handle, const uint8_t *tx_data, size_t tx_bits) |
Transmit data in poller mode. | |
Variables | |
FuriHalNfc | furi_hal_nfc |
NFC HAL global state object declaration. | |
NFC HAL library (private definitions).
This file is an implementation detail. It must not be included in any public API-related headers.
#define FURI_HAL_NFC_EVENT_INTERNAL_ALL |
Special bitmask value of all internal events.
Enumeration containing bitmask values for NFC HAL internal events.
FuriHalNfcError furi_hal_nfc_common_fifo_rx | ( | FuriHalSpiBusHandle * | handle, |
uint8_t * | rx_data, | ||
size_t | rx_data_size, | ||
size_t * | rx_bits ) |
Receive data using on-chip FIFO.
This function is common to all technologies.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
[out] | rx_data | pointer to a byte array to be filled with received data. |
[in] | rx_data_size | maximum received data size, in bytes. |
[out] | rx_bits | pointer to the variable to contain the received data size, in bits. |
FuriHalNfcError furi_hal_nfc_common_fifo_tx | ( | FuriHalSpiBusHandle * | handle, |
const uint8_t * | tx_data, | ||
size_t | tx_bits ) |
Transmit data using on-chip FIFO.
This function is common to all technologies.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
[in] | tx_data | pointer to a byte array containing the data to be transmitted. |
[in] | tx_bits | transmit data size, in bits. |
FuriHalNfcError furi_hal_nfc_common_listener_rx_start | ( | FuriHalSpiBusHandle * | handle | ) |
Start reception in listener mode.
This function is common to all technologies.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
void furi_hal_nfc_event_set | ( | FuriHalNfcEventInternalType | event | ) |
Forcibly emit (a) particular internal event(s).
[in] | event | bitmask of one or more events to be emitted. |
bool furi_hal_nfc_event_wait_for_specific_irq | ( | FuriHalSpiBusHandle * | handle, |
uint32_t | mask, | ||
uint32_t | timeout_ms ) |
Wait until a specified type of interrupt occurs.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
[in] | mask | bitmask of one or more interrupts to wait for. |
[in] | timeout_ms | maximum time to wait for an interrupt, in milliseconds. |
uint32_t furi_hal_nfc_get_irq | ( | FuriHalSpiBusHandle * | handle | ) |
Get the interrupt bitmask from the NFC hardware.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
FuriHalNfcError furi_hal_nfc_poller_tx_common | ( | FuriHalSpiBusHandle * | handle, |
const uint8_t * | tx_data, | ||
size_t | tx_bits ) |
Transmit data in poller mode.
This function is common to all technologies.
[in,out] | handle | pointer to the SPI handle associated with the NFC chip. |
[in] | tx_data | pointer to a byte array containing the data to be transmitted. |
[in] | tx_bits | transmit data size, in bits. |
FuriHalNfcEvent furi_hal_nfc_wait_event_common | ( | uint32_t | timeout_ms | ) |
Wait for any event to occur.
This function is common to all technologies.
[in] | timeout_ms | maximum time to wait for an event, in milliseconds. |