cc2420_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Milan Babel <babel@inf.fu-berlin.de> and INRIA
3  * 2015-2016 Freie Universit├Ąt Berlin
4  * 2016 Inria
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
25 #ifndef CC2420_INTERNAL_H
26 #define CC2420_INTERNAL_H
27 
28 #include <stdint.h>
29 
30 #include "cc2420.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 #define CC2420_RESET_DELAY (500U)
40 #define CC2420_XOSCON_DELAY (2000U)
41 
42 
43 uint8_t cc2420_strobe(const cc2420_t *dev, const uint8_t command);
44 
45 
54 uint16_t cc2420_reg_read(const cc2420_t *dev, const uint8_t addr);
55 
63 void cc2420_reg_write(const cc2420_t *dev, const uint8_t addr,
64  const uint16_t value);
65 
74 void cc2420_ram_read(const cc2420_t *dev, const uint16_t addr,
75  uint8_t *data, const size_t len);
76 
85 void cc2420_ram_write(const cc2420_t *dev, const uint16_t addr,
86  const uint8_t *data, const size_t len);
87 
95 void cc2420_fifo_read(const cc2420_t *dev, uint8_t *data, const size_t len);
96 
104 void cc2420_fifo_write(const cc2420_t *dev, uint8_t *data, const size_t len);
105 
109 uint8_t cc2420_status(cc2420_t *dev);
110 
114 uint8_t cc2420_state(cc2420_t *dev);
115 
119 void cc2420_en_xosc(cc2420_t *dev);
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* CC2420_INTERNAL_H */
126 
Interface definition for the CC2420 driver.
uint8_t cc2420_state(cc2420_t *dev)
Get the device&#39;s current state.
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.
uint16_t cc2420_reg_read(const cc2420_t *dev, const uint8_t addr)
Read from a register at address addr from device dev.
uint8_t cc2420_status(cc2420_t *dev)
Get the device&#39;s status byte.
void cc2420_en_xosc(cc2420_t *dev)
Enable on-board oscillator.
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_fifo_write(const cc2420_t *dev, uint8_t *data, const size_t len)
Writes FIFO buffer to RAM at address 0x000.
Device descriptor for CC2420 radio devices.
Definition: cc2420.h:92
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_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.