Loading...
Searching...
No Matches
cc2420_internal.h File Reference

Definitions and settings for the cc2420. More...

Detailed Description

#include <stdint.h>
#include "cc2420.h"
+ Include dependency graph for cc2420_internal.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.
 
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.
 
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.
 
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.
 
void cc2420_fifo_read (const cc2420_t *dev, uint8_t *data, const size_t len)
 Reads FIFO buffer from RAM at address 0x080.
 
void cc2420_fifo_write (const cc2420_t *dev, uint8_t *data, const size_t len)
 Writes FIFO buffer to RAM at address 0x000.
 
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.
 

Macro Definition Documentation

◆ CC2420_RESET_DELAY

#define CC2420_RESET_DELAY   (500U)

Delays for resetting and turning on the device.

Definition at line 39 of file cc2420_internal.h.

◆ CC2420_XOSCON_DELAY

#define CC2420_XOSCON_DELAY   (2000U)

Definition at line 40 of file cc2420_internal.h.

Function Documentation

◆ 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]devdevice to write to
[in]datadata to copy into SRAM
[in]lennumber 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]devdevice to write to
[in]datadata to copy into SRAM
[in]lennumber 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]devdevice to read from
[in]addrstarting address to read from [valid 0x00-0x16B]
[out]databuffer to read data into
[in]lennumber 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]devdevice to write to
[in]addraddress in the SRAM to write to [valid 0x00-0x16B]
[in]datadata to copy into SRAM
[in]lennumber 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]devdevice to read from
[in]addraddress 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]devdevice to write to
[in]addraddress of the register to write
[in]valuevalue to write to the given register