-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathslip.h
More file actions
32 lines (24 loc) · 744 Bytes
/
Copy pathslip.h
File metadata and controls
32 lines (24 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __SLIP_H__
#define __SLIP_H__
#define SLIP_MTU 576 // Internet minimum MTU (RFC 791)
#define SLIP_MAX 1154 // SLIP_MTU * 2 + SLIP_END * 2
#define SLIP_END 0xc0
#define SLIP_ESC 0xdb
#define SLIP_ESC_END 0xdc
#define SLIP_ESC_ESC 0xdd
// #define BIOS_RX_BUF 0xFF83
#define BIOS_RX_BUFUSED 0xFFBE
// #define BIOS_RX_RDPTR 0xFFBF
// #define BIOS_RX_BUFSIZE 60
#define SLIP_DECODE_OK 0
#define SLIP_DECODE_SKIP 1
#define SLIP_DECODE_DONE 2
#define SLIP_DECODE_RST 3
#define slip_buffer_alloc() (calloc(SLIP_MAX, 1))
#define slip_rx_ready() (*(uint8_t *)BIOS_RX_BUFUSED > 0)
extern uint8_t *slip_rx_buffer;
extern uint8_t *slip_tx_buffer;
void slip_init(void);
void slip_rx(void);
void slip_tx(uint8_t *buffer, uint16_t len);
#endif