The friendly Operating System for the Internet of Things
cc110x-spi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  * Copyright (C) 2013 INRIA
4  * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
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 
23 #ifndef CC110X_SPI_H
24 #define CC110X_SPI_H
25 
26 #include <stdint.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
40 void cc110x_writeburst_reg(cc110x_t *dev, uint8_t addr, const char *buffer, uint8_t count);
41 
50 void cc110x_readburst_reg(cc110x_t *dev, uint8_t addr, char *buffer, uint8_t count);
51 
59 void cc110x_write_reg(cc110x_t *dev, uint8_t addr, uint8_t value);
60 
69 uint8_t cc110x_read_reg(cc110x_t *dev, uint8_t addr);
70 
82 uint8_t cc110x_get_reg_robust(cc110x_t *dev, uint8_t addr);
83 
92 uint8_t cc110x_read_status(cc110x_t *dev, uint8_t addr);
93 
102 uint8_t cc110x_strobe(cc110x_t *dev, uint8_t c);
103 
109 void cc110x_cs(cc110x_t *dev);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
116 #endif /* CC110X_SPI_H */
uint8_t cc110x_read_status(cc110x_t *dev, uint8_t addr)
Read state of a register.
uint8_t cc110x_read_reg(cc110x_t *dev, uint8_t addr)
Read a byte from register.
Struct for holding cc110x device state.
Definition: cc110x.h:51
void cc110x_readburst_reg(cc110x_t *dev, uint8_t addr, char *buffer, uint8_t count)
Read a set of bytes using burst mode (if available)
void cc110x_cs(cc110x_t *dev)
Pull CS to low and wait for CC110x stabilization.
void cc110x_write_reg(cc110x_t *dev, uint8_t addr, uint8_t value)
Write one byte to a register.
uint8_t cc110x_strobe(cc110x_t *dev, uint8_t c)
Sends a command strobe.
uint8_t cc110x_get_reg_robust(cc110x_t *dev, uint8_t addr)
Read a byte from register, robust version.
void cc110x_writeburst_reg(cc110x_t *dev, uint8_t addr, const char *buffer, uint8_t count)
Write a set of bytes using burst mode (if available)