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 
void kw2xrf_write_fifo(kw2xrf_t *dev, uint8_t *data, uint8_t data_length)
Writes multiple bytes to the kw2xrf fifo.
uint8_t kw2xrf_read_dreg(kw2xrf_t *dev, uint8_t addr)
Reads a byte from the kw2xrf register.
void kw2xrf_read_dregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Reads a byte from the kw2xrf indirect register.
void kw2xrf_read_iregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Reads a byte from the kw2xrf indirect register.
Low-level SPI peripheral driver interface definition.
int kw2xrf_spi_init(kw2xrf_t *dev)
SPI interface initialization.
uint8_t kw2xrf_read_ireg(kw2xrf_t *dev, uint8_t addr)
Reads a byte from the kw2xrf indirect register.
void kw2xrf_read_fifo(kw2xrf_t *dev, uint8_t *data, uint8_t data_length)
Reads multiple bytes from the kw2xrf fifo.
stdio.h wrapper for MSP430
void kw2xrf_write_iregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Writes to kw2xrf indirect registers.
void kw2xrf_write_dreg(kw2xrf_t *dev, uint8_t addr, uint8_t value)
Writes a byte to the kw2xrf register.
void kw2xrf_write_ireg(kw2xrf_t *dev, uint8_t addr, uint8_t value)
Writes to a byte from the kw2xrf indirect register.
Device descriptor for KW2XRF radio devices.
Definition: kw2xrf.h:132
void kw2xrf_write_dregs(kw2xrf_t *dev, uint8_t addr, uint8_t *buf, uint8_t length)
Writes to kw2xrf direct registers.