Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
cc2500.h File Reference
#include <stdbool.h>
#include <stdint.h>
+ Include dependency graph for cc2500.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CC2500_WRITE_SINGLE   0x00
 
#define CC2500_WRITE_BURST   0x40
 
#define CC2500_READ_SINGLE   0x80
 
#define CC2500_READ_BURST   0xC0
 
#define CC2500_SRES   0x30
 
#define CC2500_SFSTXON   0x31
 
#define CC2500_SXOFF   0x32
 
#define CC2500_SCAL   0x33
 
#define CC2500_SRX   0x34
 
#define CC2500_STX   0x35
 
#define CC2500_SIDLE   0x36
 
#define CC2500_SAFC   0x37
 
#define CC2500_SWOR   0x38
 
#define CC2500_SPWD   0x39
 
#define CC2500_SFRX   0x3A
 
#define CC2500_SFTX   0x3B
 
#define CC2500_SWORRST   0x3C
 
#define CC2500_SNOP   0x3D
 
#define CC2500_STATUS_CHIP_RDYn_BM   0x80
 
#define CC2500_STATUS_STATE_BM   0x70
 
#define CC2500_STATUS_FIFO_BYTES_AVAILABLE_BM   0x0F
 
#define CC2500_STATE_IDLE   0x00
 
#define CC2500_STATE_RX   0x10
 
#define CC2500_STATE_TX   0x20
 
#define CC2500_STATE_FSTXON   0x30
 
#define CC2500_STATE_CALIBRATE   0x40
 
#define CC2500_STATE_SETTLING   0x50
 
#define CC2500_STATE_RX_OVERFLOW   0x60
 
#define CC2500_STATE_TX_UNDERFLOW   0x70
 
#define CC2500_LQI_CRC_OK_BM   0x80
 
#define CC2500_LQI_EST_BM   0x7F
 

Enumerations

enum  {
  CC2500_00_IOCFG2 = 0x00, CC2500_01_IOCFG1 = 0x01, CC2500_02_IOCFG0 = 0x02, CC2500_03_FIFOTHR = 0x03,
  CC2500_04_SYNC1 = 0x04, CC2500_05_SYNC0 = 0x05, CC2500_06_PKTLEN = 0x06, CC2500_07_PKTCTRL1 = 0x07,
  CC2500_08_PKTCTRL0 = 0x08, CC2500_09_ADDR = 0x09, CC2500_0A_CHANNR = 0x0A, CC2500_0B_FSCTRL1 = 0x0B,
  CC2500_0C_FSCTRL0 = 0x0C, CC2500_0D_FREQ2 = 0x0D, CC2500_0E_FREQ1 = 0x0E, CC2500_0F_FREQ0 = 0x0F,
  CC2500_10_MDMCFG4 = 0x10, CC2500_11_MDMCFG3 = 0x11, CC2500_12_MDMCFG2 = 0x12, CC2500_13_MDMCFG1 = 0x13,
  CC2500_14_MDMCFG0 = 0x14, CC2500_15_DEVIATN = 0x15, CC2500_16_MCSM2 = 0x16, CC2500_17_MCSM1 = 0x17,
  CC2500_18_MCSM0 = 0x18, CC2500_19_FOCCFG = 0x19, CC2500_1A_BSCFG = 0x1A, CC2500_1B_AGCCTRL2 = 0x1B,
  CC2500_1C_AGCCTRL1 = 0x1C, CC2500_1D_AGCCTRL0 = 0x1D, CC2500_1E_WOREVT1 = 0x1E, CC2500_1F_WOREVT0 = 0x1F,
  CC2500_20_WORCTRL = 0x20, CC2500_21_FREND1 = 0x21, CC2500_22_FREND0 = 0x22, CC2500_23_FSCAL3 = 0x23,
  CC2500_24_FSCAL2 = 0x24, CC2500_25_FSCAL1 = 0x25, CC2500_26_FSCAL0 = 0x26, CC2500_27_RCCTRL1 = 0x27,
  CC2500_28_RCCTRL0 = 0x28, CC2500_29_FSTEST = 0x29, CC2500_2A_PTEST = 0x2A, CC2500_2B_AGCTEST = 0x2B,
  CC2500_2C_TEST2 = 0x2C, CC2500_2D_TEST1 = 0x2D, CC2500_2E_TEST0 = 0x2E, CC2500_30_PARTNUM = 0x30,
  CC2500_31_VERSION = 0x31, CC2500_32_FREQEST = 0x32, CC2500_33_LQI = 0x33, CC2500_34_RSSI = 0x34,
  CC2500_35_MARCSTATE = 0x35, CC2500_36_WORTIME1 = 0x36, CC2500_37_WORTIME0 = 0x37, CC2500_38_PKTSTATUS = 0x38,
  CC2500_39_VCO_VC_DAC = 0x39, CC2500_3A_TXBYTES = 0x3A, CC2500_3B_RXBYTES = 0x3B, CC2500_3E_PATABLE = 0x3E,
  CC2500_3F_TXFIFO = 0x3F, CC2500_3F_RXFIFO = 0x3F
}
 

Functions

void cc2500_init (void)
 
