Driver for TI's CC1200 radio ICs. Forget hardcoded register settings -- this driver calculates everything from scratch!

Dependents:   CC1200-MorseEncoder CC1200-Examples

Embed: (wiki syntax)

« Back to documentation index

CC1200 Class Reference

CC1200 Class Reference

Base driver for the CC1200 radio communications IC. More...

#include <CC1200.h>

Public Types

enum  GPIOMode
 

Enum for all possible GPIO modes.

More...
enum  PacketMode { INFINITE_LENGTH = 0b10, VARIABLE_LENGTH = 0b1, FIXED_LENGTH = 0b0 }
enum  IFCfg
 

Possible intermediate frequency values.

More...
enum  SyncMode
 

Mode describing the size and setup of the sync word.

More...
enum  RampTime
 

Enum for different PA ramp times.

More...
enum  SyncBehavior
 

Enum for possible AGC actions after is a sync word detection.

More...
enum  GainTable
 

Enum for possible gain tables to use.

More...

Public Member Functions

 CC1200 (PinName mosiPin, PinName misoPin, PinName sclkPin, PinName csPin, PinName rstPin, Stream *_debugStream, bool _isCC1201=false)
 Construct a CC1200 radio driver from the given set of pins.
bool begin ()
 Reset the chip and attempt to connect to it.
State getState ()
 Get the radio's most recently known state.
size_t getTXFIFOLen ()
 Get the number of bytes currently in the TX FIFO.
size_t getRXFIFOLen ()
 Get the number of bytes currently in the RX FIFO.
bool enqueuePacket (char const *data, size_t len)
 Enqueue a packet to be sent over the radio.
bool hasReceivedPacket ()
 Check whether there is at least one complete packet in the RX FIFO.
size_t receivePacket (char *buffer, size_t bufferLen)
 Receive a packet from the radio.
size_t writeStream (const char *buffer, size_t count)
 Write a stream of data to the chip.
bool writeStreamBlocking (const char *buffer, size_t count)
 Write a stream of data to the chip.
size_t readStream (char *buffer, size_t maxLen)
 Read up to maxLen bytes into buffer.
bool readStreamBlocking (char *buffer, size_t count, std::chrono::microseconds timeout=0us)
 Read a stream of data from the chip.
void setOnReceiveState (State goodPacket, State badPacket)
 Set what state the radio will enter when a packet is received.
void setOnTransmitState (State txState)
 Set what state the radio will enter when a packet is sent.
void setFSCalMode (FSCalMode mode)
 Set when the radio calibrates its frequency synthesizer.
void configureGPIO (uint8_t gpioNumber, GPIOMode mode, bool outputInvert=false)
 Configure a CC1200 GPIO pin.
void configureFIFOMode ()
 Set up the radio for FIFO mode.
void setPacketMode (PacketMode mode, bool appendStatus=false)
 Set the packet mode that the system will use.
void setPacketLength (uint16_t length, uint8_t bitLength=0)
 Set the packet length when in fixed length packet mode.
void setCRCEnabled (bool enabled)
 Set whether the CRC check is enabled.
void setModulationFormat (ModFormat format)
 Set the modulation format of the radio.
void setFSKDeviation (float deviation)
 Set the frequency deviation from the center frequency in Hz.
void setSymbolRate (float symbolRateHz)
 Set the RF symbol rate in Hz.
void setOutputPower (float outPower)
 Set the approximate output power in dBm.
void setASKPowers (float maxPower, float minPower)
 Set the high and low output powers when transmitting in ASK mode.
void setRadioFrequency (Band band, float frequencyHz)
 Set the radio band and specific frequency.
void setRXFilterBandwidth (float bandwidthHz, bool preferHigherCICDec=true)
 Set the the RX filter bandwidth.
uint8_t getADCCICDecimation ()
 Get the ADC CIC decimation that was calculated by the most recent setRXFilterBandwidth() call.
void configureDCFilter (bool enableAutoFilter, uint8_t settlingCfg, uint8_t cutoffCfg)
 Configure the radio's automatic DC offset removal algorithm as enabled.
void setIFCfg (IFCfg value, bool enableIQIC)
 Set the receiver IF mixing configuration.
