ethos.h¶
Interface definition for the ethernet-over-serial module.
-
ETHOS_FRAME_DELIMITER¶ 1
(0x7E)
-
ETHOS_ESC_CHAR¶ 1
(0x7D)
-
ETHOS_FRAME_TYPE_DATA¶ 1
(0x0)
-
ETHOS_FRAME_TYPE_TEXT¶ 1
(0x1)
-
ETHOS_FRAME_TYPE_HELLO¶ 1
(0x2)
-
ETHOS_FRAME_TYPE_HELLO_REPLY¶ 1
(0x3)
-
enum
line_state_t¶ - WAIT_FRAMESTART
- IN_FRAME
- IN_ESCAPE
-
void
ethos_setup(ethos_t * dev, const ethos_params_t * params)¶ Setup an ethos based device state.
The supplied buffer must have a power-of-two size, and it must be large enough for the largest expected packet + enough buffer space to buffer bytes that arrive while one packet is being handled.
E.g., if 1536b ethernet frames are expected, 2048 is probably a good size for
buf.Parameters
dev: handle of the device to initialize params: parameters for device initialization
-
void
ethos_send_frame(ethos_t * dev, const uint8_t * data,msp430_types.h::size_tlen, unsigned frame_type)¶ Send frame over serial port using ethos’ framing.
This is used by e.g., stdio over ethos to send text frames.
Parameters
dev: handle of the device to initialize data: ptr to data to be sent len: nr of bytes to send frame_type: frame type to use
-
struct
ethos_t¶ ethos netdev device
-
netdev.h::netdev_tnetdev¶ extended netdev structure
-
uart.h::uart_tuart¶ UART device the to use.
-
uint8_t
mac_addr()¶ this device’s MAC address
-
uint8_t
remote_mac_addr()¶ this device’s MAC address
-
tsrb.h::tsrb_tinbuf¶ ringbuffer for incoming data
-
ethos.h::line_state_tstate¶ Line status variable.
-
msp430_types.h::size_tframesize¶ size of currently incoming frame
-
unsigned
frametype¶ type of currently incoming frame
-
msp430_types.h::size_tlast_framesize¶ size of last completed frame
-
bool
accept_new¶ incoming frame can be stored or not
-
-
struct
ethos_params_t¶ Struct containing the needed configuration.
-
uart.h::uart_tuart¶ UART device to use.
-
uint32_t
baudrate¶ baudrate to UART device
-
uint8_t *
buf¶ buffer for incoming packets
-
msp430_types.h::size_tbufsize¶ size of
ethos.h::ethos_params_t::buf
-