Merge pull request #401 from cpainchaud/master

RF69 and SX127X new functions
pull/406/head
Jan Gromeš 2021-11-14 12:52:15 +01:00 zatwierdzone przez GitHub
commit 70b6166e15
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 78 dodań i 3 usunięć

Wyświetl plik

@ -147,6 +147,8 @@ setOokFixedOrFloorThreshold KEYWORD2
setDirectSyncWord KEYWORD2
setDirectAction KEYWORD2
readBit KEYWORD2
enableBitSync KEYWORD2
disableBitSync KEYWORD2
# RF69-specific
setAESKey KEYWORD2
@ -154,7 +156,10 @@ enableAES KEYWORD2
disableAES KEYWORD2
getTemperature KEYWORD2
setAmbientTemperature KEYWORD2
setLnaTestBoost KEYWORD2
setLnaTestBoost KEYWORD2
setOokFixedThreshold KEYWORD2
enableContinuousModeBitSync KEYWORD2
disableContinuousModeBitSync KEYWORD2
# CC1101-specific
getLQI KEYWORD2

Wyświetl plik

@ -388,6 +388,14 @@ int16_t RF69::setOokThresholdType(uint8_t type) {
return(_mod->SPIsetRegValue(RF69_REG_OOK_PEAK, type, 7, 3, 5));
}
int16_t RF69::setOokFixedThreshold(uint8_t value) {
return(_mod->SPIsetRegValue(RF69_REG_OOK_FIX, value, 7, 0, 5));
}
int16_t RF69::setOokPeakThresholdDecrement(uint8_t value) {
return(_mod->SPIsetRegValue(RF69_REG_OOK_PEAK, value, 2, 0, 5));
}
int16_t RF69::setFrequency(float freq) {
// check allowed frequency range
if(!(((freq > 290.0) && (freq < 340.0)) ||
@ -712,6 +720,14 @@ int16_t RF69::disableSyncWordFiltering() {
return(state);
}
int16_t RF69::enableContinuousModeBitSync() {
return(_mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_CONTINUOUS_MODE_WITH_SYNC, 6, 5));
}
int16_t RF69::disableContinuousModeBitSync() {
return(_mod->SPIsetRegValue(RF69_REG_DATA_MODUL, RF69_CONTINUOUS_MODE, 6, 5));
}
int16_t RF69::setCrcFiltering(bool crcOn) {
if (crcOn == true) {
return(_mod->SPIsetRegValue(RF69_REG_PACKET_CONFIG_1, RF69_CRC_ON, 4, 4));

Wyświetl plik

@ -757,6 +757,24 @@ class RF69: public PhysicalLayer {
*/
int16_t setOokThresholdType(uint8_t type);
/*!
\brief Fixed threshold for the Data Slicer in OOK mode or floor threshold for the Data Slicer in OOK when Peak mode is used.
\param value Fixed threshold value (in dB) in the OOK demodulator. Used when OokThresType = RF69_OOK_THRESH_FIXED.
\returns \ref status_codes
*/
int16_t setOokFixedThreshold(uint8_t value);
/*!
\brief Period of decrement of the RSSI threshold in the OOK demodulator.
\param value Use defines RF69_OOK_PEAK_THRESH_DEC_X_X_CHIP
\returns \ref status_codes
*/
int16_t setOokPeakThresholdDecrement(uint8_t value);
/*!
\brief Set modem in fixed packet length mode.
@ -791,6 +809,20 @@ class RF69: public PhysicalLayer {
*/
int16_t disableSyncWordFiltering();
/*!
\brief Enable Bit synchronization in continuous mode.
\returns \ref status_codes
*/
int16_t enableContinuousModeBitSync();
/*!
\brief Disable Bit synchronization in continuous mode.
\returns \ref status_codes
*/
int16_t disableContinuousModeBitSync();
/*!
\brief Enable CRC filtering and generation.

Wyświetl plik

@ -939,6 +939,14 @@ int16_t SX127x::setOokPeakThresholdDecrement(uint8_t value) {
return(_mod->SPIsetRegValue(SX127X_REG_OOK_AVG, value, 7, 5, 5));
}
int16_t SX127x::enableBitSync() {
return(_mod->SPIsetRegValue(SX127X_REG_OOK_PEAK, SX127X_BIT_SYNC_ON, 5, 5, 5));
}
int16_t SX127x::disableBitSync() {
return(_mod->SPIsetRegValue(SX127X_REG_OOK_PEAK, SX127X_BIT_SYNC_OFF, 5, 5, 5));
}
int16_t SX127x::setOOK(bool enableOOK) {
// check active modem
if(getActiveModem() != SX127X_FSK_OOK) {

Wyświetl plik

@ -921,13 +921,27 @@ class SX127x: public PhysicalLayer {
/*!
\brief Fixed threshold for the Data Slicer in OOK mode or floor threshold for the Data Slicer in OOK when Peak mode is used.
\param value The actual value used by teh data slicer is (128 - value/2).
\param value The actual value is devided by 2 because (0.5db step). ie: value=12 means 6dB
\returns \ref status_codes
*/
int16_t setOokFixedOrFloorThreshold(uint8_t value);
/*!
/*!
\brief Enable Bit synchronizer.
\returns \ref status_codes
*/
int16_t enableBitSync();
/*!
\brief Disable Bit synchronizer (not allowed in Packet mode).
\returns \ref status_codes
*/
int16_t disableBitSync();
/*!
\brief Query modem for the packet length of received payload.
\param update Update received packet length. Will return cached value when set to false.