Skip to content

Commit ca5bcf4

Browse files
author
Arbi Gunbardhi
committed
Added support for ST25R3916B component
1 parent 3896be9 commit ca5bcf4

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ST25R3916
22

3-
The code implements the RF/NFC abstraction layer (RFAL) APIs for the ST25R3916 component.
3+
The code implements the RF/NFC abstraction layer (RFAL) APIs for the ST25R3916 and ST25R3916B components.
44

55
# Dependencies
66

@@ -16,3 +16,7 @@ https://github.com/stm32duino/ST25R3916
1616
The ST25R3916 datasheet is available at
1717
https://www.st.com/en/nfc/st25r3916.html
1818

19+
The ST25R3916B datasheet is available at
20+
https://www.st.com/en/nfc/st25r3916b.html
21+
22+

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name=STM32duino ST25R3916
2-
version=1.0.2
2+
version=1.1.0
33
author=STMicroelectronics
44
maintainer=stm32duino
5-
sentence=Allows controlling the ST ST25R3916 component
5+
sentence=Allows controlling the ST ST25R3916 and ST25R3916B components
66
paragraph=This library provides an implementation of the NFC RFAL for ST25R3916 component
77
category=Communication
88
url=https://github.com/stm32duino/ST25R3916

src/st25r3916.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,24 +478,26 @@ ReturnCode RfalRfST25R3916Class::st25r3916SetStartGPTimer(uint16_t gpt_8fcs, uin
478478
/*******************************************************************************/
479479
bool RfalRfST25R3916Class::st25r3916CheckChipID(uint8_t *rev)
480480
{
481-
uint8_t ID;
481+
uint8_t id;
482+
st25r3916ReadRegister(ST25R3916_REG_IC_IDENTITY, &id);
482483

483-
ID = 0;
484-
st25r3916ReadRegister(ST25R3916_REG_IC_IDENTITY, &ID);
484+
const uint8_t chipId = id & ST25R3916_REG_IC_IDENTITY_ic_type_mask;
485485

486-
/* Check if IC Identity Register contains ST25R3916's IC type code */
487-
if ((ID & ST25R3916_REG_IC_IDENTITY_ic_type_mask) != ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916) {
486+
const bool isChipIdValid =
487+
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 ||
488+
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b;
489+
490+
if (!isChipIdValid) {
488491
return false;
489492
}
490493

491-
if (rev != NULL) {
492-
*rev = (ID & ST25R3916_REG_IC_IDENTITY_ic_rev_mask);
494+
if (rev) {
495+
*rev = (id & ST25R3916_REG_IC_IDENTITY_ic_rev_mask);
493496
}
494497

495498
return true;
496499
}
497500

498-
499501
/*******************************************************************************/
500502
ReturnCode RfalRfST25R3916Class::st25r3916GetRegsDump(t_st25r3916Regs *regDump)
501503
{

0 commit comments

Comments
 (0)