gornekich d92b0a82cc
NFC refactoring (#3050)
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.

Starring:

- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer

Supporting roles:

- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance

Special thanks:

@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.
2023-10-24 12:08:09 +09:00

43 lines
1.2 KiB
C

#pragma once
#include "iso14443_4a.h"
#include <lib/toolbox/simple_array.h>
#define ISO14443_4A_CMD_READ_ATS (0xE0)
// ATS bit definitions
#define ISO14443_4A_ATS_T0_TA1 (1U << 4)
#define ISO14443_4A_ATS_T0_TB1 (1U << 5)
#define ISO14443_4A_ATS_T0_TC1 (1U << 6)
#define ISO14443_4A_ATS_TA1_BOTH_106KBIT (0U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_212KBIT (1U << 0)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_424KBIT (1U << 1)
#define ISO14443_4A_ATS_TA1_PCD_TO_PICC_848KBIT (1U << 2)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_212KBIT (1U << 4)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_424KBIT (1U << 5)
#define ISO14443_4A_ATS_TA1_PICC_TO_PCD_848KBIT (1U << 6)
#define ISO14443_4A_ATS_TA1_BOTH_SAME_COMPULSORY (1U << 7)
#define ISO14443_4A_ATS_TC1_NAD (1U << 0)
#define ISO14443_4A_ATS_TC1_CID (1U << 1)
typedef struct {
uint8_t tl;
uint8_t t0;
uint8_t ta_1;
uint8_t tb_1;
uint8_t tc_1;
SimpleArray* t1_tk;
} Iso14443_4aAtsData;
struct Iso14443_4aData {
Iso14443_3aData* iso14443_3a_data;
Iso14443_4aAtsData ats_data;
};
bool iso14443_4a_ats_parse(Iso14443_4aAtsData* data, const BitBuffer* buf);
Iso14443_4aError iso14443_4a_process_error(Iso14443_3aError error);