void cc2500ReadFifo (uint8_t *dpbuffer, uint8_t len)
 
void cc2500WriteFifo (uint8_t *dpbuffer, uint8_t len)
 
void cc2500ReadRegisterMulti (uint8_t address, uint8_t *data, uint8_t length)
 
void cc2500WriteRegisterMulti (uint8_t address, uint8_t *data, uint8_t length)
 
uint8_t cc2500ReadReg (uint8_t reg)
 
void cc2500Strobe (uint8_t address)
 
void cc2500WriteReg (uint8_t address, uint8_t data)
 
void cc2500SetPower (uint8_t power)
 
uint8_t cc2500Reset (void)
 

Macro Definition Documentation

◆ CC2500_LQI_CRC_OK_BM

#define CC2500_LQI_CRC_OK_BM   0x80

Definition at line 189 of file cc2500.h.

◆ CC2500_LQI_EST_BM

#define CC2500_LQI_EST_BM   0x7F

Definition at line 190 of file cc2500.h.

◆ CC2500_READ_BURST

#define CC2500_READ_BURST   0xC0

Definition at line 137 of file cc2500.h.

◆ CC2500_READ_SINGLE

#define CC2500_READ_SINGLE   0x80

Definition at line 136 of file cc2500.h.

◆ CC2500_SAFC

#define CC2500_SAFC   0x37

Definition at line 158 of file cc2500.h.

◆ CC2500_SCAL

#define CC2500_SCAL   0x33

Definition at line 146 of file cc2500.h.

◆ CC2500_SFRX

#define CC2500_SFRX   0x3A

Definition at line 161 of file cc2500.h.

◆ CC2500_SFSTXON

#define CC2500_SFSTXON   0x31

Definition at line 141 of file cc2500.h.

◆ CC2500_SFTX

#define CC2500_SFTX   0x3B

Definition at line 162 of file cc2500.h.

◆ CC2500_SIDLE

#define CC2500_SIDLE   0x36

Definition at line 155 of file cc2500.h.

◆ CC2500_SNOP

#define CC2500_SNOP   0x3D

Definition at line 164 of file cc2500.h.

◆ CC2500_SPWD

#define CC2500_SPWD   0x39

Definition at line 160 of file cc2500.h.

◆ CC2500_SRES

#define CC2500_SRES   0x30

Definition at line 140 of file cc2500.h.

◆ CC2500_SRX

#define CC2500_SRX   0x34

Definition at line 148 of file cc2500.h.

◆ CC2500_STATE_CALIBRATE

#define CC2500_STATE_CALIBRATE   0x40

Definition at line 181 of file cc2500.h.

◆ CC2500_STATE_FSTXON

#define CC2500_STATE_FSTXON   0x30

Definition at line 180 of file cc2500.h.

◆ CC2500_STATE_IDLE

#define CC2500_STATE_IDLE   0x00

Definition at line 177 of file cc2500.h.

◆ CC2500_STATE_RX

#define CC2500_STATE_RX   0x10

Definition at line 178 of file cc2500.h.

◆ CC2500_STATE_RX_OVERFLOW

#define CC2500_STATE_RX_OVERFLOW   0x60

Definition at line 183 of file cc2500.h.

◆ CC2500_STATE_SETTLING

#define CC2500_STATE_SETTLING   0x50

Definition at line 182 of file cc2500.h.

◆ CC2500_STATE_TX

#define CC2500_STATE_TX   0x20

Definition at line 179 of file cc2500.h.

◆ CC2500_STATE_TX_UNDERFLOW

#define CC2500_STATE_TX_UNDERFLOW   0x70

Definition at line 184 of file cc2500.h.

◆ CC2500_STATUS_CHIP_RDYn_BM

#define CC2500_STATUS_CHIP_RDYn_BM   0x80

Definition at line 172 of file cc2500.h.

◆ CC2500_STATUS_FIFO_BYTES_AVAILABLE_BM

#define CC2500_STATUS_FIFO_BYTES_AVAILABLE_BM   0x0F

Definition at line 174 of file cc2500.h.

◆ CC2500_STATUS_STATE_BM

#define CC2500_STATUS_STATE_BM   0x70

Definition at line 173 of file cc2500.h.

◆ CC2500_STX

#define CC2500_STX   0x35

Definition at line 151 of file cc2500.h.

◆ CC2500_SWOR

#define CC2500_SWOR   0x38

Definition at line 159 of file cc2500.h.

◆ CC2500_SWORRST

#define CC2500_SWORRST   0x3C

Definition at line 163 of file cc2500.h.

◆ CC2500_SXOFF

#define CC2500_SXOFF   0x32

Definition at line 145 of file cc2500.h.

◆ CC2500_WRITE_BURST

#define CC2500_WRITE_BURST   0x40

Definition at line 135 of file cc2500.h.

◆ CC2500_WRITE_SINGLE

#define CC2500_WRITE_SINGLE   0x00

