4848#include " rfal_rfst25r3916_analogConfig.h"
4949#include " rfal_rfst25r3916_iso15693_2.h"
5050#include " st25r3916_aat.h"
51+ #include < functional>
5152
5253/*
5354 ******************************************************************************
@@ -210,6 +211,23 @@ typedef struct {
210211 bool ready; /* !< Indicate if Look Up Table is complete and ready for use */
211212} rfalAnalogConfigMgmt;
212213
214+ template <typename T>
215+ struct Callback ;
216+
217+ template <typename Ret, typename ... Params>
218+ struct Callback <Ret(Params...)> {
219+ template <typename ... Args>
220+ static Ret callback (Args... args) {
221+ return func (args...);
222+ }
223+ static std::function<Ret(Params...)> func;
224+ };
225+
226+ template <typename Ret, typename ... Params>
227+ std::function<Ret(Params...)> Callback<Ret(Params...)>::func;
228+
229+ typedef void (*ST25R3916IrqHandler)(void );
230+
213231/*
214232******************************************************************************
215233* GLOBAL DEFINES
@@ -1747,15 +1765,6 @@ class RfalRfST25R3916Class : public RfalRfClass {
17471765 */
17481766 void st25r3916CheckForReceivedInterrupts (void );
17491767
1750- /* !
1751- *****************************************************************************
1752- * \brief ISR Service routine
1753- *
1754- * This function modiefies the interrupt
1755- *****************************************************************************
1756- */
1757- void st25r3916Isr (void );
1758-
17591768 /* !
17601769 *****************************************************************************
17611770 * \brief Enable a given ST25R3916 Interrupt source
@@ -1951,6 +1960,14 @@ class RfalRfST25R3916Class : public RfalRfClass {
19511960 ReturnCode aatStepDacVals (const struct st25r3916AatTuneParams *tuningParams, uint8_t *a, uint8_t *b, int32_t dir);
19521961 void setISRPending (void );
19531962 bool isBusBusy (void );
1963+ /* !
1964+ *****************************************************************************
1965+ * \brief ISR Service routine
1966+ *
1967+ * This function modifies the interrupt
1968+ *****************************************************************************
1969+ */
1970+ void st25r3916Isr (void );
19541971
19551972 TwoWire *dev_i2c;
19561973 SPIClass *dev_spi;
@@ -1967,6 +1984,7 @@ class RfalRfST25R3916Class : public RfalRfClass {
19671984 bool i2c_enabled;
19681985 volatile bool isr_pending;
19691986 volatile bool bus_busy;
1987+ ST25R3916IrqHandler irq_handler;
19701988};
19711989
19721990#ifdef __cplusplus
0 commit comments