Definitions and settings for the cc2420.
More...
#include <stdint.h>
#include "cc2420.h"
Go to the source code of this file.
#define | CC2420_RESET_DELAY (500U) |
| Delays for resetting and turning on the device.
|
|
#define | CC2420_XOSCON_DELAY (2000U) |
|
uint8_t | cc2420_strobe (const cc2420_t *dev, const uint8_t command) |
|
uint16_t | cc2420_reg_read (const cc2420_t *dev, const uint8_t addr) |
| Read from a register at address addr from device dev . More...
|
|
void | cc2420_reg_write (const cc2420_t *dev, const uint8_t addr, const uint16_t value) |
| Write to a register at address addr from device dev . More...
|
|
void | cc2420_ram_read (const cc2420_t *dev, const uint16_t addr, uint8_t *data, const size_t len) |
| Read a chunk of data from the SRAM of the given device. More...
|
|
void | cc2420_ram_write (const cc2420_t *dev, const uint16_t addr, const uint8_t *data, const size_t len) |
| Write a chunk of data into the SRAM of the given device. More...
|
|
void | cc2420_fifo_read (const cc2420_t *dev, uint8_t *data, const size_t len) |
| Reads FIFO buffer from RAM at address 0x080. More...
|
|
void | cc2420_fifo_write (const cc2420_t *dev, uint8_t *data, const size_t len) |
| Writes FIFO buffer to RAM at address 0x000. More...
|
|
uint8_t | cc2420_status (cc2420_t *dev) |
| Get the device's status byte.
|
|
uint8_t | cc2420_state (cc2420_t *dev) |
| Get the device's current state.
|
|
void | cc2420_en_xosc (cc2420_t *dev) |
| Enable on-board oscillator.
|
|
◆ cc2420_fifo_read()
void cc2420_fifo_read |
( |
const cc2420_t * |
dev, |
|
|
uint8_t * |
data, |
|
|
const size_t |
len |
|
) |
| |
Reads FIFO buffer from RAM at address 0x080.
- Parameters
-
[in] | dev | device to write to |
[in] | data | data to copy into SRAM |
[in] | len | number of bytes to write to SRAM |
◆ cc2420_fifo_write()
void cc2420_fifo_write |
( |
const cc2420_t * |
dev, |
|
|
uint8_t * |
data, |
|
|
const size_t |
len |
|
) |
| |
Writes FIFO buffer to RAM at address 0x000.
- Parameters
-
[in] | dev | device to write to |
[in] | data | data to copy into SRAM |
[in] | len | number of bytes to write to SRAM |
◆ cc2420_ram_read()
void cc2420_ram_read |
( |
const cc2420_t * |
dev, |
|
|
const uint16_t |
addr, |
|
|
uint8_t * |
data, |
|
|
const size_t |
len |
|
) |
| |
Read a chunk of data from the SRAM of the given device.
- Parameters
-
[in] | dev | device to read from |
[in] | addr | starting address to read from [valid 0x00-0x16B] |
[out] | data | buffer to read data into |
[in] | len | number of bytes to read from SRAM |
◆ cc2420_ram_write()
void cc2420_ram_write |
( |
const cc2420_t * |
dev, |
|
|
const uint16_t |
addr, |
|
|
const uint8_t * |
data, |
|
|
const size_t |
len |
|
) |
| |
Write a chunk of data into the SRAM of the given device.
- Parameters
-
[in] | dev | device to write to |
[in] | addr | address in the SRAM to write to [valid 0x00-0x16B] |
[in] | data | data to copy into SRAM |
[in] | len | number of bytes to write to SRAM |
◆ cc2420_reg_read()
uint16_t cc2420_reg_read |
( |
const cc2420_t * |
dev, |
|
|
const uint8_t |
addr |
|
) |
| |
Read from a register at address addr
from device dev
.
- Parameters
-
[in] | dev | device to read from |
[in] | addr | address of the register to read |
- Returns
- the value of the specified register
◆ cc2420_reg_write()
void cc2420_reg_write |
( |
const cc2420_t * |
dev, |
|
|
const uint8_t |
addr, |
|
|
const uint16_t |
value |
|
) |
| |
Write to a register at address addr
from device dev
.
- Parameters
-
[in] | dev | device to write to |
[in] | addr | address of the register to write |
[in] | value | value to write to the given register |