Flipper Zero Firmware
Loading...
Searching...
No Matches
furi_hal_nfc_i.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <furi.h>
11#include <furi_hal_nfc.h>
12#include <furi_hal_spi.h>
13
14#include <drivers/st25r3916.h>
15#include <drivers/st25r3916_reg.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22#define FURI_HAL_NFC_POLLER_FDT_COMP_FC (-500)
24#define FURI_HAL_NFC_POLLER_FWT_COMP_FC (FURI_HAL_NFC_POLLER_FDT_COMP_FC)
25
39
41#define FURI_HAL_NFC_EVENT_INTERNAL_ALL \
42 ((FuriHalNfcEventInternalTypeAbort | FuriHalNfcEventInternalTypeIrq | \
43 FuriHalNfcEventInternalTypeTimerFwtExpired | \
44 FuriHalNfcEventInternalTypeTimerBlockTxExpired | \
45 FuriHalNfcEventInternalTypeTransparentDataReceived))
46
54
63
68
73
80
85
90
95
100
108
118 FuriHalSpiBusHandle* handle,
119 uint32_t mask,
120 uint32_t timeout_ms);
121
131
141
153 FuriHalSpiBusHandle* handle,
154 const uint8_t* tx_data,
155 size_t tx_bits);
156
169 FuriHalSpiBusHandle* handle,
170 uint8_t* rx_data,
171 size_t rx_data_size,
172 size_t* rx_bits);
173
185 FuriHalSpiBusHandle* handle,
186 const uint8_t* tx_data,
187 size_t tx_bits);
188
189#ifdef __cplusplus
190}
191#endif
NFC HAL library.
FuriHalNfcEvent
Enumeration of possible NFC HAL events.
Definition furi_hal_nfc.h:41
FuriHalNfcMode
Enumeration of possible NFC HAL operating modes.
Definition furi_hal_nfc.h:76
FuriHalNfcTech
Enumeration of supported NFC technologies.
Definition furi_hal_nfc.h:86
FuriHalNfcError
Enumeration of possible NFC HAL errors.
Definition furi_hal_nfc.h:62
FuriHalNfcError furi_hal_nfc_poller_tx_common(FuriHalSpiBusHandle *handle, const uint8_t *tx_data, size_t tx_bits)
Transmit data in poller mode.
Definition furi_hal_nfc.c:478
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.
Definition furi_hal_nfc_event.c:103
void furi_hal_nfc_deinit_gpio_isr(void)
Disable interrupts from the NFC hardware.
Definition furi_hal_nfc_irq.c:26
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.
Definition furi_hal_nfc.c:563
void furi_hal_nfc_timers_deinit(void)
Disable all NFC timers.
Definition furi_hal_nfc_timer.c:201
FuriHalNfcEvent furi_hal_nfc_wait_event_common(uint32_t timeout_ms)
Wait for any event to occur.
Definition furi_hal_nfc_event.c:39
FuriHalNfcError furi_hal_nfc_common_fifo_tx(FuriHalSpiBusHandle *handle, const uint8_t *tx_data, size_t tx_bits)
Transmit data using on-chip FIFO.
Definition furi_hal_nfc.c:510
void furi_hal_nfc_event_init(void)
Initialise NFC HAL event system.
Definition furi_hal_nfc_event.c:5
FuriHalNfc furi_hal_nfc
NFC HAL global state object declaration.
Definition furi_hal_nfc.c:19
void furi_hal_nfc_init_gpio_isr(void)
Initialise GPIO to generate an interrupt from the NFC hardware.
Definition furi_hal_nfc_irq.c:19
uint32_t furi_hal_nfc_get_irq(FuriHalSpiBusHandle *handle)
Get the interrupt bitmask from the NFC hardware.
Definition furi_hal_nfc_irq.c:11
FuriHalNfcEventInternalType
Enumeration containing bitmask values for NFC HAL internal events.
Definition furi_hal_nfc_i.h:29
@ FuriHalNfcEventInternalTypeIrq
NFC hardware interrupt has occurred.
Definition furi_hal_nfc_i.h:31
@ FuriHalNfcEventInternalTypeTimerBlockTxExpired
Transmission block timeout has expired.
Definition furi_hal_nfc_i.h:34
@ FuriHalNfcEventInternalTypeTimerFwtExpired
Frame wait time timeout has expired.
Definition furi_hal_nfc_i.h:32
@ FuriHalNfcEventInternalTypeTransparentDataReceived
Data was received in transparent mode.
Definition furi_hal_nfc_i.h:36
@ FuriHalNfcEventInternalTypeAbort
Abort waiting for hardware events.
Definition furi_hal_nfc_i.h:30
FuriHalNfcError furi_hal_nfc_common_listener_rx_start(FuriHalSpiBusHandle *handle)
Start reception in listener mode.
void furi_hal_nfc_timers_init(void)
Initialise all NFC timers.
Definition furi_hal_nfc_timer.c:195
void furi_hal_nfc_event_set(FuriHalNfcEventInternalType event)
Forcibly emit (a) particular internal event(s).
Definition furi_hal_nfc_event.c:26
NFC HAL internal event structure.
Definition furi_hal_nfc_i.h:50
FuriThreadId thread
Identifier of the thread that will be receiving events.
Definition furi_hal_nfc_i.h:51
void * context
Pointer to the user-provided context (will be passed to the event callback).
Definition furi_hal_nfc_i.h:52
NFC HAL global state structure.
Definition furi_hal_nfc_i.h:58
FuriHalNfcMode mode
Currently selected operating mode.
Definition furi_hal_nfc_i.h:60
FuriHalNfcTech tech
Currently selected NFC technology.
Definition furi_hal_nfc_i.h:61
FuriMutex * mutex
Pointer to the mutex serving as global NFC HAL lock.
Definition furi_hal_nfc_i.h:59
FuriHal spi handle.
Definition furi_hal_spi_types.h:51
Definition mutex.c:11
void * FuriThreadId
Unique thread identifier type (used by the OS kernel).
Definition thread.h:55