Constants for the CC1100/CC1101 driver. More...

Detailed Description

Constants for the CC1100/CC1101 driver.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file cc110x_constants.h.

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CC110X_FIFO_SIZE   64
 Size of the RX and TX FIFO.
 
#define CC110X_PKTCTRL1_VALUE   0x00
 Value of the bits 7-2 of the PKTCTRL1 configuration register used in this driver.
 

Command strobes of the CC1100/CC1101 transceiver

See Table 42 on page 67 in the data sheet.

Only values relevant to the driver are listed.

#define CC110X_STROBE_RESET   0x30
 Reset chip (SRES)
 
#define CC110X_STROBE_CALIBRATE   0x33
 Calibrate frequency synthesizer and turn it off (SCAL)
 
#define CC110X_STROBE_RX   0x34
 Go to RX state (SRX) More...
 
#define CC110X_STROBE_TX   0x35
 Go to TX state (STX) More...
 
#define CC110X_STROBE_IDLE   0x36
 Go to IDLE state (SIDLE)
 
#define CC110X_STROBE_OFF   0x39
 Go to power down state once CS goes high (SPWD)
 
#define CC110X_STROBE_FLUSH_RX   0x3A
 Flush RX fifo (SFRX) More...
 
#define CC110X_STROBE_FLUSH_TX   0x3B
 Flush TX fifo (SFTX) More...
 
#define CC110X_STROBE_STATUS   0x3D
 Get the status byte (SNOP)
 

Access modifies for accessing configuration/status registers

See Table 45 on pages 69ff in the data sheet.

These modifies need to be xor'ed with the address of the register.

#define CC110X_SINGLE_BYTE_WRITE   0x00
 Access modifier to write a single byte to a configuration register. More...
 
#define CC110X_BURST_WRITE   0x40
 Access modifier to write multiple bytes at once to configuration registers. More...
 
#define CC110X_SINGLE_BYTE_READ   0x80
 Access modifier to read a single byte from a configuration register. More...
 
#define CC110X_BURST_READ   0xC0
 Access modifier to read multiple bytes at once from configuration registers. More...
 

"Multi byte registers" of the CC1100/CC1101 transceiver

See Table 45 on pages 69ff in the data sheet.

These multi byte registers have a special semantics, which is documented for each multi byte register

#define CC110X_MULTIREG_PATABLE   0x3E
 Access to the PATABLE as multi byte register. More...
 
#define CC110X_MULTIREG_FIFO   0x3F
 Access to the TX and RX FIFO as multi byte register. More...
 

Configuration registers of the CC1100/CC1101 transceiver

See Table 43 on pages 68ff in the data sheet.

Only values relevant to the driver are listed.

#define CC110X_CONF_START   0x00
 First configuration register on the transceiver, used for burst access to the whole configuration.
 
#define CC110X_REG_IOCFG2   0x00
 GDO2 output pin configuration.
 
#define CC110X_REG_IOCFG1   0x01
 GDO1 output pin configuration.
 
#define CC110X_REG_IOCFG0   0x02
 GDO0 output pin configuration.
 
#define CC110X_REG_PKTCTRL1   0x07
 PKTCTRL1 configuration register. More...
 
#define CC110X_REG_ADDR   0x09
 Device address.
 
#define CC110X_REG_CHANNR   0x0A
 Channel number.
 
#define CC110X_REG_FSCTRL1   0x0B
 Intermediate frequency to use.
 
#define CC110X_REG_FREQ2   0x0D
 Frequency control word, high byte.
 
#define CC110X_REG_FREQ1   0x0E
 Frequency control word, middle byte.
 
#define CC110X_REG_FREQ0   0x0F
 Frequency control word, low byte.
 
#define CC110X_REG_MDMCFG4   0x10
 Modem configuration (channel filter bandwidth and data rate)
 
#define CC110X_REG_MDMCFG3   0x11
 Modem configuration (data rate)
 
