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 06:08:09 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "slix.h"
|
|
|
|
|
|
|
|
#include <nfc/nfc_poller.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-11-15 11:32:45 +03:00
|
|
|
/**
|
|
|
|
* @brief SlixPoller opaque type definition.
|
|
|
|
*/
|
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 06:08:09 +03:00
|
|
|
typedef struct SlixPoller SlixPoller;
|
|
|
|
|
2023-11-15 11:32:45 +03:00
|
|
|
/**
|
|
|
|
* @brief Enumeration of possible Slix poller event types.
|
|
|
|
*/
|
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 06:08:09 +03:00
|
|
|
typedef enum {
|
2023-11-15 11:32:45 +03:00
|
|
|
SlixPollerEventTypeError, /**< An error occured while reading card. */
|
|
|
|
SlixPollerEventTypeReady, /**< The card was successfully read by the poller. */
|
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 06:08:09 +03:00
|
|
|
} SlixPollerEventType;
|
|
|
|
|
2023-11-15 11:32:45 +03:00
|
|
|
/**
|
|
|
|
* @brief Slixs poller event data.
|
|
|
|
*/
|
|
|
|
typedef union {
|
|
|
|
SlixError error; /**< Error code indicating card reaing fail reason. */
|
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 06:08:09 +03:00
|
|
|
} SlixPollerEventData;
|
|
|
|
|
2023-11-15 11:32:45 +03:00
|
|
|
/**
|
|
|
|
* @brief Slix poller event structure.
|
|
|
|
*
|
|
|
|
* Upon emission of an event, an instance of this struct will be passed to the callback.
|
|
|
|
*/
|
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 06:08:09 +03:00
|
|
|
typedef struct {
|
2023-11-15 11:32:45 +03:00
|
|
|
SlixPollerEventType type; /**< Type of emmitted event. */
|
|
|
|
SlixPollerEventData* data; /**< Pointer to event specific data. */
|
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 06:08:09 +03:00
|
|
|
} SlixPollerEvent;
|
|
|
|
|
2023-11-15 11:32:45 +03:00
|
|
|
/**
|
|
|
|
* @brief Transmit and receive Slix frames in poller mode.
|
|
|
|
*
|
|
|
|
* Must ONLY be used inside the callback function.
|
|
|
|
*
|
|
|
|
* The rx_buffer will be filled with any data received as a response to data
|
|
|
|
* sent from tx_buffer, with a timeout defined by the fwt parameter.
|
|
|
|
*
|
|
|
|
* @param[in, out] instance pointer to the instance to be used in the transaction.
|
|
|
|
* @param[in] tx_buffer pointer to the buffer containing the data to be transmitted.
|
|
|
|
* @param[out] rx_buffer pointer to the buffer to be filled with received data.
|
|
|
|
* @param[in] fwt frame wait time (response timeout), in carrier cycles.
|
|
|
|
* @return SlixErrorNone on success, an error code on failure.
|
|
|
|
*/
|
|
|
|
SlixError slix_poller_send_frame(
|
|
|
|
SlixPoller* instance,
|
|
|
|
const BitBuffer* tx_data,
|
|
|
|
BitBuffer* rx_data,
|
|
|
|
uint32_t fwt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Send get nxp system info command and parse response.
|
|
|
|
*
|
|
|
|
* Must ONLY be used inside the callback function.
|
|
|
|
*
|
|
|
|
* @param[in, out] instance pointer to the instance to be used in the transaction.
|
|
|
|
* @param[out] data pointer to the SlixSystemInfo structure to be filled.
|
|
|
|
* @return SlixErrorNone on success, an error code on failure.
|
|
|
|
*/
|
|
|
|
SlixError slix_poller_get_nxp_system_info(SlixPoller* instance, SlixSystemInfo* data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Read signature from card.
|
|
|
|
*
|
|
|
|
* Must ONLY be used inside the callback function.
|
|
|
|
*
|
|
|
|
* @param[in, out] instance pointer to the instance to be used in the transaction.
|
|
|
|
* @param[out] data pointer to the SlixSignature structure to be filled.
|
|
|
|
* @return SlixErrorNone on success, an error code on failure.
|
|
|
|
*/
|
|
|
|
SlixError slix_poller_read_signature(SlixPoller* instance, SlixSignature* data);
|
|
|
|
|
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 06:08:09 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|