void configureSyncWord (uint32_t syncWord, SyncMode mode, uint8_t syncThreshold)
 Configure the sync word settings of the radio.
bool isFSLocked ()
 Check whether the frequency synthesizer is locked on to the correct frequency.
void configurePreamble (uint8_t preambleLengthCfg, uint8_t preambleFormatCfg)
 Configure the preamble that the radio is configured to send/receive.
void setPARampRate (uint8_t firstRampLevel, uint8_t secondRampLevel, RampTime rampTime)
 Enable the the power amplifier ramp-up curve and set its shape and time.
void disablePARamping ()
 Disable the power amplifier ramp-up curve.
void setAGCReferenceLevel (uint8_t level)
 Set the AGC reference level which is the internal target power level that the AGC tries to adjust to.
void setAGCSyncBehavior (SyncBehavior behavior)
 Set the AGC behavior after a sync word is detected.
void setAGCGainTable (GainTable table, uint8_t minGainIndex, uint8_t maxGainIndex)
 Set the gain table and min and max values within that table to use.
void setAGCHysteresis (uint8_t hysteresisCfg)
 Configure the change in input signal power that must be sensed before the AGC starts to adjust itself.
void setAGCSlewRate (uint8_t slewrateCfg)
 Configure the rate that the AGC changes the receive gain.
void setAGCSettleWait (uint8_t settleWaitCfg)
 Configure the time that the AGC takes to settle.
int8_t getLastRSSI ()
 Get the RSSI as of the last packet received.
float getRSSIRegister ()
 Get the current RSSI from the RSSI register.
void setRSSIOffset (int8_t adjust)
 Set the RSSI gain adjustment.
uint8_t getLQIRegister ()
 Get the LQI from the LQI_VAL register.
uint8_t getLastLQI ()
 Get the LQI as of the last packet received.
uint8_t readRegister (Register reg)
 Read a register and return the byte value.
void writeRegister (Register reg, uint8_t value)
 Write a register with a byte value.
void writeRegisters (CC1200::Register startReg, uint8_t const *values, size_t numRegisters)
 Write a series of consecutive registers with byte values.
template<size_t numRegisters>
void writeRegisters (CC1200::Register startReg, std::array< uint8_t, numRegisters > const &values)
 Write a series of consecutive registers with byte values.
uint8_t readRegister (ExtRegister reg)
 Read an extended register and return the byte value.
void writeRegister (ExtRegister reg, uint8_t value)
 Write an extended register with a byte value.
void writeRegisters (CC1200::ExtRegister startReg, uint8_t const *values, size_t numRegisters)
 Write a series of consecutive extended registers with byte values.
template<size_t numRegisters>
void writeRegisters (CC1200::ExtRegister startReg, std::array< uint8_t, numRegisters > const &values)
 Write a series of consecutive registers with byte values.
void sendCommand (Command command)
 Send a command.
void updateState ()
 Update the current known state of the radio.
uint8_t readRXFIFOByte (uint8_t address)
 Get a byte from the RX FIFO.
void startTX ()
 Send the STX strobe to change the radio into TX state.
void startRX ()
 Send the SRX strobe to change the radio into TX state.
void idle ()
 Send the radio into idle mode.

Detailed Description

Base driver for the CC1200 radio communications IC.

This class provides basic functions and register level IO with the chip.

Definition at line 17 of file CC1200.h.


Member Enumeration Documentation

enum GainTable

Enum for possible gain tables to use.

See AGC_CFG2 register description for more info.

Definition at line 742 of file CC1200.h.

enum GPIOMode

Enum for all possible GPIO modes.

Note: Some modes do different things depending on which GPIOs they're assigned to. Duplicate enum values have been intentionally defined for this.

Definition at line 409 of file CC1200.h.

enum IFCfg

Possible intermediate frequency values.

For right now it seems like you have to get these from SmartRF. See the user guide section on IF_MIX_CFG.CMIX_CFG for details.

Definition at line 611 of file CC1200.h.

enum PacketMode
Enumerator:
INFINITE_LENGTH 

Use infinite length transmissions (streaming mode).

VARIABLE_LENGTH 

Use fixed length packets.

FIXED_LENGTH 

Use variable length packets, the length is encoded in the first byte of the packet.

Definition at line 437 of file CC1200.h.

