Skip to content

Commit

Permalink
chore: added chip model enum
Browse files Browse the repository at this point in the history
  • Loading branch information
REGIOIGER committed Dec 26, 2024
1 parent 9d76097 commit a95cb20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/Electroniccats_PN7150.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ unsigned char DiscoveryTechnologiesP2P[] = { // P2P

Electroniccats_PN7150::Electroniccats_PN7150(uint8_t IRQpin, uint8_t VENpin,
uint8_t I2Caddress,
uint8_t chipModel, TwoWire *wire)
ChipModel chipModel, TwoWire *wire)
: _IRQpin(IRQpin), _VENpin(VENpin), _I2Caddress(I2Caddress),
_chipModel(chipModel), _wire(wire) {
pinMode(_IRQpin, INPUT);

if (_VENpin != 255)
pinMode(_VENpin, OUTPUT);

Expand Down Expand Up @@ -227,8 +228,8 @@ uint8_t Electroniccats_PN7150::connectNCI() {

// Open connection to NXPNCI
// uses setSDA and set SCL with compatible boards
//_wire->setSDA(0); // GPIO 0 como SDA
//_wire->setSCL(1); // GPIO 1 como SCL
_wire->setSDA(0); // GPIO 0 como SDA
_wire->setSCL(1); // GPIO 1 como SCL

// Open connection to NXPNCI
_wire->begin();
Expand Down
10 changes: 5 additions & 5 deletions src/Electroniccats_PN7150.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#include <Wire.h>
#endif

#define PN7150 0
#define PN7160 1

#define NO_PN7150_RESET_PIN 255
/* Following definitions specifies which settings will apply when
* NxpNci_ConfigureSettings() API is called from the application
Expand Down Expand Up @@ -69,6 +66,8 @@
#define MaxPayloadSize 255 // See NCI specification V1.0, section 3.1
#define MsgHeaderSize 3

enum ChipModel { PN7150 = 0, PN7160 = 1 };

/***** Factory Test dedicated APIs
* *********************************************/
#ifdef NFC_FACTORY_TEST
Expand Down Expand Up @@ -98,7 +97,8 @@ typedef enum {
class Electroniccats_PN7150 : public Mode {
private:
bool _hasBeenInitialized;
uint8_t _IRQpin, _VENpin, _I2Caddress, _chipModel;
uint8_t _IRQpin, _VENpin, _I2Caddress;
ChipModel _chipModel;
TwoWire *_wire;
RfIntf_t dummyRfInterface;
uint8_t rxBuffer[MaxPayloadSize +
Expand All @@ -122,7 +122,7 @@ class Electroniccats_PN7150 : public Mode {

public:
Electroniccats_PN7150(uint8_t IRQpin, uint8_t VENpin, uint8_t I2Caddress,
uint8_t chipModel, TwoWire *wire = &Wire);
ChipModel chipModel, TwoWire *wire = &Wire);
uint8_t begin(void);
RemoteDevice remoteDevice;
Protocol protocol;
Expand Down

0 comments on commit a95cb20

Please sign in to comment.