Added continual RSSI monitoring for tuned channel
This commit is contained in:
parent
20d3e85c20
commit
2c826fb3dc
13
LoRa.cpp
13
LoRa.cpp
@ -49,6 +49,7 @@
|
||||
#define REG_MODEM_STAT 0x18
|
||||
#define REG_PKT_SNR_VALUE 0x19
|
||||
#define REG_PKT_RSSI_VALUE 0x1a
|
||||
#define REG_RSSI_VALUE 0x1b
|
||||
#define REG_MODEM_CONFIG_1 0x1d
|
||||
#define REG_MODEM_CONFIG_2 0x1e
|
||||
#define REG_PREAMBLE_MSB 0x20
|
||||
@ -239,6 +240,18 @@ uint8_t LoRaClass::modemStatus() {
|
||||
return readRegister(REG_MODEM_STAT);
|
||||
}
|
||||
|
||||
|
||||
uint8_t LoRaClass::currentRssiRaw() {
|
||||
uint8_t rssi = readRegister(REG_RSSI_VALUE);
|
||||
return rssi;
|
||||
}
|
||||
|
||||
int ISR_VECT LoRaClass::currentRssi() {
|
||||
int rssi = (int)readRegister(REG_RSSI_VALUE) - RSSI_OFFSET;
|
||||
if (_frequency < 820E6) rssi -= 7;
|
||||
return rssi;
|
||||
}
|
||||
|
||||
uint8_t LoRaClass::packetRssiRaw() {
|
||||
uint8_t pkt_rssi_value = readRegister(REG_PKT_RSSI_VALUE);
|
||||
return pkt_rssi_value;
|
||||
|
Loading…
Reference in New Issue
Block a user