enum RampTime

Enum for different PA ramp times.

Definition at line 683 of file CC1200.h.

Enum for possible AGC actions after is a sync word detection.

See AGC_CFG3 register description for more info.

Definition at line 724 of file CC1200.h.

enum SyncMode

Mode describing the size and setup of the sync word.

See user guide register description for SYNC_CFG1

Definition at line 638 of file CC1200.h.


Constructor & Destructor Documentation

CC1200 ( PinName  mosiPin,
PinName  misoPin,
PinName  sclkPin,
PinName  csPin,
PinName  rstPin,
Stream *  _debugStream,
bool  _isCC1201 = false 
)

Construct a CC1200 radio driver from the given set of pins.

Parameters:
misoPin
mosiPin
sclkPin
csPin
rstPin
_debugStreamStream to print error/debug information on.
isCC1201True if the chip is a CC1201, false if it is a CC1200. The CC1201 is a cheaper option that lacks low bandwidth settings but is otherwise identical.

Definition at line 83 of file CC1200.cpp.


Member Function Documentation

bool begin (  )

Reset the chip and attempt to connect to it.

Returns whether the chip could be contacted.

Returns:

Definition at line 93 of file CC1200.cpp.

void configureDCFilter ( bool  enableAutoFilter,
uint8_t  settlingCfg,
uint8_t  cutoffCfg 
)

Configure the radio's automatic DC offset removal algorithm as enabled.

DC offset correction must be enabled when using zero IF mode, and in my testing it seems to be important when staying in TX mode for a long time at higher sample rates.

See the datasheet register description for DCFILT_CFG for explanations of what these values do. Maybe you'll actually be able to make some sense out of what it says... I sure couldn't.

Parameters:
enableAutoFilterWhether automatic filtering is enabled.
settlingCfgSettling time configuration bits.
cutoffCfgCutoff frequency configuration bits.

Definition at line 945 of file CC1200.cpp.

void configureFIFOMode (  )

Set up the radio for FIFO mode.

Definition at line 467 of file CC1200.cpp.

void configureGPIO ( uint8_t  gpioNumber,
CC1200::GPIOMode  mode,
bool  outputInvert = false 
)

Configure a CC1200 GPIO pin.

Parameters:
gpioNumberPin number, from 0-3.
modeMode to set the pin to.
outputInvertWhether to invert the output of the pin.

Definition at line 454 of file CC1200.cpp.

void configurePreamble ( uint8_t  preambleLengthCfg,
uint8_t  preambleFormatCfg 
)

Configure the preamble that the radio is configured to send/receive.

The main purpose of the preamble is to provide receiving radios with a chance to calibrate their RX gain. However, you can also require that receiving radios see a valid preamble before they can detect the sync word (this is not on by default).

Parameters:
preambleLengthCfgBits that determine the length of the preamble. See the PREAMBLE_CFG1 register description for details. Set to 0 disable transmitting a preamble.
preambleFormatCfgBits that determine the format of the preamble. See the PREAMBLE_CFG1 register description for details.

Definition at line 981 of file CC1200.cpp.

void configureSyncWord ( uint32_t  syncWord,
CC1200::SyncMode  mode,
uint8_t  syncThreshold 
)

Configure the sync word settings of the radio.

The sync word is the bit string sent before each packet -- the radio knows to switch into receive mode when it detects it. Specific values with low autocorrelation should be used for the sync word.

Parameters:
syncWordSync word value.
modeSync word mode. Configures how many bits of the value are significant.
syncThresholdCorrespondance threshold before the radio switches into receive mode.

Definition at line 961 of file CC1200.cpp.

void disablePARamping (  )

Disable the power amplifier ramp-up curve.

Definition at line 1009 of file CC1200.cpp.

bool enqueuePacket ( char const *  data,
size_t  len 
)

Enqueue a packet to be sent over the radio.

It will be sent the next time the radio is in transmit state.

In variable length mode, the length of a packet is variable, from 1 byte to 127 bytes. The length will be transmitted along with the packet data.

In fixed length mode, the length should be the fixed packet length.

The function is not for use with infinite-length mode, use writeStream() instead.

Also reads the radio's state.

