Definition of KW2XRF SPI functions.
More...
Definition of KW2XRF SPI functions.
- 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"
Go to the source code of this file.
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...
|
|
◆ kw2xrf_read_dreg()
uint8_t kw2xrf_read_dreg |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr |
|
) |
| |
Reads a byte from the kw2xrf register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to read. |
- Returns
- Value of the register.
◆ kw2xrf_read_dregs()
void kw2xrf_read_dregs |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
length |
|
) |
| |
Reads a byte from the kw2xrf indirect register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to read. |
[in] | buf | Buffer, where the content of the reg shall be written to. |
[in] | length | Length of the register. |
◆ kw2xrf_read_fifo()
void kw2xrf_read_fifo |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t * |
data, |
|
|
uint8_t |
data_length |
|
) |
| |
Reads multiple bytes from the kw2xrf fifo.
- Parameters
-
[in] | dev | device descriptor |
[out] | data | A buffer to store the value of the fifo. |
[in] | data_length | The count of bytes which should be read. |
- Returns
- number of bytes read.
◆ kw2xrf_read_ireg()
uint8_t kw2xrf_read_ireg |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr |
|
) |
| |
Reads a byte from the kw2xrf indirect register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to read. |
- Returns
- value in the register
◆ kw2xrf_read_iregs()
void kw2xrf_read_iregs |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
length |
|
) |
| |
Reads a byte from the kw2xrf indirect register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to read. |
[in] | buf | Buffer, where the content of the reg shall be written to. |
[in] | length | Length of the register. |
◆ kw2xrf_spi_init()
SPI interface initialization.
- Parameters
-
- Returns
- 0 on success
-
-1 on error
◆ kw2xrf_write_dreg()
void kw2xrf_write_dreg |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t |
value |
|
) |
| |
Writes a byte to the kw2xrf register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to write. |
[in] | value | The value to write in the register. |
◆ kw2xrf_write_dregs()
void kw2xrf_write_dregs |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
length |
|
) |
| |
Writes to kw2xrf direct registers.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to write into. |
[in] | buf | Value that shall be written. |
[in] | length | Length of the register. |
◆ kw2xrf_write_fifo()
void kw2xrf_write_fifo |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t * |
data, |
|
|
uint8_t |
data_length |
|
) |
| |
Writes multiple bytes to the kw2xrf fifo.
- Parameters
-
[in] | dev | device descriptor |
[in] | data | A buffer with the value to write to the fifo. |
[in] | data_length | The count of bytes which should be written. |
- Returns
- number of bytes written.
◆ kw2xrf_write_ireg()
void kw2xrf_write_ireg |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t |
value |
|
) |
| |
Writes to a byte from the kw2xrf indirect register.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to write into. |
[in] | value | Value that shall be written. |
◆ kw2xrf_write_iregs()
void kw2xrf_write_iregs |
( |
kw2xrf_t * |
dev, |
|
|
uint8_t |
addr, |
|
|
uint8_t * |
buf, |
|
|
uint8_t |
length |
|
) |
| |
Writes to kw2xrf indirect registers.
- Parameters
-
[in] | dev | device descriptor |
[in] | addr | Address of the register to write into. |
[in] | buf | Value that shall be written. |
[in] | length | Length of the register. |