#define CC110X_REG_DEVIATN   0x15
 Modem deviation setting.
 
#define CC110X_REG_FREND0   0x22
 Front End TX Configuration. More...
 
#define CC110X_REG_FSCAL3   0x23
 Charge pump current calibration. More...
 
#define CC110X_REG_FSCAL2   0x24
 VCO current calibration. More...
 
#define CC110X_REG_FSCAL1   0x25
 VCO capacitance calibration. More...
 
#define CC110X_REG_FSCAL0   0x26
 Undocumented frequency calibration value. More...
 
#define CC110X_REG_PTEST   0x2A
 Unlock the temperature sensor by writing 0xBF to it. More...
 
#define CC110X_REG_TEST2   0x2C
 Magic value obtained with SmartRF Studio software.
 
#define CC110X_REG_TEST1   0x2D
 Magic value obtained with SmartRF Studio software.
 
#define CC110X_REG_TEST0   0x2E
 Magic value obtained with SmartRF Studio software.
 

Status registers of the CC1100/CC1101 transceiver

See Table 43 on pages 68ff in the data sheet.

Only values relevant to the driver are listed.

Warning
The burst access bit of these registers has to be set to distinguish between command strobes and status registers. Thus, no burst access to status registers is possible.
#define CC110X_REG_PARTNUM   (0x30 | 0x40)
 Part number. More...
 
#define CC110X_REG_VERSION   (0x31 | 0x40)
 Version. More...
 
#define CC110X_REG_LQI   (0x33 | 0x40)
 Estimated link quality. More...
 
#define CC110X_REG_RSSI   (0x34 | 0x40)
 Received signal strength indication. More...
 
#define CC110X_REG_PKTSTATUS   (0x38 | 0x40)
 Packet status, GDOx status. More...
 
#define CC110X_REG_TXBYTES   (0x3A | 0x40)
 Number of bytes in the TX FIFO. More...
 
#define CC110X_REG_RXBYTES   (0x3B | 0x40)
 Number of bytes available in the RX FIFO. More...
 

Possible values for the IOCFG2, IOCFG1, and IOCFG0 configuration

     registers

See Table 41 on page 62 in the data sheet. Only values relevant to the driver are listed.

#define CC110X_GDO_ON_RX_DATA   0x01
 GDOx goes HIGH when data has to be read from RX FIFO or when a packet is fully received. More...
 
#define CC110X_GDO_ON_TX_DATA   0x02
 GDOx goes LOW when data should be written to the TX FIFO. More...
 
