kopia lustrzana https://github.com/jgromes/RadioLib
Better docs + preambleLength in begin()
rodzic
53893a6fe1
commit
13cb93495d
|
@ -8,7 +8,7 @@ CC1101::CC1101(Module* module) : PhysicalLayer(CC1101_CRYSTAL_FREQ, CC1101_DIV_E
|
|||
_syncWordLength = CC1101_DEFAULT_SYNC_WORD_LENGTH;
|
||||
}
|
||||
|
||||
int16_t CC1101::begin(float freq, float br, float rxBw, float freqDev, int8_t power) {
|
||||
int16_t CC1101::begin(float freq, float br, float rxBw, float freqDev, int8_t power, uint8_t preambleLength) {
|
||||
// set module properties
|
||||
_mod->SPIreadCommand = CC1101_CMD_READ;
|
||||
_mod->SPIwriteCommand = CC1101_CMD_WRITE;
|
||||
|
@ -88,6 +88,12 @@ int16_t CC1101::begin(float freq, float br, float rxBw, float freqDev, int8_t po
|
|||
return(state);
|
||||
}
|
||||
|
||||
// configure default preamble lenght
|
||||
state = setPreambleLength(preambleLength);
|
||||
if (state != ERR_NONE) {
|
||||
return(state);
|
||||
}
|
||||
|
||||
// flush FIFOs
|
||||
SPIsendCommand(CC1101_CMD_FLUSH_RX);
|
||||
SPIsendCommand(CC1101_CMD_FLUSH_TX);
|
||||
|
|
|
@ -533,9 +533,11 @@ class CC1101: public PhysicalLayer {
|
|||
|
||||
\param power Output power in dBm. Defaults to 0 dBm.
|
||||
|
||||
\param preambleLength Preamble Length in bytes. Defaults to 4 bytes.
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(float freq = 868.0, float br = 4.8, float rxBw = 325.0, float freqDev = 48.0, int8_t power = 0);
|
||||
int16_t begin(float freq = 868.0, float br = 4.8, float rxBw = 325.0, float freqDev = 48.0, int8_t power = 0, uint8_t preambleLength = 4);
|
||||
|
||||
/*!
|
||||
\brief Blocking binary transmit method.
|
||||
|
@ -719,7 +721,7 @@ class CC1101: public PhysicalLayer {
|
|||
/*!
|
||||
\brief Sets preamble length.
|
||||
|
||||
\param preambleLength Preamble length to be set, allowed values: 2, 3, 4, 6, 8, 12, 16, 24
|
||||
\param preambleLength Preamble length to be set (in bytes), allowed values: 2, 3, 4, 6, 8, 12, 16, 24
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
|
|
Ładowanie…
Reference in New Issue