Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LSatan authored Apr 14, 2020
1 parent bf1dada commit 933020a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 38 deletions.
34 changes: 3 additions & 31 deletions ELECHOUSE_CC1101_SRC_DRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ byte mdcf2;
byte rxbw = 0;
bool ccmode = 0;
float MHz = 433.92;
float CHsp = 405.45;

/****************************************************************/
uint8_t PA_TABLE[8] {0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00};
Expand Down Expand Up @@ -464,34 +463,6 @@ rxbw = r *16;
setCCMode(ccmode);
}
/****************************************************************
*FUNCTION NAME:Channel spacing
*FUNCTION :Channel spacing
*INPUT :none
*OUTPUT :none
****************************************************************/
void ELECHOUSE_CC1101::setChsp(float Chsp){
int mdc0 = 0;
int mdc1 = 0;
CHsp = Chsp;
if (Chsp > 405.456543){Chsp = 405.456543;}
if (Chsp < 25.390625){Chsp = 25.390625;}
for (int i = 0; i<5; i++){
if (Chsp <= 50.682068){
Chsp = Chsp - 25.390625;
Chsp = Chsp / 0.0991825;
mdc0 = Chsp;
float s1 = (Chsp - mdc0) *10;
if (s1 >= 5){mdc0++;}
i = 5;
}else{
mdc1++;
Chsp = Chsp/2;
}
}
SpiWriteReg(CC1101_MDMCFG1, mdc1);
SpiWriteReg(CC1101_MDMCFG0, mdc0);
}
/****************************************************************
*FUNCTION NAME:Set Channel
*FUNCTION :none
*INPUT :none
Expand All @@ -513,8 +484,9 @@ void ELECHOUSE_CC1101::RegConfigSettings(void)

setCCMode(ccmode);
setMHZ(MHz);
setChsp(CHsp);


SpiWriteReg(CC1101_MDMCFG1, 0x03);
SpiWriteReg(CC1101_MDMCFG0, 0xFF);
SpiWriteReg(CC1101_CHANNR, chan);
SpiWriteReg(CC1101_DEVIATN, 0x47);
SpiWriteReg(CC1101_FREND1, 0x56);
Expand Down
1 change: 0 additions & 1 deletion ELECHOUSE_CC1101_SRC_DRV.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class ELECHOUSE_CC1101
void setPA(int p);
void setMHZ(float mhz);
void setRxBW(byte RxBW);
void setChsp(float Chsp);
void setChannel(byte chnl);
void SetTx(void);
void SetRx(void);
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SmartRC-CC1101-Driver-Lib_V2.3.4
# SmartRC-CC1101-Driver-Lib_V2.3.5

NEW Debug Service Tool: https://github.com/LSatan/CC1101-Debug-Service-Tool
NEW Debug Service Tool V1.0: https://github.com/LSatan/CC1101-Debug-Service-Tool

---------------------------------------------
Install:
Expand Down Expand Up @@ -86,7 +86,6 @@ ELECHOUSE_cc1101.setSpiPin(SCK, MISO, MOSI, CSN); //custom SPI pins. Set your ow

ELECHOUSE_cc1101.setChannel(chnl); //Set Channel from 0 to 255. default = 0(basic frequency).

ELECHOUSE_cc1101.setChsp(chsp); //Set cannel spacing from min 25.39khz to max 405.45khz directly like SmartRF Studio.

All can also be used in a loop and are applied directly.

Expand Down Expand Up @@ -115,6 +114,13 @@ https://www.paypal.me/LittleSatan666
Thank You!


---------------------------------------------
Changelog: SmartRC-CC1101-Driver-Lib_V2.3.5
---------------------------------------------
14.04.2020

Driver Library :setChsp has been removed to save space. This function is available in the Service / Debug Tool as an extended function.

---------------------------------------------
Changelog: SmartRC-CC1101-Driver-Lib_V2.3.4
---------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ setModulation KEYWORD2
setPA KEYWORD2
setMHZ KEYWORD2
setRxBW KEYWORD2
setChsp KEYWORD2
setChannel KEYWORD2
SetTx KEYWORD2
SetRx KEYWORD2
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/LSatan/SmartRC-CC1101-Driver-Lib"
},
"version": "2.3.4",
"version": "2.3.5",
"frameworks": [
"arduino"
],
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SmartRC-CC1101-Driver-Lib
version=2.3.4
version=2.3.5
author=LSatan
maintainer=LSatan <littlesatan.666.ls@gmail.com>
sentence=Driver for cc1101.
Expand Down

0 comments on commit 933020a

Please sign in to comment.