pn53x drivers: fix timer corrections location
This commit is contained in:
parent
fb398c387f
commit
93de7fcd5c
2 changed files with 16 additions and 16 deletions
|
@ -115,14 +115,6 @@ arygon_probe (nfc_device_desc_t pnddDevices[], size_t szDevices, size_t * pszDev
|
||||||
CHIP_DATA (pnd)->type = PN532;
|
CHIP_DATA (pnd)->type = PN532;
|
||||||
CHIP_DATA (pnd)->state = NORMAL;
|
CHIP_DATA (pnd)->state = NORMAL;
|
||||||
CHIP_DATA (pnd)->io = &arygon_tama_io;
|
CHIP_DATA (pnd)->io = &arygon_tama_io;
|
||||||
// Timer stops only after 5 bits are received => 5*128 cycles
|
|
||||||
// When sent ...ZY (cmd ends with logical 0):
|
|
||||||
// TODO: calibration
|
|
||||||
// 50: empirical tuning
|
|
||||||
CHIP_DATA (pnd)->timer_correction_zy = 50 - (5 * 128);
|
|
||||||
// When sent ...YY (cmd ends with logical 1):
|
|
||||||
// a ...ZY signal finishes 64us later than a ...YY signal
|
|
||||||
CHIP_DATA (pnd)->timer_correction_yy = CHIP_DATA (pnd)->timer_correction_zy + 64;
|
|
||||||
|
|
||||||
bool res = arygon_reset_tama (pnd);
|
bool res = arygon_reset_tama (pnd);
|
||||||
nfc_device_free (pnd);
|
nfc_device_free (pnd);
|
||||||
|
@ -183,6 +175,14 @@ arygon_connect (const nfc_device_desc_t * pndd)
|
||||||
// The PN53x chip connected to ARYGON MCU doesn't seems to be in SLEEP mode
|
// The PN53x chip connected to ARYGON MCU doesn't seems to be in SLEEP mode
|
||||||
CHIP_DATA (pnd)->state = NORMAL;
|
CHIP_DATA (pnd)->state = NORMAL;
|
||||||
CHIP_DATA (pnd)->io = &arygon_tama_io;
|
CHIP_DATA (pnd)->io = &arygon_tama_io;
|
||||||
|
// Timer stops only after 5 bits are received => 5*128 cycles
|
||||||
|
// When sent ...ZY (cmd ends with logical 0):
|
||||||
|
// TODO: calibration
|
||||||
|
// 50: empirical tuning
|
||||||
|
CHIP_DATA (pnd)->timer_correction_zy = 50 - (5 * 128);
|
||||||
|
// When sent ...YY (cmd ends with logical 1):
|
||||||
|
// a ...ZY signal finishes 64us later than a ...YY signal
|
||||||
|
CHIP_DATA (pnd)->timer_correction_yy = CHIP_DATA (pnd)->timer_correction_zy + 64;
|
||||||
pnd->driver = &arygon_driver;
|
pnd->driver = &arygon_driver;
|
||||||
|
|
||||||
// Check communication using "Reset TAMA" command
|
// Check communication using "Reset TAMA" command
|
||||||
|
|
|
@ -96,14 +96,6 @@ pn532_uart_probe (nfc_device_desc_t pnddDevices[], size_t szDevices, size_t * ps
|
||||||
CHIP_DATA (pnd)->type = PN532;
|
CHIP_DATA (pnd)->type = PN532;
|
||||||
CHIP_DATA (pnd)->state = SLEEP;
|
CHIP_DATA (pnd)->state = SLEEP;
|
||||||
CHIP_DATA (pnd)->io = &pn532_uart_io;
|
CHIP_DATA (pnd)->io = &pn532_uart_io;
|
||||||
// Timer stops only after 5 bits are received => 5*128 cycles
|
|
||||||
// When sent ...ZY (cmd ends with logical 0):
|
|
||||||
// TODO: calibration
|
|
||||||
// 50: empirical tuning
|
|
||||||
CHIP_DATA (pnd)->timer_correction_zy = 50 - (5 * 128);
|
|
||||||
// When sent ...YY (cmd ends with logical 1):
|
|
||||||
// a ...ZY signal finishes 64us later than a ...YY signal
|
|
||||||
CHIP_DATA (pnd)->timer_correction_yy = CHIP_DATA (pnd)->timer_correction_zy + 64;
|
|
||||||
|
|
||||||
// Check communication using "Diagnose" command, with "Communication test" (0x00)
|
// Check communication using "Diagnose" command, with "Communication test" (0x00)
|
||||||
bool res = pn53x_check_communication (pnd);
|
bool res = pn53x_check_communication (pnd);
|
||||||
|
@ -168,6 +160,14 @@ pn532_uart_connect (const nfc_device_desc_t * pndd)
|
||||||
CHIP_DATA(pnd)->type = PN532;
|
CHIP_DATA(pnd)->type = PN532;
|
||||||
CHIP_DATA(pnd)->state = SLEEP;
|
CHIP_DATA(pnd)->state = SLEEP;
|
||||||
CHIP_DATA(pnd)->io = &pn532_uart_io;
|
CHIP_DATA(pnd)->io = &pn532_uart_io;
|
||||||
|
// Timer stops only after 5 bits are received => 5*128 cycles
|
||||||
|
// When sent ...ZY (cmd ends with logical 0):
|
||||||
|
// TODO: calibration
|
||||||
|
// 50: empirical tuning
|
||||||
|
CHIP_DATA (pnd)->timer_correction_zy = 50 - (5 * 128);
|
||||||
|
// When sent ...YY (cmd ends with logical 1):
|
||||||
|
// a ...ZY signal finishes 64us later than a ...YY signal
|
||||||
|
CHIP_DATA (pnd)->timer_correction_yy = CHIP_DATA (pnd)->timer_correction_zy + 64;
|
||||||
pnd->driver = &pn532_uart_driver;
|
pnd->driver = &pn532_uart_driver;
|
||||||
|
|
||||||
// Check communication using "Diagnose" command, with "Communication test" (0x00)
|
// Check communication using "Diagnose" command, with "Communication test" (0x00)
|
||||||
|
|
Loading…
Reference in a new issue