Definition at line 134 of file cc2500.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CC2500_00_IOCFG2 
CC2500_01_IOCFG1 
CC2500_02_IOCFG0 
CC2500_03_FIFOTHR 
CC2500_04_SYNC1 
CC2500_05_SYNC0 
CC2500_06_PKTLEN 
CC2500_07_PKTCTRL1 
CC2500_08_PKTCTRL0 
CC2500_09_ADDR 
CC2500_0A_CHANNR 
CC2500_0B_FSCTRL1 
CC2500_0C_FSCTRL0 
CC2500_0D_FREQ2 
CC2500_0E_FREQ1 
CC2500_0F_FREQ0 
CC2500_10_MDMCFG4 
CC2500_11_MDMCFG3 
CC2500_12_MDMCFG2 
CC2500_13_MDMCFG1 
CC2500_14_MDMCFG0 
CC2500_15_DEVIATN 
CC2500_16_MCSM2 
CC2500_17_MCSM1 
CC2500_18_MCSM0 
CC2500_19_FOCCFG 
CC2500_1A_BSCFG 
CC2500_1B_AGCCTRL2 
CC2500_1C_AGCCTRL1 
CC2500_1D_AGCCTRL0 
CC2500_1E_WOREVT1 
CC2500_1F_WOREVT0 
CC2500_20_WORCTRL 
CC2500_21_FREND1 
CC2500_22_FREND0 
CC2500_23_FSCAL3 
CC2500_24_FSCAL2 
CC2500_25_FSCAL1 
CC2500_26_FSCAL0 
CC2500_27_RCCTRL1 
CC2500_28_RCCTRL0 
CC2500_29_FSTEST 
CC2500_2A_PTEST 
CC2500_2B_AGCTEST 
CC2500_2C_TEST2 
CC2500_2D_TEST1 
CC2500_2E_TEST0 
CC2500_30_PARTNUM 
CC2500_31_VERSION 
CC2500_32_FREQEST 
CC2500_33_LQI 
CC2500_34_RSSI 
CC2500_35_MARCSTATE 
CC2500_36_WORTIME1 
CC2500_37_WORTIME0 
CC2500_38_PKTSTATUS 
CC2500_39_VCO_VC_DAC 
CC2500_3A_TXBYTES 
CC2500_3B_RXBYTES 
CC2500_3E_PATABLE 
CC2500_3F_TXFIFO 
CC2500_3F_RXFIFO 

Definition at line 64 of file cc2500.h.

Function Documentation

◆ cc2500_init()

◆ cc2500ReadFifo()

void cc2500ReadFifo ( uint8_t dpbuffer,
uint8_t  len 
)

Definition at line 174 of file cc2500.c.

References CC2500_3F_RXFIFO, CC2500_READ_BURST, NOP, and rxSpiReadCommandMulti().

Referenced by frSkyXHandlePacket(), getBind1(), getBind2(), and tuneRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500ReadReg()

uint8_t cc2500ReadReg ( uint8_t  reg)

Definition at line 199 of file cc2500.c.

References NOP, and rxSpiReadCommand().

Referenced by cc2500Reset(), cc2500SpiDetect(), frSkyXHandlePacket(), getBind1(), getBind2(), initialise(), and tuneRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500ReadRegisterMulti()

void cc2500ReadRegisterMulti ( uint8_t  address,
uint8_t data,
uint8_t  length 
)

Definition at line 188 of file cc2500.c.

References NOP, and rxSpiReadCommandMulti().

+ Here is the call graph for this function:

◆ cc2500Reset()

uint8_t cc2500Reset ( void  )

Definition at line 228 of file cc2500.c.

References CC2500_0E_FREQ1, CC2500_SRES, cc2500ReadReg(), cc2500Strobe(), and delayMicroseconds.

Referenced by initialise(), and radio_control_impl_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500SetPower()

void cc2500SetPower ( uint8_t  power)

Definition at line 211 of file cc2500.c.

References CC2500_3E_PATABLE, and cc2500WriteReg().

Referenced by frSkyXHandlePacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500Strobe()

void cc2500Strobe ( uint8_t  address)

Definition at line 204 of file cc2500.c.

References rxSpiWriteByte().

Referenced by cc2500Reset(), cc2500WriteFifo(), frSkySpiDataReceived(), frSkyXHandlePacket(), initGetBind(), initialise(), initTuneRx(), and nextChannel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500WriteFifo()

void cc2500WriteFifo ( uint8_t dpbuffer,
uint8_t  len 
)

Definition at line 180 of file cc2500.c.

References CC2500_3F_TXFIFO, CC2500_SFTX, CC2500_STX, CC2500_WRITE_BURST, cc2500Strobe(), and rxSpiWriteCommandMulti().

Referenced by frSkyXHandlePacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500WriteReg()

void cc2500WriteReg ( uint8_t  address,
uint8_t  data 
)

Definition at line 206 of file cc2500.c.

References rxSpiWriteCommand().

Referenced by cc2500SetPower(), initGetBind(), initialise(), initialiseData(), initTuneRx(), nextChannel(), and tuneRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cc2500WriteRegisterMulti()

void cc2500WriteRegisterMulti ( uint8_t  address,
uint8_t data,
uint8_t  length 
)

Definition at line 193 of file cc2500.c.

References rxSpiWriteCommandMulti().

+ Here is the call graph for this function: