Skip to content

Commit 3685015

Browse files
committed
Add skeleton for firmware update support
1 parent e46d2db commit 3685015

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

PN5180.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@
3838

3939
uint8_t PN5180::readBuffer[508];
4040

41-
PN5180::PN5180(uint8_t SSpin, uint8_t BUSYpin, uint8_t RSTpin) {
42-
PN5180_NSS = SSpin;
43-
PN5180_BUSY = BUSYpin;
44-
PN5180_RST = RSTpin;
41+
PN5180::PN5180(uint8_t SSpin, uint8_t BUSYpin, uint8_t RSTpin)
42+
: PN5180_NSS(SSpin), PN5180_BUSY(BUSYpin), PN5180_RST(RSTpin), PN5180_SPI_SETTINGS(7000000, MSBFIRST, SPI_MODE0) {
4543

4644
/*
4745
* 11.4.1 Physical Host Interface
@@ -50,7 +48,7 @@ PN5180::PN5180(uint8_t SSpin, uint8_t BUSYpin, uint8_t RSTpin) {
5048
* = 0 and CPHA = 0.
5149
*/
5250
// Settings for PN5180: 7Mbps, MSB first, SPI_MODE0 (CPOL=0, CPHA=0)
53-
PN5180_SPI_SETTINGS = SPISettings(7000000, MSBFIRST, SPI_MODE0);
51+
// moved to init list --> PN5180_SPI_SETTINGS = SPISettings(7000000, MSBFIRST, SPI_MODE0);
5452
}
5553

5654
void PN5180::begin() {

PN5180.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ enum PN5180TransceiveStat {
6565
#define RX_SOF_DET_IRQ_STAT (1<<14) // RF SOF Detection IRQ
6666

6767
class PN5180 {
68-
private:
69-
uint8_t PN5180_NSS; // active low
70-
uint8_t PN5180_BUSY;
71-
uint8_t PN5180_RST;
68+
protected:
69+
const uint8_t PN5180_NSS; // active low
70+
const uint8_t PN5180_BUSY;
71+
const uint8_t PN5180_RST;
72+
73+
const SPISettings PN5180_SPI_SETTINGS;
7274

73-
SPISettings PN5180_SPI_SETTINGS;
7475
static uint8_t readBuffer[508];
7576

7677
public:

0 commit comments

Comments
 (0)