Enum erdnuss_comms::CmdAddr
source · #[non_exhaustive]pub enum CmdAddr {
SelectAddr(u8),
ReplyFromAddr(u8),
DiscoveryOffer(u8),
DiscoveryClaim(u8),
DiscoverySuccess(u8),
}
Expand description
Command + Address byte
CmdAddr is a combined Command and Address byte. It consists of:
- 3 command-bits (
0..=7
) - 5 address-bits (
0..=31
)
The command bits are most significant, and the address bits are least
significant, e.g. 0bCCC_AAAAA
, where C are command bits and A are
address bits.
The address bits are the logical address of the target, which may be a source or destination, depending on the message kind.
Commands 1, 2, 4, 5, and 7 are assigned as described below. Commands 0, 3, and 6 are reserved for future use, and currently considered invalid.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SelectAddr(u8)
Select - 0b001
Used when the Controller is addressing a Target.
ReplyFromAddr(u8)
Reply - 0b010
Used when the Target is responding to the Controller.
DiscoveryOffer(u8)
Discovery Offer - 0b100
Used when the Controller is offering an unused logical address to Targets without one. The offered address is the one in the 5-bit address field.
DiscoveryClaim(u8)
Discovery Claim - 0b0101
Used when a Target attempts to claim a Discovery Offer message.
DiscoverySuccess(u8)
Discovery Success - 0b111
used when the Controller is informing a Target that its address claim is (tentatively) successful. The Target must respond to this message with an empty Reply.