Fix RFM95 driver (RPi) (#800)
This commit is contained in:
committed by
Embedded Innovation
parent
cde5d8f7c3
commit
63b8d935c8
@@ -55,7 +55,7 @@ LOCAL uint8_t RFM95_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_
|
|||||||
*ptx++ = cmd;
|
*ptx++ = cmd;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
if (aReadMode) {
|
if (aReadMode) {
|
||||||
*ptx++ = RF24_NOP;
|
*ptx++ = (uint8_t)RFM95_NOP;
|
||||||
} else {
|
} else {
|
||||||
*ptx++ = *current++;
|
*ptx++ = *current++;
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ LOCAL uint8_t RFM95_spiMultiByteTransfer(const uint8_t cmd, uint8_t* buf, uint8_
|
|||||||
status = _SPI.transfer(cmd);
|
status = _SPI.transfer(cmd);
|
||||||
while (len--) {
|
while (len--) {
|
||||||
if (aReadMode) {
|
if (aReadMode) {
|
||||||
status = _SPI.transfer((uint8_t)0x00);
|
status = _SPI.transfer((uint8_t)RFM95_NOP);
|
||||||
if (buf != NULL) {
|
if (buf != NULL) {
|
||||||
*current++ = status;
|
*current++ = status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
// Register access
|
// Register access
|
||||||
#define RFM95_READ_REGISTER (0x7Fu) //!< reading register
|
#define RFM95_READ_REGISTER (0x7Fu) //!< reading register
|
||||||
#define RFM95_WRITE_REGISTER (0x80u) //!< writing register
|
#define RFM95_WRITE_REGISTER (0x80u) //!< writing register
|
||||||
|
#define RFM95_NOP (0x00u) //!< NOP
|
||||||
|
|
||||||
// Registers, available in LoRa mode
|
// Registers, available in LoRa mode
|
||||||
#define RFM95_REG_00_FIFO 0x00 //!< REG_00_FIFO
|
#define RFM95_REG_00_FIFO 0x00 //!< REG_00_FIFO
|
||||||
|
|||||||
Reference in New Issue
Block a user