Skip to content

Commit 9d67ff2

Browse files
authored
Merge pull request #3 from cparata/main
Fix issue with I2C mode
2 parents 13683dd + c792942 commit 9d67ff2

5 files changed

Lines changed: 132 additions & 45 deletions

File tree

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=STM32duino ST25R3916
2-
version=1.0.0
2+
version=1.0.1
33
author=STMicroelectronics
44
maintainer=stm32duino
55
sentence=Allows controlling the ST ST25R3916 component

src/rfal_rfst25r3916.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ RfalRfST25R3916Class::RfalRfST25R3916Class(SPIClass *spi, int cs_pin, int int_pi
4848
timerStopwatchTick = 0;
4949
i2c_enabled = false;
5050
dev_i2c = NULL;
51+
isr_pending = false;
52+
bus_busy = false;
5153
}
5254

5355
RfalRfST25R3916Class::RfalRfST25R3916Class(TwoWire *i2c, int int_pin) : dev_i2c(i2c), int_pin(int_pin)
@@ -60,6 +62,8 @@ RfalRfST25R3916Class::RfalRfST25R3916Class(TwoWire *i2c, int int_pin) : dev_i2c(
6062
timerStopwatchTick = 0;
6163
i2c_enabled = true;
6264
dev_spi = NULL;
65+
isr_pending = false;
66+
bus_busy = false;
6367
}
6468

6569

@@ -2845,6 +2849,15 @@ ReturnCode RfalRfST25R3916Class::rfalChipMeasurePowerSupply(uint8_t param, uint8
28452849
return ERR_NONE;
28462850
}
28472851

2852+
void RfalRfST25R3916Class::setISRPending(void)
2853+
{
2854+
isr_pending = true;
2855+
}
2856+
2857+
bool RfalRfST25R3916Class::isBusBusy(void)
2858+
{
2859+
return bus_busy;
2860+
}
28482861

28492862

28502863
/*******************************************************************************/

src/rfal_rfst25r3916.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,6 @@ class RfalRfST25R3916Class : public RfalRfClass {
19231923
*/
19241924
ReturnCode st25r3916AatTune(const struct st25r3916AatTuneParams *tuningParams, struct st25r3916AatTuneResult *tuningStatus);
19251925

1926-
19271926
protected:
19281927

19291928
void rfalTransceiveTx(void);
@@ -1950,6 +1949,8 @@ class RfalRfST25R3916Class : public RfalRfClass {
19501949
ReturnCode aatMeasure(uint8_t serCap, uint8_t parCap, uint8_t *amplitude, uint8_t *phase, uint16_t *measureCnt);
19511950
uint32_t aatCalcF(const struct st25r3916AatTuneParams *tuningParams, uint8_t amplitude, uint8_t phase);
19521951
ReturnCode aatStepDacVals(const struct st25r3916AatTuneParams *tuningParams, uint8_t *a, uint8_t *b, int32_t dir);
1952+
void setISRPending(void);
1953+
bool isBusBusy(void);
19531954

19541955
TwoWire *dev_i2c;
19551956
SPIClass *dev_spi;
@@ -1964,6 +1965,8 @@ class RfalRfST25R3916Class : public RfalRfClass {
19641965
volatile st25r3916Interrupt st25r3916interrupt; /*!< Instance of ST25R3916 interrupt */
19651966
uint32_t timerStopwatchTick;
19661967
bool i2c_enabled;
1968+
volatile bool isr_pending;
1969+
volatile bool bus_busy;
19671970
};
19681971

19691972
#ifdef __cplusplus

0 commit comments

Comments
 (0)