#define CC110X_GDO_ON_TRANSMISSION   0x06
 GDOx goes HIGH when a packet is received/send and back LOW when the transmission is completed/aborted (e.g. More...
 
#define CC110X_GDO_ON_CHANNEL_CLEAR   0x09
 GDOx goes HIGH when channel is clear for sending. More...
 
#define CC110X_GDO_ON_PLL_IN_LOCK   0x0A
 GDOx goes HIGH when PLL is in lock. More...
 
#define CC110X_GDO_CONSTANT_LOW   0x2F
 GDOx remains constantly LOW.
 
#define CC110X_GDO_CONSTANT_HIGH   0x6F
 GDOx remains constantly HIGH.
 
#define CC110X_GDO0_ANALOG_TEMPERATURE   0x80
 Repurpose GDO0 as analog temperature sensor in IDLE state. More...
 

Bitmasks to access entries in the PKTSTATUS status register

See page 94 in the data sheet.

#define CC110X_PKTSTATUS_GDO0   0x01
 Bitmask to get the GDO0 state from the PKTSTATUS status register value.
 
#define CC110X_PKTSTATUS_GDO2   0x04
 Bitmask to get the GDO2 state from the PKTSTATUS status register value.
 
#define CC110X_PKTSTATUS_RECEIVING   0x08
 Bitmask to get the SFD bit from the PKTSTATUS status register value which is set while receiving a frame.
 
#define CC110X_PKTSTATUS_CCA   0x10
 Bitmask to get the CCA bit from the PKTSTATUS status register value.
 
#define CC110X_PKTSTATUS_CS   0x40
 Bitmask to get the Carrier Sense bit from the PKTSTATUS status register value.
 

Values to write into the PTEST configuration register

See page 91 in the data sheet.

Only the two documented values are specified.

#define CC110X_PTEST_DEFAULT   0x7F
 Default value of the PTEST configuration register.
 
#define CC110X_PTEST_TEMPERATURE   0xBF
 Value to write in PTEST when reading the temperature. More...
 

Possible address matching policies

See page 73 in the data sheet.

The policy should be combined with CC110X_PKTCTRL1_VALUE via bitwise or. (Only modes compatible with the driver are defined.)

#define CC110X_PKTCTRL1_ADDR_ALL   0x00
 Accept incoming frames regardless of address.
 
#define CC110X_PKTCTRL1_ADDR_MATCH   0x02
 Accept frames with matching address or broadcast address.
 
#define CC110X_PKTCTRL1_GET_ADDR_MODE   0x03
 Bitmask to access address matching mode of the CC110x from the PKTCTRL1 register. More...
 

Macro Definition Documentation

◆ CC110X_BURST_READ

#define CC110X_BURST_READ   0xC0

Access modifier to read multiple bytes at once from configuration registers.

read bit (0x80) burst access bit (0x40)
1 (= read) 1 (= burst access)

Definition at line 135 of file cc110x_constants.h.

◆ CC110X_BURST_WRITE

#define CC110X_BURST_WRITE   0x40

Access modifier to write multiple bytes at once to configuration registers.

read bit (0x80) burst access bit (0x40)
0 (= write) 1 (= burst access)

Definition at line 116 of file cc110x_constants.h.

◆ CC110X_GDO0_ANALOG_TEMPERATURE

#define CC110X_GDO0_ANALOG_TEMPERATURE   0x80

Repurpose GDO0 as analog temperature sensor in IDLE state.

This only works with GDO0 and only in IDLE state! Additionally, 0xBF has to be written to configuration register PTEST when in IDLE state. Before leaving IDLE state, PTEST should be restored to 0x7F.

Definition at line 479 of file cc110x_constants.h.

◆ CC110X_GDO_ON_CHANNEL_CLEAR

#define CC110X_GDO_ON_CHANNEL_CLEAR   0x09

GDOx goes HIGH when channel is clear for sending.

Depends on the CCA_MODE setting in the MCSM1 configuration register

Definition at line 453 of file cc110x_constants.h.

◆ CC110X_GDO_ON_PLL_IN_LOCK

#define CC110X_GDO_ON_PLL_IN_LOCK   0x0A

GDOx goes HIGH when PLL is in lock.

Definition at line 459 of file cc110x_constants.h.

◆ CC110X_GDO_ON_RX_DATA

#define CC110X_GDO_ON_RX_DATA   0x01

GDOx goes HIGH when data has to be read from RX FIFO or when a packet is fully received.

Depends on the threshold set for the RX-FIFO in the FIFOTHR configuration register

Definition at line 432 of file cc110x_constants.h.

◆ CC110X_GDO_ON_TRANSMISSION

#define CC110X_GDO_ON_TRANSMISSION   0x06

GDOx goes HIGH when a packet is received/send and back LOW when the transmission is completed/aborted (e.g.

wrong destination address)

Definition at line 446 of file cc110x_constants.h.

◆ CC110X_GDO_ON_TX_DATA

#define CC110X_GDO_ON_TX_DATA   0x02

GDOx goes LOW when data should be written to the TX FIFO.

Depends on the threshold set for the TX-FIFO in the FIFOTHR configuration register

Definition at line 440 of file cc110x_constants.h.

◆ CC110X_MULTIREG_FIFO

#define CC110X_MULTIREG_FIFO   0x3F

Access to the TX and RX FIFO as multi byte register.

A single byte read using cc110x_read from the FIFO multi byte register will retrieve and remove the next byte from the RX FIFO. A burst of n bytes using cc110x_burst_read will retrieve and remove the next n bytes.

A single byte write using cc110x_write will push one byte of data into the TX FIFO. A multi byte write of n byte using cc110x_burst_write will push n bytes into the TX FIFO.

Warning
Reading the last byte from the RX-FIFO results in data corruption, unless the whole frame was received. Thus, read all but the last byte from the FIFO until the whole frame was received.

Definition at line 175 of file cc110x_constants.h.

◆ CC110X_MULTIREG_PATABLE

#define CC110X_MULTIREG_PATABLE   0x3E

Access to the PATABLE as multi byte register.

It is most convenient to read/write the whole 8 bytes of the PATABLE using a burst access. The first single byte access after the CS pin is pulled low will read from / write to the first byte, the second access the second byte, and so on. As cc110x_read and cc110x_write pull the CS pin high after the access, all but the first byte are only accessible using burst access in this driver.

Definition at line 158 of file cc110x_constants.h.

◆ CC110X_PKTCTRL1_GET_ADDR_MODE

#define CC110X_PKTCTRL1_GET_ADDR_MODE   0x03

Bitmask to access address matching mode of the CC110x from the PKTCTRL1 register.

Apply this using bitwise and to the value of the PKTCTRL1 register to get the address matching mode currently used.

Definition at line 570 of file cc110x_constants.h.

◆ CC110X_PTEST_TEMPERATURE

#define CC110X_PTEST_TEMPERATURE   0xBF

Value to write in PTEST when reading the temperature.

See also
CC110X_GDO0_ANALOG_TEMPERATURE

Definition at line 532 of file cc110x_constants.h.

◆ CC110X_REG_FREND0

#define CC110X_REG_FREND0   0x22

Front End TX Configuration.

Least three significant bits contain the current PA power setting.

Definition at line 280 of file cc110x_constants.h.

◆ CC110X_REG_FSCAL0

#define CC110X_REG_FSCAL0   0x26

Undocumented frequency calibration value.

For fast channel hopping this value can be ignored (see page 64ff in the data sheet) - so it has to be frequency independent.

Definition at line 316 of file cc110x_constants.h.

◆ CC110X_REG_FSCAL1

#define CC110X_REG_FSCAL1   0x25

VCO capacitance calibration.

This value is frequency depended. Thus, for fast channel hopping it has to be obtained for each channel (by performing a calibration on that channel and reading it out). Than the stored calibration data can be written to the register when changing the channel.

Definition at line 308 of file cc110x_constants.h.

◆ CC110X_REG_FSCAL2

#define CC110X_REG_FSCAL2   0x24

VCO current calibration.

This value depends on the environment (e.g. temperature, supply voltage, etc.), but not on the frequency. Thus, this value does not become obsolete when changing the channel.

Definition at line 298 of file cc110x_constants.h.

◆ CC110X_REG_FSCAL3

#define CC110X_REG_FSCAL3   0x23

Charge pump current calibration.

This value depends on the environment (e.g. temperature, supply voltage, etc.), but not on the frequency. Thus, this value does not become obsolete when changing the channel.

Definition at line 289 of file cc110x_constants.h.

◆ CC110X_REG_LQI

#define CC110X_REG_LQI   (0x33 | 0x40)

Estimated link quality.

Warning
Not accessible using burst reads

Definition at line 377 of file cc110x_constants.h.

◆ CC110X_REG_PARTNUM

#define CC110X_REG_PARTNUM   (0x30 | 0x40)

Part number.

Warning
Not accessible using burst reads

Definition at line 363 of file cc110x_constants.h.

◆ CC110X_REG_PKTCTRL1

#define CC110X_REG_PKTCTRL1   0x07

PKTCTRL1 configuration register.

This register contains multiple configuration settings.

Layout:

7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
| PQT |U|C|S|ADR|
+-+-+-+-+-+-+-+-+
  • PQT (bits 7-5): Preabmle quality estimator threshold
  • U (bit 4): unused, always 0
  • C (bit 3): Auto-clear RX FIFO on CRC mismatch (if frame fits in FIFO)
  • S (bit 2): Append status
  • ADR (bits 1-0): Address check setting

Definition at line 228 of file cc110x_constants.h.

◆ CC110X_REG_PKTSTATUS

#define CC110X_REG_PKTSTATUS   (0x38 | 0x40)

Packet status, GDOx status.

Warning
Not accessible using burst reads

Definition at line 391 of file cc110x_constants.h.

◆ CC110X_REG_PTEST

#define CC110X_REG_PTEST   0x2A

Unlock the temperature sensor by writing 0xBF to it.

Intended for production test, but who would complain about getting an temperature sensor for free :-)