Parameters:
data
len
Returns:
Whether the packet was enqueued. Could return false if there was not enough FIFO space to enqueue the packet, or if the packet is too long.

Definition at line 154 of file CC1200.cpp.

uint8_t getADCCICDecimation (  )

Get the ADC CIC decimation that was calculated by the most recent setRXFilterBandwidth() call.

This is used for certain other calculations such as the DC offset.

Returns:

Definition at line 589 of file CC1200.h.

uint8_t getLastLQI (  )

Get the LQI as of the last packet received.

Only provides valid data if appendStatus is enabled. This is a qualitative estimate from 1-128 of how easily a packet can be demodulated. Lower is better, but 0 indicates invalid.

Definition at line 824 of file CC1200.h.

int8_t getLastRSSI (  )

Get the RSSI as of the last packet received.

Only provides valid data if appendStatus is enabled.

Returns:
RSSI in dBm, or -128 if no valid RSSI measurement exists.

Definition at line 792 of file CC1200.h.

uint8_t getLQIRegister (  )

Get the LQI from the LQI_VAL register.

This is a qualitative estimate from 1-128 of how easily a packet can be demodulated. Lower is better, but 0 indicates invalid.

Returns:

Definition at line 1102 of file CC1200.cpp.

float getRSSIRegister (  )

Get the current RSSI from the RSSI register.

Note: I think this might only work while the radio is actively receiving.

Returns:
RSSI in dBm, or NaN if no valid RSSI measurement exists.

Definition at line 1070 of file CC1200.cpp.

size_t getRXFIFOLen (  )

Get the number of bytes currently in the RX FIFO.

Returns:

Definition at line 149 of file CC1200.cpp.

State getState (  )

Get the radio's most recently known state.

State is updated whenever registers are read or commands are sent, or when you call updateState.

Returns:

Definition at line 228 of file CC1200.h.

size_t getTXFIFOLen (  )

Get the number of bytes currently in the TX FIFO.

Returns:

Definition at line 144 of file CC1200.cpp.

bool hasReceivedPacket (  )

Check whether there is at least one complete packet in the RX FIFO.

In infinite length mode, this returns true if any data is present at all. NOTE: An alternate way to do this using hardware is to configure one of the CC1200's GPIOs as PKT_SYNC_RXTX, then set a falling edge interrupt to receive a packet.

Returns:

Definition at line 199 of file CC1200.cpp.

void idle (  )

Send the radio into idle mode.

Stops a currently running tx or rx.

Definition at line 925 of file CC1200.h.

bool isFSLocked (  )

Check whether the frequency synthesizer is locked on to the correct frequency.

If not, then the correct RF frequency is not being used. If the FS is not locking then check that the correct black box FS registers are applied and that the FS has been calibrated.

Returns:

Definition at line 976 of file CC1200.cpp.

uint8_t readRegister ( CC1200::Register  reg )

Read a register and return the byte value.

Also reads the radio's state.

Definition at line 1161 of file CC1200.cpp.

uint8_t readRegister ( CC1200::ExtRegister  reg )

Read an extended register and return the byte value.

Also reads the radio's state.

Definition at line 1218 of file CC1200.cpp.

uint8_t readRXFIFOByte ( uint8_t  address )

Get a byte from the RX FIFO.

Parameters:
addressThe byte address, from 0-127.

Definition at line 1279 of file CC1200.cpp.

size_t readStream ( char *  buffer,
size_t  maxLen 
)

Read up to maxLen bytes into buffer.

Parameters:
buffer
maxLen
Returns:
How many bytes were actually read. 0 if the RX FIFO was empty.

Definition at line 340 of file CC1200.cpp.

bool readStreamBlocking ( char *  buffer,
size_t  count,
std::chrono::microseconds  timeout = 0us 
)

Read a stream of data from the chip.

This function is only for use in infinite-length mode. Will block until the buffer was filled, an error has been detected (the radio switches to any state other than RX), or the timeout expires.

If false is returned, some data may have been written to the buffer, and the rest will not have been modified.

Note: if using a zero timeout, this function could cause a hang if the transmitter stops transmitting.

Parameters:
buffer
count
timeoutTimeout, or 0us to disable timeout.
Returns:
True iff the buffer was completely filled.

Definition at line 369 of file CC1200.cpp.

