#include <stddef.h>
#include <stdint.h>
#include "isrpipe.h"
#include "periph/uart.h"
#include "mutex.h"
Go to the source code of this file.
|
- See also
- RFC 1055
|
#define | SLIPDEV_END (0xc0U) |
|
#define | SLIPDEV_ESC (0xdbU) |
|
#define | SLIPDEV_END_ESC (0xdcU) |
|
#define | SLIPDEV_ESC_ESC (0xddU) |
|
#define | SLIPDEV_STDIO_START (0x0aU) |
| Marker byte for beginning of stdio. More...
|
|
◆ SLIPDEV_STDIO_START
#define SLIPDEV_STDIO_START (0x0aU) |
Marker byte for beginning of stdio.
- See also
- taken from diagnostic transfer from SLIPMUX
Definition at line 48 of file slipdev_internal.h.
◆ slipdev_unstuff_readbyte()
unsigned slipdev_unstuff_readbyte |
( |
uint8_t * |
buf, |
|
|
uint8_t |
byte, |
|
|
bool * |
escaped |
|
) |
| |
Unstuffs a (SLIP-escaped) byte.
- Parameters
-
[out] | buf | The buffer to write to. It must at least be able to receive 1 byte. |
[in] | byte | The byte to unstuff. |
[in,out] | escaped | When set to false on in, byte will be read as though it was not escaped, when set to true it will be read as though it was escaped. On out it will be false unless byte was SLIPDEV_ESC . |
- Returns
- 0, when
byte
did not resolve to an actual byte
-
1, when
byte
resolves to an actual byte (or escaped
was set to true on in and resolves to a byte that was previously escaped).
◆ slipdev_write_byte()
static void slipdev_write_byte |
( |
uart_t |
uart, |
|
|
uint8_t |
byte |
|
) |
| |
|
inlinestatic |
Writes one byte to UART.
- Parameters
-
[in] | uart | The UART device to write to. |
[in] | byte | The byte to write to uart . |
Definition at line 68 of file slipdev_internal.h.
◆ slipdev_write_bytes()
void slipdev_write_bytes |
( |
uart_t |
uart, |
|
|
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
Write multiple bytes SLIP-escaped to UART.
- Parameters
-
[in] | uart | The UART device to write to. |
[in] | data | The bytes to write SLIP-escaped to uart . |
[in] | len | Number of bytes in data . |