kw2xrf_spi.h File Reference

Definition of KW2XRF SPI functions. More...

Detailed Description

Author
Johann Fischer j.fis.nosp@m.cher.nosp@m.@phyt.nosp@m.ec.d.nosp@m.e

Definition in file kw2xrf_spi.h.

#include <stdio.h>
#include "board.h"
#include "cpu.h"
#include "periph/spi.h"
#include "periph_conf.h"
+ Include dependency graph for kw2xrf_spi.h:

Go to the source code of this file.

Functions

int kw2xrf_spi_init (kw2xrf_t *dev)
 SPI interface initialization. More...
 
void kw2xrf_write_dreg (kw2xrf_t *dev, uint8_t addr, uint8_t value)
 Writes a byte to the kw2xrf register. More...
 
uint8_t kw2xrf_read_dreg (kw2xrf_t *dev, uint8_t addr)
 Reads a byte from the kw2xrf register. More...
 
void kw2xrf_write_dregs (kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
 Writes to kw2xrf direct registers. More...
 
void kw2xrf_read_dregs (kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
 Reads a byte from the kw2xrf indirect register. More...
 
void kw2xrf_write_ireg (kw2xrf_t *dev, uint8_t addr, uint8_t value)
 Writes to a byte from the kw2xrf indirect register. More...
 
uint8_t kw2xrf_read_ireg (kw2xrf_t *dev, uint8_t addr)
 Reads a byte from the kw2xrf indirect register. More...
 
void kw2xrf_write_iregs (kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
 Writes to kw2xrf indirect registers. More...
 
void kw2xrf_read_iregs (kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
 Reads a byte from the kw2xrf indirect register. More...
 
void kw2xrf_write_fifo (kw2xrf_t *dev, uint8_t *data, uint8_t data_length)
 Writes multiple bytes to the kw2xrf fifo. More...
 
void kw2xrf_read_fifo (kw2xrf_t *dev, uint8_t *data, uint8_t data_length)
 Reads multiple bytes from the kw2xrf fifo. More...
 

Function Documentation

uint8_t kw2xrf_read_dreg ( kw2xrf_t dev,
uint8_t  addr 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to read.
Returns
Value of the register.
void kw2xrf_read_dregs ( kw2xrf_t dev,
uint8_t  addr,
uint8_t *  buf,
uint8_t  length 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to read.
[in]bufBuffer, where the content of the reg shall be written to.
[in]lengthLength of the register.
void kw2xrf_read_fifo ( kw2xrf_t dev,
uint8_t *  data,
uint8_t  data_length 
)
Parameters
[in]devdevice descriptor
[out]dataA buffer to store the value of the fifo.
[in]data_lengthThe count of bytes which should be read.
Returns
number of bytes read.
uint8_t kw2xrf_read_ireg ( kw2xrf_t dev,
uint8_t  addr 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to read.
Returns
value in the register
void kw2xrf_read_iregs ( kw2xrf_t dev,
uint8_t  addr,
uint8_t *  buf,
uint8_t  length 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to read.
[in]bufBuffer, where the content of the reg shall be written to.
[in]lengthLength of the register.
int kw2xrf_spi_init ( kw2xrf_t dev)
Parameters
[in]devdevice descriptor
Returns
0 on success
-1 on error
void kw2xrf_write_dreg ( kw2xrf_t dev,
uint8_t  addr,
uint8_t  value 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to write.
[in]valueThe value to write in the register.
void kw2xrf_write_dregs ( kw2xrf_t dev,
uint8_t  addr,
uint8_t *  buf,
uint8_t  length 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to write into.
[in]bufValue that shall be written.
[in]lengthLength of the register.
void kw2xrf_write_fifo ( kw2xrf_t dev,
uint8_t *  data,
uint8_t  data_length 
)
Parameters
[in]devdevice descriptor
[in]dataA buffer with the value to write to the fifo.
[in]data_lengthThe count of bytes which should be written.
Returns
number of bytes written.
void kw2xrf_write_ireg ( kw2xrf_t dev,
uint8_t  addr,
uint8_t  value 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to write into.
[in]valueValue that shall be written.
void kw2xrf_write_iregs ( kw2xrf_t dev,
uint8_t  addr,
uint8_t *  buf,
uint8_t  length 
)
Parameters
[in]devdevice descriptor
[in]addrAddress of the register to write into.
[in]bufValue that shall be written.
[in]lengthLength of the register.