size_t receivePacket ( char *  buffer,
size_t  bufferLen 
)

Receive a packet from the radio.

Only packets that pass CRC check are received into the FIFO; those which do not pass checksum will be discarded.

This function assumes that there is a packet in the buffer. You should only call it after hasReceivedPacket() is true or a PKT_SYNC_RXTX pulse is received. If there is not a packet in the FIFO, *undefined behavior* can occur. An arbitrary amount of data will be read from the FIFO and garbage may be returned.

The function is not for use with infinite-length mode, use readStream() instead.

NOTE: A null terminator is NOT added unless it was present in the transmitted data. Be careful when treating the returned data as a string!

Parameters:
bufferBuffer to store received bytes in.
bufferLenLength of the buffer supplied. If the packet is longer than this buffer, then the full packet will be read from the FIFO but only a buffer's worth will be stored.
Returns:
Number of bytes actually received.

Definition at line 233 of file CC1200.cpp.

void sendCommand ( CC1200::Command  command )

Send a command.

Also reads the radio's state.

Parameters:
command

Definition at line 1268 of file CC1200.cpp.

void setAGCGainTable ( CC1200::GainTable  table,
uint8_t  minGainIndex,
uint8_t  maxGainIndex 
)

Set the gain table and min and max values within that table to use.

Min and max values are indexes into the current selected table.

Definition at line 1029 of file CC1200.cpp.

void setAGCHysteresis ( uint8_t  hysteresisCfg )

Configure the change in input signal power that must be sensed before the AGC starts to adjust itself.

See the register description for AGC_CFG0.AGC_HYST_LEVEL

Parameters:
hysteresisCfg

Definition at line 1046 of file CC1200.cpp.

void setAGCReferenceLevel ( uint8_t  level )

Set the AGC reference level which is the internal target power level that the AGC tries to adjust to.

The user manual section 6.4 gives a rough formula to calculate this, but I've just used the SmartRF values.

Parameters:
levelInternal power level in dB.

Definition at line 1016 of file CC1200.cpp.

void setAGCSettleWait ( uint8_t  settleWaitCfg )

Configure the time that the AGC takes to settle.

See the register description for AGC_CFG1.AGC_SETTLE_WAIT

Parameters:
settleWaitCfgbytes to write to AGC_CFG1.AGC_SETTLE_WAIT

Definition at line 1062 of file CC1200.cpp.

void setAGCSlewRate ( uint8_t  slewrateCfg )

Configure the rate that the AGC changes the receive gain.

See the register description for AGC_CFG0.AGC_SLEWRATE_LIMIT

Parameters:
slewrateCfg

Definition at line 1054 of file CC1200.cpp.

void setAGCSyncBehavior ( CC1200::SyncBehavior  behavior )

Set the AGC behavior after a sync word is detected.

Parameters:
behavior

Definition at line 1021 of file CC1200.cpp.

void setASKPowers ( float  maxPower,
float  minPower 
)

Set the high and low output powers when transmitting in ASK mode.

Overrides the setOutputPower() power setting.

Parameters:
maxPowerHigh output power. Must be between -16dBm and +14dBm.
minPowerLow output power. Must be between maxPower and -17.5dBm. -17.5dBm gives completely off, so OOK modulation instead of ASK.

Definition at line 731 of file CC1200.cpp.

void setCRCEnabled ( bool  enabled )

Set whether the CRC check is enabled.

This driver enables it by default. Enabling CRC will cause a 16 bit checksum to be transmitted along with the packet. It will be automatically checked by the receiving CC1200, and the packet will be discarded if the CRC doesn't match.

NOTE: it is not recommended to disable the CRC when using variable length mode. If the length byte is corrupted and the CRC doesn't check this, then the driver could read too little or too much from the chip's FIFO and cause the chip to enter the FIFO underflow state.

Parameters:
enabled

Definition at line 556 of file CC1200.cpp.

void setFSCalMode ( FSCalMode  mode )

Set when the radio calibrates its frequency synthesizer.

Per https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/t/375189 it looks like the FS can drift with changes in supply voltage and/or temperature, so it is good to continually calibrate it in case these change.

Definition at line 446 of file CC1200.cpp.

void setFSKDeviation ( float  deviation )