See also
CC110X_GDO0_ANALOG_TEMPERATURE for details

Definition at line 326 of file cc110x_constants.h.

◆ CC110X_REG_RSSI

#define CC110X_REG_RSSI   (0x34 | 0x40)

Received signal strength indication.

Warning
Not accessible using burst reads

Definition at line 384 of file cc110x_constants.h.

◆ CC110X_REG_RXBYTES

#define CC110X_REG_RXBYTES   (0x3B | 0x40)

Number of bytes available in the RX FIFO.

Warning
Not accessible using burst reads
The received value could be corrupted when reading it while it is updated. Reading it out twice until both reads return the same value is the suggested workaround for this hardware bug.

Definition at line 411 of file cc110x_constants.h.

◆ CC110X_REG_TXBYTES

#define CC110X_REG_TXBYTES   (0x3A | 0x40)

Number of bytes in the TX FIFO.

Warning
Not accessible using burst reads
The received value could be corrupted when reading it while it is updated. Reading it out twice until both reads return the same value is the suggested workaround for this hardware bug.

Definition at line 401 of file cc110x_constants.h.

◆ CC110X_REG_VERSION

#define CC110X_REG_VERSION   (0x31 | 0x40)

Version.

Warning
Not accessible using burst reads

Definition at line 370 of file cc110x_constants.h.

