#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 SLAVE_DESELECT | ( | ) | spi_slave_deselect(g_slave_adr) |
Definition at line 36 of file cc2420.c.
Referenced by cc2420_get_status(), cc2420_init(), cc2420_read_ram(), cc2420_read_register(), cc2420_read_rxfifo(), cc2420_strobe_register(), cc2420_write_ram(), cc2420_write_register(), cc2420_write_rxfifo(), and cc2420_write_txfifo().
#define SLAVE_SELECT | ( | ) | spi_slave_select(g_slave_adr) |
Definition at line 35 of file cc2420.c.
Referenced by cc2420_get_status(), cc2420_init(), cc2420_read_ram(), cc2420_read_register(), cc2420_read_rxfifo(), cc2420_strobe_register(), cc2420_write_ram(), cc2420_write_register(), cc2420_write_rxfifo(), and cc2420_write_txfifo().
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 | ) |
Definition at line 212 of file cc2420.c.
References CC2420_STATUS_CHECK, DDR, E_CC2420, NOTICE, SLAVE_DESELECT, SLAVE_SELECT, SPI_CLK_RATE_2, SPI_FORMAT_0, spi_get_mode(), spi_init(), SPI_MODE_MASTER, SPI_MODE_UNINIT, spi_register_ss_line(), spi_send_byte(), SXOSCON, and XOSC16M_STABLE.
Referenced by main().
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 | |||
) |
Definition at line 105 of file cc2420.c.
References E_CC2420, i, NOTICE, REG_BIT, SLAVE_DESELECT, SLAVE_SELECT, spi_send_and_receive_byte(), spi_send_byte(), TXFIFO, and WRITE_BIT.