aversive_10-03-12/modules/devices/radio/cc2420/cc2420.c File Reference

#include <aversive.h>
#include <aversive/wait.h>
#include <aversive/error.h>
#include <spi.h>
#include <cc2420.h>
#include <cc2420_arch.h>
#include <cc2420_config.h>

Go to the source code of this file.

Defines

#define SLAVE_SELECT()   spi_slave_select(g_slave_adr)
#define SLAVE_DESELECT()   spi_slave_deselect(g_slave_adr)

Functions

uint8_t cc2420_get_status (void)
uint8_t cc2420_strobe_register (uint8_t reg)
uint16_t cc2420_read_register (uint8_t reg)
void cc2420_write_register (uint8_t reg, uint16_t value)
uint8_t cc2420_write_txfifo (uint8_t *buffer, uint8_t length)
uint8_t cc2420_write_rxfifo (uint8_t *buffer, uint8_t length)
void cc2420_read_rxfifo (uint8_t *buffer, uint8_t length)
void cc2420_write_ram (uint16_t addr, uint8_t *buffer, uint16_t length)
void cc2420_read_ram (uint16_t addr, uint8_t *buffer, uint16_t length)
void cc2420_init (void)


Define Documentation

 
#define SLAVE_DESELECT (  )     spi_slave_deselect(g_slave_adr)

 
#define SLAVE_SELECT (  )     spi_slave_select(g_slave_adr)


Function Documentation

uint8_t cc2420_get_status ( void   ) 

Definition at line 49 of file cc2420.c.

References SLAVE_DESELECT, SLAVE_SELECT, SNOP, and spi_send_and_receive_byte().

Referenced by main().

void cc2420_init ( void   ) 

void cc2420_read_ram ( uint16_t  addr,
uint8_t *  buffer,
uint16_t  length 
)

Definition at line 192 of file cc2420.c.

References BANK_MASK, i, RAM_BIT, RAM_MASK, RAM_READ, SLAVE_DESELECT, SLAVE_SELECT, spi_receive_byte(), and spi_send_byte().

Referenced by main().

uint16_t cc2420_read_register ( uint8_t  reg  )  [inline]

Definition at line 74 of file cc2420.c.

References READ_BIT, REG_BIT, REG_MASK, SLAVE_DESELECT, SLAVE_SELECT, spi_receive_byte(), and spi_send_byte().

Referenced by main().

void cc2420_read_rxfifo ( uint8_t *  buffer,
uint8_t  length 
)

Definition at line 153 of file cc2420.c.

References i, READ_BIT, REG_BIT, RXFIFO, SLAVE_DESELECT, SLAVE_SELECT, spi_receive_byte(), and spi_send_byte().

Referenced by main().

uint8_t cc2420_strobe_register ( uint8_t  reg  )  [inline]

Definition at line 62 of file cc2420.c.

References SLAVE_DESELECT, SLAVE_SELECT, and spi_send_and_receive_byte().

void cc2420_write_ram ( uint16_t  addr,
uint8_t *  buffer,
uint16_t  length 
)

Definition at line 174 of file cc2420.c.

References BANK_MASK, i, RAM_BIT, RAM_MASK, RAM_READ_WRITE, SLAVE_DESELECT, SLAVE_SELECT, and spi_send_byte().

Referenced by main().

void cc2420_write_register ( uint8_t  reg,
uint16_t  value 
) [inline]

Definition at line 90 of file cc2420.c.

References REG_BIT, REG_MASK, SLAVE_DESELECT, SLAVE_SELECT, spi_send_byte(), and WRITE_BIT.

Referenced by main().

uint8_t cc2420_write_rxfifo ( uint8_t *  buffer,
uint8_t  length 
)

Definition at line 130 of file cc2420.c.

References i, REG_BIT, RXFIFO, SFLUSHRX, SLAVE_DESELECT, SLAVE_SELECT, spi_send_and_receive_byte(), spi_send_byte(), and WRITE_BIT.

Referenced by main().

uint8_t cc2420_write_txfifo ( uint8_t *  buffer,
uint8_t  length 
)


Generated on Fri Mar 12 06:32:06 2010 for AVR by  doxygen 1.5.6