slipdev.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-17 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef SLIPDEV_H
22 #define SLIPDEV_H
23 
24 #include <stdint.h>
25 
26 #include "cib.h"
27 #include "net/netdev.h"
28 #include "periph/uart.h"
29 #include "tsrb.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
43 #ifndef SLIPDEV_BUFSIZE
44 #define SLIPDEV_BUFSIZE (2048U)
45 #endif
46 
52 enum {
65 };
71 typedef struct {
73  uint32_t baudrate;
75 
81 typedef struct {
85  uint8_t rxmem[SLIPDEV_BUFSIZE];
90  uint8_t state;
91 } slipdev_t;
92 
99 void slipdev_setup(slipdev_t *dev, const slipdev_params_t *params);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* SLIPDEV_H */
106 
Low-level UART peripheral driver interface definition.
netdev_t netdev
parent class
Definition: slipdev.h:82
unsigned int uart_t
Define default UART type identifier.
Definition: uart.h:78
Definitions low-level network driver interface.
#define SLIPDEV_BUFSIZE
UART buffer size used for TX and RX buffers.
Definition: slipdev.h:44
uint8_t state
Device state.
Definition: slipdev.h:90
Configuration parameters for a slipdev.
Definition: slipdev.h:71
uart_t uart
UART interface the device is connected to.
Definition: slipdev.h:72
uint32_t baudrate
baudrate to use with slipdev_params_t::uart
Definition: slipdev.h:73
thread-safe ringbuffer struct
Definition: tsrb.h:40
Structure to hold driver state.
Definition: netdev.h:283
Device writes received data to stdin.
Definition: slipdev.h:64
Thread-safe ringbuffer interface definition.
void slipdev_setup(slipdev_t *dev, const slipdev_params_t *params)
Setup a slipdev device state.
Circular integer buffer interface.
tsrb_t inbuf
RX buffer.
Definition: slipdev.h:84
Device writes handles data as network device.
Definition: slipdev.h:60
Device descriptor for slipdev.
Definition: slipdev.h:81
slipdev_params_t config
configuration parameters
Definition: slipdev.h:83
Device is in no mode (currently did not receiving any data frame)
Definition: slipdev.h:56