mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-18 08:43:10 +00:00
bf15d3ce74
* NFC: Improved MFC emulation on some readers * NFC: Improved emulation on some readers (part 2): Some Android devices don't like this * NFC: Improved emulation on some readers (part 3): I knew that during the emulation timings are critical, but one log breaks all... * NFC: Improved emulation on some readers (part 4): Add fixes to Detect reader and refactor code * NFC: Improved emulation on some readers (part 5) * NFC: Improved emulation on some readers (part 6): GUI doesn't update without delay * NFC: Improved emulation on some readers (part 7): Reworked emulation flow, some bug fixes and improvements Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: gornekich <n.gorbadey@gmail.com>
31 lines
693 B
C
31 lines
693 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#include <lib/digital_signal/digital_signal.h>
|
|
|
|
#define NFCA_CMD_RATS (0xE0U)
|
|
#define NFCA_CMD_HALT (0x50U)
|
|
|
|
typedef struct {
|
|
DigitalSignal* one;
|
|
DigitalSignal* zero;
|
|
DigitalSignal* tx_signal;
|
|
} NfcaSignal;
|
|
|
|
uint16_t nfca_get_crc16(uint8_t* buff, uint16_t len);
|
|
|
|
void nfca_append_crc16(uint8_t* buff, uint16_t len);
|
|
|
|
bool nfca_emulation_handler(
|
|
uint8_t* buff_rx,
|
|
uint16_t buff_rx_len,
|
|
uint8_t* buff_tx,
|
|
uint16_t* buff_tx_len);
|
|
|
|
NfcaSignal* nfca_signal_alloc();
|
|
|
|
void nfca_signal_free(NfcaSignal* nfca_signal);
|
|
|
|
void nfca_signal_encode(NfcaSignal* nfca_signal, uint8_t* data, uint16_t bits, uint8_t* parity);
|