cc110x.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  * 2015 Kaspar Schleiser <kaspar@schleiser.de>
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
20 #ifndef CC110X_H
21 #define CC110X_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "periph/spi.h"
28 #include "periph/gpio.h"
29 #include "cc110x-internal.h"
30 #include "net/gnrc/nettype.h"
31 
35 typedef struct cc110x_params {
37  gpio_t cs;
38  gpio_t gdo0;
39  gpio_t gdo1;
40  gpio_t gdo2;
42 
46 typedef struct cc110x cc110x_t;
47 
51 struct cc110x {
57  uint8_t radio_state;
58  uint8_t radio_channel;
59  uint8_t radio_address;
62  void (*isr_cb)(cc110x_t *dev, void* arg);
63  void *isr_cb_arg;
64 #ifdef MODULE_GNRC_NETIF
65  gnrc_nettype_t proto;
66 #endif
67 };
68 
77 int cc110x_setup(cc110x_t *dev, const cc110x_params_t *params);
78 
88 int16_t cc110x_set_channel(cc110x_t *dev, uint8_t channr);
89 
90 
100 int cc110x_send(cc110x_t *dev, cc110x_pkt_t *packet);
101 
109 uint8_t cc110x_get_address(cc110x_t *dev);
110 
120 uint8_t cc110x_set_address(cc110x_t *dev, uint8_t address);
121 
122 
129 void cc110x_set_monitor(cc110x_t *dev, uint8_t mode);
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* CC110X_H */
136 
int16_t cc110x_set_channel(cc110x_t *dev, uint8_t channr)
Set cc110x channel number.
gpio_t gdo0
this
Definition: cc110x.h:38
Struct for holding cc110x IO parameters.
Definition: cc110x.h:35
Low-level GPIO peripheral driver interface definitions.
CC110X layer 0 protocol.
Struct for holding cc110x device state.
Definition: cc110x.h:51
gpio_t gdo1
look
Definition: cc110x.h:39
uint8_t radio_channel
current Radio channel
Definition: cc110x.h:58
void cc110x_set_monitor(cc110x_t *dev, uint8_t mode)
Set cc110x monitor mode setting.
cc110x_statistic_t cc110x_statistic
Statistic values for debugging.
Definition: cc110x.h:54
Low-level SPI peripheral driver interface definition.
gpio_t cs
does
Definition: cc110x.h:37
struct holding cc110x packet + metadata
uint8_t radio_state
Radio state.
Definition: cc110x.h:57
cc110x_params_t params
cc110x IO configuration
Definition: cc110x.h:52
int cc110x_setup(cc110x_t *dev, const cc110x_params_t *params)
Setup cc110x device parameters.
spi_t spi
what
Definition: cc110x.h:36
Statistic interface for debugging.
gpio_t gdo2
like
Definition: cc110x.h:40
struct cc110x_params cc110x_params_t
Struct for holding cc110x IO parameters.
uint8_t cc110x_set_address(cc110x_t *dev, uint8_t address)
Set cc110x radio address.
uint8_t radio_address
current Radio address
Definition: cc110x.h:59
uint8_t cc110x_get_address(cc110x_t *dev)
Set cc110x radio address.
void * isr_cb_arg
isr callback argument
Definition: cc110x.h:63
cc110x_pkt_buf_t pkt_buf
RX/TX buffer.
Definition: cc110x.h:61
gnrc_nettype_t
Definition of protocol types in the network stack.
Definition: nettype.h:42
void(* isr_cb)(cc110x_t *dev, void *arg)
isr callback
Definition: cc110x.h:62
Data structures and variables for the cc110x driver interface.
int cc110x_send(cc110x_t *dev, cc110x_pkt_t *packet)
Send raw cc110x packet.
Protocol type definitions.
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:105