Various cleanups.

- New functions nfc_device_new(), nfc_device_free();
- Add experimental abort mechanism for the PN53x USB driver;
- Move chip-specific variables from nfc_device_t to pn53x_data (Fixes Issue 124).
This commit is contained in:
Romain Tartiere 2011-03-09 13:37:16 +00:00
parent 8d27768097
commit ad530f6d02
10 changed files with 181 additions and 143 deletions

View file

@ -55,10 +55,6 @@ typedef struct {
bool bEasyFraming;
/** Should the PN53x chip switch automatically in ISO14443-4 when ISO14443 */
bool bAutoIso14443_4;
/** Register cache for REG_CIU_BIT_FRAMING, SYMBOL_TX_LAST_BITS: The last TX bits setting, we need to reset this if it does not apply anymore */
uint8_t ui8TxBits;
/** Register cache for SetParameters function. */
uint8_t ui8Parameters;
/** Supported modulation encoded in a byte */
byte_t btSupportByte;
/** Last error reported by the PCD / encountered by the PCD driver
@ -70,11 +66,8 @@ typedef struct {
* +----------- Driver-level general error (common to all drivers)
*/
int iLastError;
/** Last sent command */
int iLastCommand;
int iAbortFds[2];
} nfc_device_t;
// TODO: Move chip's specifics in a chips structure (e.g. iLastCommand, ui8Parameters, ui8TxBits)
/**
* @struct nfc_device_desc_t