kw2xrf_spi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 PHYTEC Messtechnik GmbH
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
18 #ifndef KW2XRF_SPI_H
19 #define KW2XRF_SPI_H
20 
21 #include <stdio.h>
22 #include "board.h"
23 #include "cpu.h"
24 #include "periph/spi.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
38 int kw2xrf_spi_init(kw2xrf_t *dev);
39 
47 void kw2xrf_write_dreg(kw2xrf_t *dev, uint8_t addr, uint8_t value);
48 
56 uint8_t kw2xrf_read_dreg(kw2xrf_t *dev, uint8_t addr);
57 
66 void kw2xrf_write_dregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length);
67 
76 void kw2xrf_read_dregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length);
77 
85 void kw2xrf_write_ireg(kw2xrf_t *dev, uint8_t addr, uint8_t value);
86 
95 uint8_t kw2xrf_read_ireg(kw2xrf_t *dev, uint8_t addr);
96 
105 void kw2xrf_write_iregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length);
106 
115 void kw2xrf_read_iregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length);
116 
126 void kw2xrf_write_fifo(kw2xrf_t *dev, uint8_t *data, uint8_t data_length);
127 
137 void kw2xrf_read_fifo(kw2xrf_t *dev, uint8_t *data, uint8_t data_length);
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* KW2XRF_SPI_H */
144 
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.
kw2xrf_write_fifo
void kw2xrf_write_fifo(kw2xrf_t *dev, uint8_t *data, uint8_t data_length)
Writes multiple bytes to the kw2xrf fifo.
spi.h
Low-level SPI peripheral driver interface definition.
kw2xrf_write_dreg
void kw2xrf_write_dreg(kw2xrf_t *dev, uint8_t addr, uint8_t value)
Writes a byte to the kw2xrf register.
kw2xrf_read_dreg
uint8_t kw2xrf_read_dreg(kw2xrf_t *dev, uint8_t addr)
Reads a byte from the kw2xrf 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.
kw2xrf_write_dregs
void kw2xrf_write_dregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Writes to kw2xrf direct registers.
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.
kw2xrf_write_iregs
void kw2xrf_write_iregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Writes to kw2xrf indirect registers.
kw2xrf_spi_init
int kw2xrf_spi_init(kw2xrf_t *dev)
SPI interface initialization.
kw2xrf_read_ireg
uint8_t kw2xrf_read_ireg(kw2xrf_t *dev, uint8_t addr)
Reads a byte from the kw2xrf indirect register.
kw2xrf_t
Device descriptor for KW2XRF radio devices.
Definition: kw2xrf.h:125
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.