Crate ashv2

Crate ashv2 

Source
Expand description

Asynchronous Serial Host version 2 (ASHv2)

This library implements the Asynchronous Serial Host version 2, ASHv2 for short.

You can find the protocol’s definition on siliconlabs.com.

This library is free software and is not affiliated with Silicon Labs.

Modules§

headers
Header types for frames that do not have a constant header value.

Structs§

Ack
Acknowledgement (ACK) frame.
Data
A data frame.
Error
Error frame.
FrameBuffer
A buffer for reading and writing ASH frames.
HexSlice
A wrapper around a slice of bytes to format it with hexadecimal bytes.
Nak
Negative Acknowledgement (NAK) frame.
Rst
Requests the NCP to perform a software reset (valid even if the NCP is in the FAILED state).
RstAck
A reset acknowledgment (RST_ACK) frame.
Transceiver
ASHv2 transceiver.
WrappingU3
A three bit number.

Enums§

BaudRate
Available baud rates that the NCP can operate on.
Code
Reset and error codes.
ControlByte
Control bytes used in the ASHv2 protocol.
Frame
Available frame types.
Status
ASHv2 connection status.

Constants§

CRC
CRC-16-IBM-3740 checksum function.
MAX_FRAME_SIZE
In the wost-case, all frame bytes are stuffed (*2) and we append the FLAG byte (+1).
MAX_PAYLOAD_SIZE
The maximum payload size of an ASHv2 DATA frame.
MIN_PAYLOAD_SIZE
The minimum payload size of an ASHv2 DATA frame.

Traits§

Mask
Mask bytes with pseudo-random numbers.
Stuffing
Stuff and un-stuff bytes.
Validate
A trait for checksum based data validation.

Functions§

open
Opens a serial port depending on the local operating system.

Type Aliases§

Payload
A stack-allocated buffer that can hold payload for an ASHv2 DATA frame up to its maximum size.
RawFrame
A stack-allocated buffer that can hold bytes of an ASHv2 frame up to its maximum size with stuffing.