unleashed-firmware/lib/nfc/protocols/iso15693_3/iso15693_3_poller_i.h
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

71 lines
1.7 KiB
C

#pragma once
#include "iso15693_3_poller.h"
#include "iso15693_3_i.h"
#include <toolbox/bit_buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
#define ISO15693_3_POLLER_MAX_BUFFER_SIZE (64U)
typedef enum {
Iso15693_3PollerStateIdle,
Iso15693_3PollerStateColResInProgress,
Iso15693_3PollerStateColResFailed,
Iso15693_3PollerStateActivated,
} Iso15693_3PollerState;
struct Iso15693_3Poller {
Nfc* nfc;
Iso15693_3PollerState state;
Iso15693_3Data* data;
BitBuffer* tx_buffer;
BitBuffer* rx_buffer;
NfcGenericEvent general_event;
Iso15693_3PollerEvent iso15693_3_event;
Iso15693_3PollerEventData iso15693_3_event_data;
NfcGenericCallback callback;
void* context;
};
const Iso15693_3Data* iso15693_3_poller_get_data(Iso15693_3Poller* instance);
Iso15693_3Error iso15693_3_poller_async_activate(Iso15693_3Poller* instance, Iso15693_3Data* data);
Iso15693_3Error iso15693_3_poller_async_inventory(Iso15693_3Poller* instance, uint8_t* uid);
Iso15693_3Error
iso15693_3_poller_async_get_system_info(Iso15693_3Poller* instance, Iso15693_3SystemInfo* data);
Iso15693_3Error iso15693_3_poller_async_read_block(
Iso15693_3Poller* instance,
uint8_t* data,
uint8_t block_number,
uint8_t block_size);
Iso15693_3Error iso15693_3_poller_async_read_blocks(
Iso15693_3Poller* instance,
uint8_t* data,
uint16_t block_count,
uint8_t block_size);
Iso15693_3Error iso15693_3_poller_async_get_blocks_security(
Iso15693_3Poller* instance,
uint8_t* data,
uint16_t block_count);
Iso15693_3Error iso15693_3_poller_send_frame(
Iso15693_3Poller* instance,
const BitBuffer* tx_buffer,
BitBuffer* rx_buffer,
uint32_t fwt);
#ifdef __cplusplus
}
#endif