CC2500 Class Reference

Class for interfacing with the Chipcon TI CC2500. More...

#include <CC2500.h>

List of all members.

Public Member Functions

 CC2500 (unsigned char pinCS=10, unsigned char pinSCK=13, unsigned char pinMOSI=11, unsigned char pinMISO=12)
 ~CC2500 ()
void init ()
void reset ()
unsigned char sendByte (unsigned char data)
unsigned char sendCommand (unsigned char command, unsigned char data)
unsigned char sendStrobeCommand (unsigned char command)
unsigned char sendBurstCommand (unsigned char command, unsigned char *data, unsigned char length)

Protected Member Functions

unsigned char spiTransfer (volatile unsigned char data)

Private Attributes

unsigned char m_pinCS
unsigned char m_pinSCK
unsigned char m_pinMOSI
unsigned char m_pinMISO


Detailed Description

Class for interfacing with the Chipcon TI CC2500.

This class implements basic functions to communicate with the CC2500 and is tailored specifically for the Philips LivingColors.

Used documentation from http://focus.ti.com/docs/prod/folders/print/cc2500.html :


Constructor & Destructor Documentation

CC2500::CC2500 ( unsigned char  pinCS = 10,
unsigned char  pinSCK = 13,
unsigned char  pinMOSI = 11,
unsigned char  pinMISO = 12 
)

Constructor.

Parameters:
[in] pinCS Pin number of slave select, default is 10.
[in] pinSCK Pin number of clock, default is 13 (Arduino standard).
[in] pinMOSI Pin number of master output slave input, default is 11 (Arduino standard).
[in] pinMISO Pin number of master input slave output, default is 12 (Arduino standard).

CC2500::~CC2500 (  ) 

Destructor.


Member Function Documentation

void CC2500::init (  ) 

Initializes the CC2500 by setting the pin modes and disabling the device (slave select is set to high). Also sets up the arduino SPI control register (SPCR).

Here is the caller graph for this function:

void CC2500::reset (  ) 

Resets the CC2500 using SPI. Resetting the CC2500 is done by toggling the CS pin in a specific pattern and sending the strobe command SRES.

See SPI access document, page 9

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CC2500::sendByte ( unsigned char  data  ) 

Sends a byte of data to the CC2500 using SPI. The received byte is returned.

Parameters:
[in] data Byte of data to send.
Returns:
Received byte.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CC2500::sendCommand ( unsigned char  command,
unsigned char  data 
)

Sends a command and a byte of data to the CC2500 using SPI. Can be used to (1) write to a configuration register, (2) read a configuration register (by writing dummy data), (3) writing to patable memory if single access writes are used. Burst bit may be set, but burst access is not allowed!

See datasheet, chapters 10 & 32 for more information.

Parameters:
[in] command Command to send, can be register/patable memory, can be write or read.
[in] data Data to send, can be dummy data when read command is issued.
Returns:
Received byte.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CC2500::sendStrobeCommand ( unsigned char  command  ) 

Sends a strobe command to the CC2500 using SPI. For a strobe command no data is necessary.

See datasheet, chapter 32 for more information.

Parameters:
[in] command Strobe command to send.
Returns:
Received byte.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CC2500::sendBurstCommand ( unsigned char  command,
unsigned char *  data,
unsigned char  length 
)

Sends a burst command to the CC2500 using SPI. The burst bit (0x40) in the command must be set!

Parameters:
[in] command Burst command to send.
[in] data Data bytes to send, will be filled with received bytes.
[in] length Number of data bytes to send.
Returns:
Last received byte, also stored in data[length-1].

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CC2500::spiTransfer ( volatile unsigned char  data  )  [protected]

Transfers a byte of data using the Arduino SPI registers.

Parameters:
[in] data Byte of data to send.
Returns:
Received byte.

Here is the caller graph for this function:


Member Data Documentation

unsigned char CC2500::m_pinCS [private]

Number of the slave select (CS) pin.

unsigned char CC2500::m_pinSCK [private]

Number of the clock (SCK) pin.

unsigned char CC2500::m_pinMOSI [private]

Number of the master output, slave input (MOSI) pin.

unsigned char CC2500::m_pinMISO [private]

Number of the master input, slave output (MISO) pin.


The documentation for this class was generated from the following files:

Generated on Thu Feb 19 21:59:53 2009 for LivingColors by  doxygen 1.5.5