From 50512abf62a4b86c457426f142ae05d1faff5aa3 Mon Sep 17 00:00:00 2001 From: LSatan Date: Tue, 6 Apr 2021 16:26:26 +0200 Subject: [PATCH] Add files via upload --- ELECHOUSE_CC1101_SRC_DRV.cpp | 13 +++++++++++++ ELECHOUSE_CC1101_SRC_DRV.h | 1 + README.md | 9 ++++++++- .../cc1101_New_Receive_method_advanced.ino | 1 + ...01_New_Transmitt_method_Hello_World_advanced.ino | 1 + .../cc1101_New_Transmitt_method_Serial_advanced.ino | 1 + .../cc1101_Receive_advanced.ino | 1 + .../cc1101_Transmitt_Hello_World_advanced.ino | 1 + .../cc1101_Transmitt_Serial_advanced.ino | 1 + keywords.txt | 1 + library.json | 2 +- library.properties | 2 +- 12 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ELECHOUSE_CC1101_SRC_DRV.cpp b/ELECHOUSE_CC1101_SRC_DRV.cpp index beba2ae..31fcc13 100644 --- a/ELECHOUSE_CC1101_SRC_DRV.cpp +++ b/ELECHOUSE_CC1101_SRC_DRV.cpp @@ -727,6 +727,19 @@ if (v==1){m1FEC=128;} SpiWriteReg(CC1101_MDMCFG1, m1FEC+m1PRE+m1CHSP); } /**************************************************************** +*FUNCTION NAME:Set PRE +*FUNCTION :Sets the minimum number of preamble bytes to be transmitted. +*INPUT :none +*OUTPUT :none +****************************************************************/ +void ELECHOUSE_CC1101::setPRE(byte v){ +Split_MDMCFG1(); +m1PRE=0; +if (v>7){v=7;} +m1PRE = v*16; +SpiWriteReg(CC1101_MDMCFG1, m1FEC+m1PRE+m1CHSP); +} +/**************************************************************** *FUNCTION NAME:Set Channel *FUNCTION :none *INPUT :none diff --git a/ELECHOUSE_CC1101_SRC_DRV.h b/ELECHOUSE_CC1101_SRC_DRV.h index 3ce940e..b79664b 100644 --- a/ELECHOUSE_CC1101_SRC_DRV.h +++ b/ELECHOUSE_CC1101_SRC_DRV.h @@ -175,6 +175,7 @@ class ELECHOUSE_CC1101 void setManchester(bool v); void setSyncMode(byte v); void setFEC(bool v); + void setPRE(byte v); void setPQT(byte v); void setCRC_AF(bool v); void setAppendStatus(bool v); diff --git a/README.md b/README.md index 8e8a2dd..2bc52b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SmartRC-CC1101-Driver-Lib_V2.5.5 +# SmartRC-CC1101-Driver-Lib_V2.5.6 ![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/LSatan/SmartRC-CC1101-Driver-Lib) @@ -134,6 +134,13 @@ https://www.paypal.me/LittleSatan666 Thank You! +--------------------------------------------- +Changelog: SmartRC-CC1101-Driver-Lib_V2.5.6 +--------------------------------------------- +06.04.2021 + +Driver Library :Add NUM_PREAMBLE. Sets the minimum number of preamble bytes to be transmitted. + --------------------------------------------- Changelog: SmartRC-CC1101-Driver-Lib_V2.5.5 --------------------------------------------- diff --git a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Receive_method_advanced/cc1101_New_Receive_method_advanced.ino b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Receive_method_advanced/cc1101_New_Receive_method_advanced.ino index d7a3e3e..612a89b 100644 --- a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Receive_method_advanced/cc1101_New_Receive_method_advanced.ino +++ b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Receive_method_advanced/cc1101_New_Receive_method_advanced.ino @@ -37,6 +37,7 @@ void setup(){ ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Hello_World_advanced/cc1101_New_Transmitt_method_Hello_World_advanced.ino b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Hello_World_advanced/cc1101_New_Transmitt_method_Hello_World_advanced.ino index f78d50a..d83024e 100644 --- a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Hello_World_advanced/cc1101_New_Transmitt_method_Hello_World_advanced.ino +++ b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Hello_World_advanced/cc1101_New_Transmitt_method_Hello_World_advanced.ino @@ -40,6 +40,7 @@ void setup() { ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Serial_advanced/cc1101_New_Transmitt_method_Serial_advanced.ino b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Serial_advanced/cc1101_New_Transmitt_method_Serial_advanced.ino index 4675524..c1ca76f 100644 --- a/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Serial_advanced/cc1101_New_Transmitt_method_Serial_advanced.ino +++ b/examples/CC1101 default examples/New_Method_without_GDO/cc1101_New_Transmitt_method_Serial_advanced/cc1101_New_Transmitt_method_Serial_advanced.ino @@ -41,6 +41,7 @@ void setup() { ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Receive_advanced/cc1101_Receive_advanced.ino b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Receive_advanced/cc1101_Receive_advanced.ino index c9d9408..877c5fd 100644 --- a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Receive_advanced/cc1101_Receive_advanced.ino +++ b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Receive_advanced/cc1101_Receive_advanced.ino @@ -47,6 +47,7 @@ gdo0 = 6; // for Arduino! GDO0 on pin 6. ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Hello_World_advanced/cc1101_Transmitt_Hello_World_advanced.ino b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Hello_World_advanced/cc1101_Transmitt_Hello_World_advanced.ino index af8c287..6a87ace 100644 --- a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Hello_World_advanced/cc1101_Transmitt_Hello_World_advanced.ino +++ b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Hello_World_advanced/cc1101_Transmitt_Hello_World_advanced.ino @@ -50,6 +50,7 @@ gdo0 = 6; // for Arduino! GDO0 on pin 6. ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Serial_advanced/cc1101_Transmitt_Serial_advanced.ino b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Serial_advanced/cc1101_Transmitt_Serial_advanced.ino index f98f323..33d1a4c 100644 --- a/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Serial_advanced/cc1101_Transmitt_Serial_advanced.ino +++ b/examples/CC1101 default examples/Old_Method_with_GDO/cc1101_Transmitt_Serial_advanced/cc1101_Transmitt_Serial_advanced.ino @@ -51,6 +51,7 @@ gdo0 = 6; // for Arduino! GDO0 on pin 6. ELECHOUSE_cc1101.setDcFilterOff(0); // Disable digital DC blocking filter before demodulator. Only for data rates ≤ 250 kBaud The recommended IF frequency changes when the DC blocking is disabled. 1 = Disable (current optimized). 0 = Enable (better sensitivity). ELECHOUSE_cc1101.setManchester(0); // Enables Manchester encoding/decoding. 0 = Disable. 1 = Enable. ELECHOUSE_cc1101.setFEC(0); // Enable Forward Error Correction (FEC) with interleaving for packet payload (Only supported for fixed packet length mode. 0 = Disable. 1 = Enable. + ELECHOUSE_cc1101.setPRE(0); // Sets the minimum number of preamble bytes to be transmitted. Values: 0 : 2, 1 : 3, 2 : 4, 3 : 6, 4 : 8, 5 : 12, 6 : 16, 7 : 24 ELECHOUSE_cc1101.setPQT(0); // Preamble quality estimator threshold. The preamble quality estimator increases an internal counter by one each time a bit is received that is different from the previous bit, and decreases the counter by 8 each time a bit is received that is the same as the last bit. A threshold of 4∙PQT for this counter is used to gate sync word detection. When PQT=0 a sync word is always accepted. ELECHOUSE_cc1101.setAppendStatus(0); // When enabled, two status bytes will be appended to the payload of the packet. The status bytes contain RSSI and LQI values, as well as CRC OK. diff --git a/keywords.txt b/keywords.txt index f95f1cc..3939dfc 100644 --- a/keywords.txt +++ b/keywords.txt @@ -46,5 +46,6 @@ setCRC_AF KEYWORD2 setDcFilterOff KEYWORD2 setManchester KEYWORD2 setFEC KEYWORD2 +setPRE KEYWORD2 setPQT KEYWORD2 setAppendStatus KEYWORD2 \ No newline at end of file diff --git a/library.json b/library.json index e8c690e..21a062d 100644 --- a/library.json +++ b/library.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/LSatan/SmartRC-CC1101-Driver-Lib" }, - "version": "2.5.5", + "version": "2.5.6", "frameworks": [ "arduino" ], diff --git a/library.properties b/library.properties index 8ec5cd2..41d64cf 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SmartRC-CC1101-Driver-Lib -version=2.5.5 +version=2.5.6 author=LSatan maintainer=LSatan sentence=Driver for cc1101.