Skip to content

Commit b6ff65c

Browse files
authored
Merge pull request #6 from ArbiGunbardhi/main
Added support for ST25R3916B component
2 parents 3896be9 + f9e3711 commit b6ff65c

4 files changed

Lines changed: 15 additions & 15 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: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -478,24 +478,19 @@ 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) {
488-
return false;
489-
}
490-
491-
if (rev != NULL) {
492-
*rev = (ID & ST25R3916_REG_IC_IDENTITY_ic_rev_mask);
486+
if (rev) {
487+
*rev = (id & ST25R3916_REG_IC_IDENTITY_ic_rev_mask);
493488
}
494489

495-
return true;
490+
return (chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 ||
491+
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b);
496492
}
497493

498-
499494
/*******************************************************************************/
500495
ReturnCode RfalRfST25R3916Class::st25r3916GetRegsDump(t_st25r3916Regs *regDump)
501496
{

src/st25r3916_com.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@
974974
#define ST25R3916_REG_IC_IDENTITY_ic_type1 (1U<<4)
975975
#define ST25R3916_REG_IC_IDENTITY_ic_type0 (1U<<3)
976976
#define ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 (5U<<3)
977+
#define ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b (6U<<3)
977978
#define ST25R3916_REG_IC_IDENTITY_ic_type_mask (0x1fU<<3)
978979
#define ST25R3916_REG_IC_IDENTITY_ic_type_shift (3U)
979980
#define ST25R3916_REG_IC_IDENTITY_ic_rev2 (1U<<2)

0 commit comments

Comments
 (0)