chip/pn53x: handle PN532 "power down" and "low VBat" power mode instead of a simple "sleep" mode. (Fixes Issue 167)
This commit is contained in:
parent
09b18bf6b8
commit
1198a71d64
6 changed files with 73 additions and 31 deletions
|
|
@ -137,10 +137,10 @@ typedef enum {
|
|||
} pn53x_type;
|
||||
|
||||
typedef enum {
|
||||
SLEEP = 0x00, // Need to be wake up to process commands
|
||||
NORMAL = 0x01, // Ready to process command
|
||||
EXECUTE = 0x02, // Need to cancel the running command to process new one
|
||||
} pn53x_state;
|
||||
NORMAL, // In that case, there is no power saved but the PN53x reacts as fast as possible on the host controller interface.
|
||||
POWERDOWN, // Only on PN532, need to be wake up to process commands with a long preamble
|
||||
LOWVBAT // Only on PN532, need to be wake up to process commands with a long preamble and SAMConfiguration command
|
||||
} pn53x_power_mode;
|
||||
|
||||
struct pn53x_io {
|
||||
bool (*send)(nfc_device_t * pnd, const byte_t * pbtData, const size_t szData);
|
||||
|
|
@ -149,7 +149,7 @@ struct pn53x_io {
|
|||
|
||||
struct pn53x_data {
|
||||
pn53x_type type;
|
||||
pn53x_state state;
|
||||
pn53x_power_mode power_mode;
|
||||
const struct pn53x_io * io;
|
||||
/** 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue