mos/com/include/cc1000.h File Reference

This module provides the functionality of the CC1000 radio. More...

#include "mos.h"
#include "stdarg.h"
#include "com.h"

Go to the source code of this file.

Defines

#define CC1000_MAIN   0x00
#define CC1000_FREQ_2A   0x01
#define CC1000_FREQ_1A   0x02
#define CC1000_FREQ_0A   0x03
#define CC1000_FREQ_2B   0x04
#define CC1000_FREQ_1B   0x05
#define CC1000_FREQ_0B   0x06
#define CC1000_FSEP1   0x07
#define CC1000_FSEP0   0x08
#define CC1000_CURRENT   0x09
#define CC1000_FRONT_END   0x0A
#define CC1000_PA_POW   0x0B
#define CC1000_PLL   0x0C
#define CC1000_LOCK   0x0D
#define CC1000_CAL   0x0E
#define CC1000_MODEM2   0x0F
#define CC1000_MODEM1   0x10
#define CC1000_MODEM0   0x11
#define CC1000_MATCH   0x12
#define CC1000_FSCTRL   0x13
#define CC1000_FSHAPE7   0x14
#define CC1000_FSHAPE6   0x15
#define CC1000_FSHAPE5   0x16
#define CC1000_FSHAPE4   0x17
#define CC1000_FSHAPE3   0x18
#define CC1000_FSHAPE2   0x19
#define CC1000_FSHAPE1   0x1A
#define CC1000_FSDELAY   0x1B
#define CC1000_PRESCALER   0x1C
#define CC1000_TEST6   0x40
#define CC1000_TEST5   0x41
#define CC1000_TEST4   0x42
#define CC1000_TEST3   0x43
#define CC1000_TEST2   0x44
#define CC1000_TEST1   0x45
#define CC1000_TEST0   0x46
#define CC1000_RXTX   7
#define CC1000_F_REG   6
#define CC1000_RX_PD   5
#define CC1000_TX_PD   4
#define CC1000_FS_PD   3
#define CC1000_CORE_PD   2
#define CC1000_BIAS_PD   1
#define CC1000_RESET_N   0
#define CC1000_VCO_CURRENT   4
#define CC1000_LO_DRIVE   2
#define CC1000_PA_DRIVE   0
#define CC1000_BUF_CURRENT   5
#define CC1000_LNA_CURRENT   3
#define CC1000_IF_RSSI   1
#define CC1000_XOSC_BYPASS   0
#define CC1000_PA_HIGHPOWER   4
#define CC1000_PA_LOWPOWER   0
#define CC1000_EXT_FILTER   7
#define CC1000_REFDIV   3
#define CC1000_ALARM_DISABLE   2
#define CC1000_ALARM_H   1
#define CC1000_ALARM_L   0
#define CC1000_LOCK_SELECT   4
#define CC1000_PLL_LOCK_ACCURACY   3
#define CC1000_PLL_LOCK_LENGTH   2
#define CC1000_LOCK_INSTANT   1
#define CC1000_LOCK_CONTINUOUS   0
#define CC1000_CAL_START   7
#define CC1000_CAL_DUAL   6
#define CC1000_CAL_WAIT   5
#define CC1000_CAL_CURRENT   4
#define CC1000_CAL_COMPLETE   3
#define CC1000_CAL_ITERATE   0
#define CC1000_PEAKDETECT   7
#define CC1000_PEAK_LEVEL_OFFSET   0
#define CC1000_MLIMIT   5
#define CC1000_LOCK_AVG_IN   4
#define CC1000_LOCK_AVG_MODE   3
#define CC1000_SETTLING   1
#define CC1000_MODEM_RESET_N   0
#define CC1000_BAUDRATE   4
#define CC1000_DATA_FORMAT   2
#define CC1000_XOSC_FREQ   0
#define CC1000_RX_MATCH   4
#define CC1000_TX_MATCH   0
#define CC1000_DITHER1   3
#define CC1000_DITHER0   2
#define CC1000_SHAPE   1
#define CC1000_FS_RESET_N   0
#define CC1000_PRE_SWING   6
#define CC1000_PRE_CURRENT   4
#define CC1000_IF_INPUT   3
#define CC1000_IF_FRONT   2
#define CC1000_LOOPFILTER_TP1   7
#define CC1000_LOOPFILTER_TP2   6
#define CC1000_CHP_OVERRIDE   5
#define CC1000_CHP_CO   0
#define CC1000_CHP_DISALBE   5
#define CC1000_VCO_OVERRIDE   4
#define CC1000_VCO_AO   0
#define CC1000_BREAK_LOOP   4
#define CC1000_CAL_DAC_OPEN   0
#define CC1000_CHP_CURRENT   0
#define CC1000_CAL_DAC   0
#define CC1000_VCO_ARRAY   0
#define FREQS_NUM   0x1e
#define PARAM_NUM   38
#define SETTING_NUM   6
#define MAIN_INDEX   0x00
#define FREQ2A_INDEX   0x01
#define FREQ1A_INDEX   0x02
#define FREQ0A_INDEX   0x03
#define FREQ2B_INDEX   0x04
#define FREQ1B_INDEX   0x05
#define FREQ0B_INDEX   0x06
#define FSEP1_INDEX   0x07
#define FSEP0_INDEX   0x08
#define RXCURRENT_INDEX   0x09
#define FRONTEND_INDEX   0x0a
#define PAPOW_INDEX   0x0b
#define RXPLL_INDEX   0x0c
#define LOCK_INDEX   0x0d
#define CAL_INDEX   0x0e
#define MODEM2_INDEX   0x0f
#define MODEM1_INDEX   0x10
#define MODEM0_INDEX   0x11
#define MATCH_INDEX   0x12
#define FSCTRL_INDEX   0x13
#define FSHAPE7_INDEX   0x14
#define FSHAPE6_INDEX   0x15
#define FSHAPE5_INDEX   0x16
#define FSHAPE4_INDEX   0x17
#define FSHAPE3_INDEX   0x18
#define FSHAPE2_INDEX   0x19
#define FSHAPE1_INDEX   0x1a
#define FSDELAY_INDEX   0x1b
#define PRESCALER_INDEX   0x1c
#define TEST6_INDEX   0x1d
#define TEST5_INDEX   0x1e
#define TEST4_INDEX   0x1f
#define TEST3_INDEX   0x20
#define TEST2_INDEX   0x21
#define TEST1_INDEX   0x22
#define TEST0_INDEX   0x23
#define TXCURRENT_INDEX   0x24
#define TXPLL_INDEX   0x25
#define FREQ_902_265_MHZ   0x00
#define FREQ_902_791_MHZ   0x01
#define FREQ_903_318_MHZ   0x02
#define FREQ_903_845_MHZ   0x03
#define FREQ_904_371_MHZ   0x04
#define FREQ_904_898_MHZ   0x05
#define FREQ_905_425_MHZ   0x06
#define FREQ_905_951_MHZ   0x07
#define FREQ_906_478_MHZ   0x08
#define FREQ_907_004_MHZ   0x09
#define FREQ_907_531_MHZ   0x0a
#define FREQ_908_058_MHZ   0x0b
#define FREQ_908_584_MHZ   0x0c
#define FREQ_909_111_MHZ   0x0d
#define FREQ_909_638_MHZ   0x0e
#define FREQ_910_164_MHZ   0x0f
#define FREQ_910_691_MHZ   0x10
#define FREQ_911_217_MHZ   0x11
#define FREQ_911_744_MHZ   0x12
#define FREQ_912_271_MHZ   0x13
#define FREQ_912_797_MHZ   0x14
#define FREQ_913_324_MHZ   0x15
#define FREQ_913_851_MHZ   0x16
#define FREQ_914_377_MHZ   0x17
#define FREQ_914_907_MHZ   0x18
#define FREQ_915_430_MHZ   0x19
#define FREQ_915_957_MHZ   0x1a
#define FREQ_916_484_MHZ   0x1b
#define FREQ_917_010_MHZ   0x1c
#define FREQ_917_537_MHZ   0x1d
#define BAUD_0_6_K   0x07
#define BAUD_1_2_K   0x17
#define BAUD_2_4_K   0x27
#define BAUD_4_8_K   0x37
#define BAUD_9_6_K   0x47
#define BAUD_19_2_K   0x57
#define BAUD_38_4_K   0x57
#define BAUD_19_2_K_LOWER_TEST4   0x25
#define CC1000_MODE_RX   0x00
#define CC1000_MODE_TX   0x01
#define CC1000_MODE_PD   0x02
#define CC1000_MODE_SLEEP   0x03
#define CC1000_TX_POWER   0
#define CC1000_RSSI   1
#define CC1000_FREQ   2
#define CC1000_RTS   3
#define CC1000_NO_RTS   4
#define CC1000_GET_TX_POWER   5
#define RADIO_TX_POWER   CC1000_TX_POWER
#define MODE_ON   0
 Radio is on.
