slip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
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 
24 #ifndef GNRC_SLIP_H
25 #define GNRC_SLIP_H
26 
27 #include <inttypes.h>
28 
29 #include "net/gnrc.h"
30 #include "periph/uart.h"
31 #include "ringbuffer.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
43 #ifndef GNRC_SLIP_BUFSIZE
44 #define GNRC_SLIP_BUFSIZE (1500U)
45 #endif
46 
50 typedef struct {
54  char rx_mem[GNRC_SLIP_BUFSIZE];
55  uint32_t in_bytes;
57  uint16_t in_esc;
60 
64 typedef struct xbee_params {
66  uint32_t baudrate;
68 
84 kernel_pid_t gnrc_slip_init(gnrc_slip_dev_t *dev, uart_t uart, uint32_t baudrate,
85  char *stack, size_t stack_size, char priority);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* __SLIP_H */
92 
struct xbee_params gnrc_slip_params_t
auto_init struct holding SLIP initalization params
Ringbuffer header.
Low-level UART peripheral driver interface definition.
kernel_pid_t slip_pid
PID of the device thread.
Definition: slip.h:58
int16_t kernel_pid_t
Unique process identifier.
Definition: kernel_types.h:83
unsigned int uart_t
Define default UART type identifier.
Definition: uart.h:65
#define GNRC_SLIP_BUFSIZE
UART buffer size used for TX and RX buffers.
Definition: slip.h:44
ringbuffer_t in_buf
RX buffer.
Definition: slip.h:52
kernel_pid_t gnrc_slip_init(gnrc_slip_dev_t *dev, uart_t uart, uint32_t baudrate, char *stack, size_t stack_size, char priority)
Initializes a new SLIP control thread for UART device uart.
Ringbuffer.
Definition: ringbuffer.h:30
uart_t uart
the UART interface
Definition: slip.h:51
Includes all essential GNRC network stack base modules.
uint32_t baudrate
baudrate to use
Definition: slip.h:66
ringbuffer_t out_buf
TX buffer.
Definition: slip.h:53
Adds include for missing inttype definitions.
Device descriptor for SLIP devices.
Definition: slip.h:50
uart_t uart
UART interfaced the device is connected to.
Definition: slip.h:65
uint32_t in_bytes
the number of bytes received of a currently incoming packet
Definition: slip.h:55
uint16_t in_esc
receiver is in escape mode
Definition: slip.h:57
auto_init struct holding SLIP initalization params
Definition: slip.h:64