The friendly Operating System for the Internet of Things
cc110x-spi.h File Reference

CC110X SPI functions. More...

Detailed Description

#include <stdint.h>
+ Include dependency graph for cc110x-spi.h:

Go to the source code of this file.

Functions

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) More...
 
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) More...
 
void cc110x_write_reg (cc110x_t *dev, uint8_t addr, uint8_t value)
 Write one byte to a register. More...
 
uint8_t cc110x_read_reg (cc110x_t *dev, uint8_t addr)
 Read a byte from register. More...
 
uint8_t cc110x_get_reg_robust (cc110x_t *dev, uint8_t addr)
 Read a byte from register, robust version. More...
 
uint8_t cc110x_read_status (cc110x_t *dev, uint8_t addr)
 Read state of a register. More...
 
uint8_t cc110x_strobe (cc110x_t *dev, uint8_t c)
 Sends a command strobe. More...
 
void cc110x_cs (cc110x_t *dev)
 Pull CS to low and wait for CC110x stabilization. More...
 

Function Documentation

void cc110x_cs ( cc110x_t dev)
Parameters
devDevice to work on
uint8_t cc110x_get_reg_robust ( cc110x_t dev,
uint8_t  addr 
)

Datasheet states some registered should be read twice until it returns the same value.

Parameters
devDevice to work on
addrSource register
Returns
Read state and value of register
uint8_t cc110x_read_reg ( cc110x_t dev,
uint8_t  addr 
)
Parameters
devDevice to work on
addrSource register
Returns
Read state and value of register
uint8_t cc110x_read_status ( cc110x_t dev,
uint8_t  addr 
)
Parameters
devDevice to work on
addrSource register
Returns
State of register
void cc110x_readburst_reg ( cc110x_t dev,
uint8_t  addr,
char *  buffer,
uint8_t  count 
)
Parameters
devDevice to work on
addrSource register
bufferBuffer to store read data
countSize of data to be read
uint8_t cc110x_strobe ( cc110x_t dev,
uint8_t  c 
)
Parameters
devDevice to work on
cCommand code
Returns
Command response
void cc110x_write_reg ( cc110x_t dev,
uint8_t  addr,
uint8_t  value 
)
Parameters
devDevice to work on
addrDestinatoin register
valueNew value
void cc110x_writeburst_reg ( cc110x_t dev,
uint8_t  addr,
const char *  buffer,
uint8_t  count 
)
Parameters
devDevice to work on
addrDestination register
bufferData to be written
countSize of data