New function nfc_idle() to set the NFC device in idle mode.
nfc_disconnect() now switch NFC device into idle before disconnecting; pn53x_data now have a operating_mode enum to know the current running mode (initiator, target or idle); new pn53x_PowerDown wrapper for PowerDown (PN532) command; Note: ARYGON idle mode now to be implemented and ACR122 does not support this mode.
This commit is contained in:
@@ -427,5 +427,6 @@ const struct nfc_driver_t acr122_driver = {
|
||||
.configure = pn53x_configure,
|
||||
|
||||
.abort_command = NULL,
|
||||
.idle = NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -494,5 +494,7 @@ const struct nfc_driver_t arygon_driver = {
|
||||
.configure = pn53x_configure,
|
||||
|
||||
.abort_command = arygon_abort_command,
|
||||
// FIXME Implement me
|
||||
.idle = NULL,
|
||||
};
|
||||
|
||||
|
||||
@@ -444,5 +444,6 @@ const struct nfc_driver_t pn532_uart_driver = {
|
||||
.configure = pn53x_configure,
|
||||
|
||||
.abort_command = pn532_uart_abort_command,
|
||||
.idle = pn53x_idle,
|
||||
};
|
||||
|
||||
|
||||
@@ -341,16 +341,17 @@ error:
|
||||
void
|
||||
pn53x_usb_disconnect (nfc_device_t * pnd)
|
||||
{
|
||||
int res;
|
||||
|
||||
pn53x_usb_ack (pnd);
|
||||
|
||||
pn53x_idle (pnd);
|
||||
|
||||
if (DRIVER_DATA (pnd)->model == ASK_LOGO) {
|
||||
/* Set P30, P31, P32, P33, P35 to logic 1 and P34 to 0 logic */
|
||||
/* ie. Switch all LEDs off and turn off progressive field */
|
||||
pn53x_write_register (pnd, SFR_P3, 0xFF, _BV (P30) | _BV (P31) | _BV (P32) | _BV (P33) | _BV (P35));
|
||||
}
|
||||
|
||||
int res;
|
||||
if ((res = usb_release_interface (DRIVER_DATA (pnd)->pudh, 0)) < 0) {
|
||||
ERR ("usb_release_interface failed (%i)", res);
|
||||
}
|
||||
@@ -654,4 +655,5 @@ const struct nfc_driver_t pn53x_usb_driver = {
|
||||
.configure = pn53x_usb_configure,
|
||||
|
||||
.abort_command = pn53x_usb_abort_command,
|
||||
.idle = pn53x_idle,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user