use num_enum::{IntoPrimitive, TryFromPrimitive}; use strum_macros::{EnumString, EnumVariantNames};
pubconst START_BYTE: u8 = 0x5A;
// The default, minimum-required max packet size for any bootrom appears to be 32 bytes: (a command // packet with 7 parameters). // // RT500RM 18.7.2.6.5 Command packet: // "Parameters: The parameters are word-length (32 bits). With the default maximum packet size of // 32 bytes, a command packet can contain up to 7 parameters." // // RT500RM 18.7.2.11.1.3 HID Reports: // "minimum boot ROM packet size of 32 bytes" pubconst MIN_MAX_PACKET_SIZE: usize = 32;
#[derive(Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[repr(u8)] pubenum FramingPacketType { /// The previous packet was received successfully; the sending of more packets is allowed.
Ack = 0xA1,
/// The previous packet was corrupted and must be re-sent.
Nak = 0xA2,
/// Data phase is being aborted.
AckAbort = 0xA3,
/// The framing packet contains a command packet payload.
Command = 0xA4,
/// The framing packet contains a data packet payload.
Data = 0xA5,
/// Sent to verify the other side is alive. Also used for UART autobaud.
Ping = 0xA6,
/// A response to Ping; contains the framing protocol version number and options.
PingResponse = 0xA7,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.