Set the frequency deviation from the center frequency in Hz.

See user guide section 5.2.1 for details, and cc1200 datasheet section 4.10.2 for example values.

Definition at line 572 of file CC1200.cpp.

void setIFCfg ( IFCfg  value,
bool  enableIQIC 
)

Set the receiver IF mixing configuration.

See the user guide section on IF_MIX_CFG.CMIX_CFG for details.

You must call *both* setRXFilterBandwidth() and setRadioFrequency() before calling this function.

Parameters:
valueDivider value to use, or zero-IF
enableIQICWhether to enable the ImageExtinct IQ mismatch compensation when supported (when if IF > RX filter bandwidth).

Definition at line 1107 of file CC1200.cpp.

void setModulationFormat ( CC1200::ModFormat  format )

Set the modulation format of the radio.

Parameters:
format

Definition at line 564 of file CC1200.cpp.

void setOnReceiveState ( CC1200::State  goodPacket,
CC1200::State  badPacket 
)

Set what state the radio will enter when a packet is received.

Parameters:
goodPacketState when a good (CRC pass) packet is received. Accepts State::TX, State::IDLE, State::FAST_TX_ON, and State::RX.
badPacketState when a bad (CRC fail) packet is received. Accepts State::RX and State::IDLE

Definition at line 417 of file CC1200.cpp.

void setOnTransmitState ( CC1200::State  txState )

Set what state the radio will enter when a packet is sent.

Parameters:
txStateState when a packet is transmitted. Accepts State::TX, State::IDLE, State::FAST_TX_ON, and State::RX.

Definition at line 438 of file CC1200.cpp.

void setOutputPower ( float  outPower )

Set the approximate output power in dBm.

Must be between -16dBm and +14dBm.

Parameters:
outPower

Definition at line 715 of file CC1200.cpp.

void setPacketLength ( uint16_t  length,
uint8_t  bitLength = 0 
)

Set the packet length when in fixed length packet mode.

The bit length parameter can be used to send only the x most significant bits of the final byte. For example, if your packets are 20 bits long, you should set length to 2 bytes and bitLength to 4 bytes, so that 2 complete bytes + 4 extra bits are transmitted. Buffers used for sending and receiving packets should then be 3 bytes long.

When appendStatus is disabled, the max length is 256 bytes. When it is enabled, the max length is 254 bytes.

Parameters:
length

Definition at line 524 of file CC1200.cpp.

void setPacketMode ( PacketMode  mode,
bool  appendStatus = false 
)

Set the packet mode that the system will use.

Parameters:
mode
appendStatusHave the radio append a status byte to each packet received. This takes up 2 bytes per packet in the RX FIFO, but provides status information about each packet.

Definition at line 485 of file CC1200.cpp.

void setPARampRate ( uint8_t  firstRampLevel,
uint8_t  secondRampLevel,
CC1200::RampTime  rampTime 
)

Enable the the power amplifier ramp-up curve and set its shape and time.

See section 7.1 for details. This is also used to set the ASK ramping between different power levels.

The PA will gradually ramp from off to full amplitude in rampTime relative to the symbol rate. At 1/3 of rampTime it will have ramped to (firstRampLevel / 16) * full amplitude, and at 2/3 of rampTime it will have ramped to ((secondRampLevel + 7) / 16) * full amplitude.

Definition at line 993 of file CC1200.cpp.

void setRadioFrequency ( CC1200::Band  band,
float  frequencyHz 
)

Set the radio band and specific frequency.

See user guide section 9.12 for details. Note: Frequency offsets are not currently implemented, so the frequency can't be set at the finest resolution. However, the resolution should be fine for most applications. (at 900MHz this function has a resolution of 152.5Hz)

Parameters:
band
frequencyHz

Definition at line 753 of file CC1200.cpp.

void setRSSIOffset ( int8_t  adjust )

Set the RSSI gain adjustment.

This value is added to the reported RSSI, and also used in the calculation of the Carrier Sense (CS) line. You have to calibrate this in a lab by feeding in a known amplitude signal, see the user manual section 6.9 for details.

Definition at line 1097 of file CC1200.cpp.

void setRXFilterBandwidth ( float  bandwidthHz,
bool  preferHigherCICDec = true 
)