#define MODE_OFF   1
 Radio is off.
#define FREQ   0x03
#define PREAMBLE_THRESH   6
 Number of preamble bytes you need to see.
#define PREAMBLE_LEN   16
 Number of preamble bytes you need to send.
#define PREAMBLE_BYTE   0xAA
 Actual byte to send as preamble.
#define FLUSH_BYTE   0xff

Functions

void delay_null ()
 Minimum delay.
void cc1000_init (uint8_t freq)
 Init the cc1000 radio. The initial procedure is in the cc1000 data sheet.
void cc1000_set (uint8_t newFreq)
 Set the radio to a specific frequency.
void cc1000_change_freq (uint8_t new_freq)
 Set the radio to a specific frequency.
void cc1000_calibrate ()
 Calibrates the CC1000, required.
void cc1000_write (uint8_t addr, uint8_t data)
 Write a value to a single CC1000 register.
void cc1000_write_word (short addranddata)
 Write a value to a single CC1000 register.
uint8_t cc1000_read (uint8_t addr)
 Reads from a single CC1000 register.
uint8_t cc1000_get_mode (void)
 Get the current transmit mode of the radio.
void cc1000_mode (uint8_t mode)
 Puts the cc1000 into different modes.
void cc1000_on ()
 Puts the CC1000 into RX mode.
