/*
 * readerApp.h
 *
 *  Created on: Feb 24, 2020
 *      Author: hyuny
 */

#ifndef INC_READERAPP_H_
#define INC_READERAPP_H_

#include "stm32f4xx_hal.h"
#include "st25r3911_interrupt.h"
#include "rfal_nfc.h"

GPIO_TypeDef* gSpiCs_Port;
uint16_t gSpiCs_Pin;

typedef struct {
	GPIO_TypeDef  *spiCs_Port;
	uint16_t      spiCs_Pin;
} nfcSpiConf;

typedef struct {
	const nfcSpiConf  *const spiConf;
	uint8_t				     state;
	rfalNfc 				 nfcInstance;
	t_st25r3911Interrupt 	 st25r3911interrupt;
	uint8_t					 tagUID[RFAL_NFCV_UID_LEN];
} nfcReader;

void nfcReaderInit();
void nfcReaderCycle(uint8_t num);
void nfcTargetChange(uint8_t num);
nfcReader* nfcReaderInstanceGet(uint8_t num);
#endif /* INC_READERAPP_H_ */