◆ CC110X_SINGLE_BYTE_READ

#define CC110X_SINGLE_BYTE_READ   0x80

Access modifier to read a single byte from a configuration register.

read bit (0x80) burst access bit (0x40)
1 (= read) 0 (= no burst access)

Definition at line 125 of file cc110x_constants.h.

◆ CC110X_SINGLE_BYTE_WRITE

#define CC110X_SINGLE_BYTE_WRITE   0x00

Access modifier to write a single byte to a configuration register.

read bit (0x80) burst access bit (0x40)
0 (= write) 0 (= no burst access)

Definition at line 106 of file cc110x_constants.h.

◆ CC110X_STROBE_FLUSH_RX

#define CC110X_STROBE_FLUSH_RX   0x3A

Flush RX fifo (SFRX)

Only valid in IDLE or in RXFIO_OVERFLOW states

Definition at line 74 of file cc110x_constants.h.

◆ CC110X_STROBE_FLUSH_TX

#define CC110X_STROBE_FLUSH_TX   0x3B

Flush TX fifo (SFTX)

Only valid in IDLE or in TXFIO_OVERFLOW states

Definition at line 81 of file cc110x_constants.h.

◆ CC110X_STROBE_RX

#define CC110X_STROBE_RX   0x34

Go to RX state (SRX)

Requires frequency calibration first

Definition at line 50 of file cc110x_constants.h.

◆ CC110X_STROBE_TX

#define CC110X_STROBE_TX   0x35

Go to TX state (STX)

Requires frequency calibration first

Definition at line 57 of file cc110x_constants.h.