void cc1000_sleep ()
 Puts the CC1000 into sleep mode.
void cc1000_wakeup ()
 Wakes the CC1000.
void cc1000_rssi_on ()
 Turns on the cc1000 radio.
uint8_t cc1000_get_channel ()
 Get the current frequency.
uint8_t cc1000_get_power ()
 Get the current power level.
uint8_t cc1000_cmode (uint8_t md)
 Sets mode for this driver.
uint8_t cc1000_ioctl (uint8_t request, va_list ap)
 Generic io control for this driver.
uint16_t cc1000_get_fec_errors ()
 get the number of FEC errors
void cc1000_state_machine ()
 state machine to send and receive packet
void cc1000_start_transmit (comBuf *sendPkt)
 actually start sending the data
void cc1000_default_init ()
 default initializations for the cc1000 MAC layer
void cc1000_init_ec ()
 Used to initialize error checking or error correction depending on whether or not we're using FEC or CRC.


Detailed Description

Author:
Adapted from the cc1000 source code provided by chipcon company.
Date:
04/27/200?

Definition in file cc1000.h.


Function Documentation

void cc1000_calibrate  ) 
 

Follows the steps listed in the cc1000 data sheet

void cc1000_change_freq uint8_t  new_freq  ) 
 

Parameters:
new_freq Frequency to set the radio to (FREQ_XXX_XXX_MHZ in cc1000.h)

uint8_t cc1000_get_channel  ) 
 

Returns:
Current frequency

uint8_t cc1000_get_power  ) 
 

Returns:
Current power level (0-255)

void cc1000_init uint8_t  freq  ) 
 

Parameters:
freq Assigned frequency (FREQ_XXX_XXX_MHZ in cc1000.h)

void cc1000_mode uint8_t  mode  ) 
 

Parameters:
mode Mode to set: CC1000_RX_MODE, CC1000_TX_MODE, CC1000_PD_MODE, CC1000_SLEEP_MODE

uint8_t cc1000_read uint8_t  addr  ) 
 

Parameters:
addr Address of the register to read from
Returns:
Data read

void cc1000_set uint8_t  newFreq  ) 
 

Parameters:
newFreq Frequency to set the radio to (FREQ_XXX_XXX_MHZ in cc1000.h)

void cc1000_write uint8_t  addr,
uint8_t  data
 

Parameters:
addr Address of the register to write to
data Data to be written

void cc1000_write_word short  addranddata  ) 
 

Parameters:
addranddata Address of register and data to be written, stuffed in the same variable.


Generated on Mon Nov 23 06:25:59 2009 for MANTIS by  doxygen 1.4.6