Set the the RX filter bandwidth.

You must call this AFTER setting the symbol rate. See user guide section 6.1 for details.

NOTE: The symbol rate and the RX filter bandwidth must be compatible with each other. See the user guide for details.

A number of different registers must be configured in order to properly configure the radio for a given bandwidth. This call currently sets the following register fields:

  • CHAN_BW.ADC_CIC_DECFACT
  • CHAN_BW.BB_CIC_DECFACT
  • MDMCFG1.DVGA_GAIN
  • MDMCFG0.DATA_FILTER_EN
  • SYNC_CFG0.RX_CONFIG_LIMITATION
Parameters:
bandwidthHzthe bandwidth in Hz
preferHigherCICDecIf there are multiple register value choices, prefer the one with higher CIC decimation and lower BB decimation. This is the recommendation of the datasheet but it actually causes transmission to fail in some cases.

Definition at line 844 of file CC1200.cpp.

void setSymbolRate ( float  symbolRateHz )

Set the RF symbol rate in Hz.

If this radio is to be used in receive mode you must call setRXFilterBandwidth() after calling this function.

Parameters:
symbolRateHz

Definition at line 623 of file CC1200.cpp.

void startRX (  )

Send the SRX strobe to change the radio into TX state.

Valid when the radio is in IDLE, FAST_TX_ON, and TX. A calibration will be performed if needed.

The radio will stay in RX state until it is commanded to a different state, or a packet is received and it configured to change states when this happens, or a FIFO overflow occurs (because the host is not reading data out fast enough).

Definition at line 920 of file CC1200.h.

void startTX (  )

Send the STX strobe to change the radio into TX state.

Valid when the radio is in IDLE, FAST_TX_ON, and RX. A calibration will be performed if needed.

The radio will stay in TX state until it is commanded to a different state, or a packet is transmitted and it is configured to change states when this happens, or a FIFO error occurs (which shouldn't be possible with the current configuration).

Definition at line 909 of file CC1200.h.

void updateState (  )

Update the current known state of the radio.

Definition at line 889 of file CC1200.h.

void writeRegister ( CC1200::ExtRegister  reg,
uint8_t  value 
)

Write an extended register with a byte value.

Also reads the radio's state.

Definition at line 1233 of file CC1200.cpp.

void writeRegister ( Register  reg,
uint8_t  value 
)

Write a register with a byte value.

Also reads the radio's state.

Definition at line 1175 of file CC1200.cpp.

void writeRegisters ( CC1200::ExtRegister  startReg,
std::array< uint8_t, numRegisters > const &  values 
)

Write a series of consecutive registers with byte values.

Also reads the radio's state. Template version that takes an std::array.

Definition at line 874 of file CC1200.h.

void writeRegisters ( CC1200::Register  startReg,
uint8_t const *  values,
size_t  numRegisters 
)

Write a series of consecutive registers with byte values.

Also reads the radio's state.

Definition at line 1187 of file CC1200.cpp.

void writeRegisters ( CC1200::ExtRegister  startReg,
uint8_t const *  values,
size_t  numRegisters 
)

Write a series of consecutive extended registers with byte values.

Also reads the radio's state.

Definition at line 1246 of file CC1200.cpp.

void writeRegisters ( CC1200::Register  startReg,
std::array< uint8_t, numRegisters > const &  values 
)

Write a series of consecutive registers with byte values.

Also reads the radio's state. Template version that takes an std::array.

Definition at line 849 of file CC1200.h.

size_t writeStream ( const char *  buffer,
size_t  count 
)

Write a stream of data to the chip.

This function is only for use in infinite-length mode. As many bytes from the given buffer will be written as can fit in the chip's FIFO. If the FIFO is full, this function does nothing.

Parameters:
buffer
count
Returns:
Number of bytes written.

Definition at line 285 of file CC1200.cpp.

bool writeStreamBlocking ( const char *  buffer,
size_t  count 
)

Write a stream of data to the chip.

This function is only for use in infinite-length mode. Will block until all bytes in the given buffer have been written to the TX FIFO, or an error has been detected (the radio switches to any state other than TX).

Parameters:
buffer
count
Returns:
True if successful, false if there was an error.

Definition at line 324 of file CC1200.cpp.