Skip to content

Commit

Permalink
Merge pull request #18 from cparata/main
Browse files Browse the repository at this point in the history
Give the possibility to have LPD pin optional
  • Loading branch information
cparata authored Oct 6, 2022
2 parents d5356dd + c762fac commit 3b1ff68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=STM32duino ST25DV
version=1.0.3
version=1.1.0
author=STMicroelectronics
maintainer=stm32duino
sentence=Allows controlling the NFC ST25DV
Expand Down
8 changes: 5 additions & 3 deletions src/ST25DVSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NFCTAG_StatusTypeDef ST25DV_IO_Read(uint8_t *const pData, const uint8_t DevAddr,
NFCTAG_StatusTypeDef ST25DV_IO_IsDeviceReady(const uint8_t DevAddr, const uint32_t Trials);
NFCTAG_StatusTypeDef NFCTAG_ConvertStatus(uint8_t ret);

int ST25DV::begin(uint8_t gpo, uint8_t lpd, TwoWire *pwire)
int ST25DV::begin(int32_t gpo, int32_t lpd, TwoWire *pwire)
{
int ret = NDEF_OK;

Expand Down Expand Up @@ -129,8 +129,10 @@ uint8_t ST25DV::ST25DV_GPO_ReadPin(void)
*/
void ST25DV::ST25DV_LPD_Init(void)
{
pinMode(_lpd, OUTPUT);
digitalWrite(_lpd, LOW);
if(_lpd > 0) {
pinMode(_lpd, OUTPUT);
digitalWrite(_lpd, LOW);
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/ST25DVSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef enum {
class ST25DV {
public:
ST25DV(void);
int begin(uint8_t gpo, uint8_t ldp, TwoWire *pwire = &WIRE);
int begin(int32_t gpo, int32_t ldp, TwoWire *pwire = &WIRE);
int writeURI(String protocol, String uri, String info);
int readURI(String *s);

Expand All @@ -72,8 +72,8 @@ class ST25DV {
TwoWire *_pwire;

private:
uint8_t _gpo;
uint8_t _lpd;
int32_t _gpo;
int32_t _lpd;
};

extern ST25DV st25dv;
Expand Down

0 comments on commit 3b1ff68

Please sign in to comment.