Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/LoRa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define REG_FIFO_RX_CURRENT_ADDR 0x10
#define REG_IRQ_FLAGS 0x12
#define REG_RX_NB_BYTES 0x13
#define REG_MODEM_STAT 0x18
#define REG_PKT_SNR_VALUE 0x19
#define REG_PKT_RSSI_VALUE 0x1a
#define REG_RSSI_VALUE 0x1b
Expand Down Expand Up @@ -290,6 +291,10 @@ long LoRaClass::packetFrequencyError()
return static_cast<long>(fError);
}

bool LoRaClass::rxSignalDetected() {
return (readRegister(REG_MODEM_STAT) & 0x01) == 0x01;
}

int LoRaClass::rssi()
{
return (readRegister(REG_RSSI_VALUE) - (_frequency < RF_MID_BAND_THRESHOLD ? RSSI_OFFSET_LF_PORT : RSSI_OFFSET_HF_PORT));
Expand Down
1 change: 1 addition & 0 deletions src/LoRa.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class LoRaClass : public Stream {
int packetRssi();
float packetSnr();
long packetFrequencyError();
bool rxSignalDetected();

int rssi();

Expand Down