Enum Command

Source
#[repr(u8)]
pub enum Command {
Show 30 variants ProtocolVersion = 0, FirmwareVersion = 1, InterruptStatus = 16, InterruptControl = 17, ButtonStatus = 32, SystemTemperature = 33, SystemVoltage33S = 34, SystemVoltage33 = 35, SystemVoltage55 = 36, PowerControl = 37, UartBuffer = 48, UartFifoControl = 49, UartControl = 50, UartStatus = 51, UartBaudRate = 52, Ps2KbBuffer = 64, Ps2KbControl = 65, Ps2KbStatus = 66, Ps2MouseBuffer = 80, Ps2MouseControl = 81, Ps2MouseStatus = 82, I2cBuffer = 96, I2cFifoControl = 97, I2cControl = 98, I2cStatus = 99, I2cBaudRate = 100, SpeakerDuration = 112, SpeakerPeriodHigh = 113, SpeakerPeriodLow = 114, SpeakerDutyCycle = 115,
}

Variants§

§

ProtocolVersion = 0

§Protocol Version

The NBMC protocol version, [1, 0, 0]

  • Length: 3
  • Mode: RO
§

FirmwareVersion = 1

§Firmware Version

The NBMC firmware version, as a null-padded UTF-8 string

  • Length: 32
  • Mode: RO
§

InterruptStatus = 16

§Interrupt Status

Which interrupts are currently active, as a bitmask.

  • Length: 2
  • Mode: R/W1C
§

InterruptControl = 17

§Interrupt Control

Which interrupts are currently enabled, as a bitmask.

  • Length: 2
  • Mode: R/W
§

ButtonStatus = 32

§Button Status

The current state of the buttons

  • Length: 1
  • Mode: RO
§

SystemTemperature = 33

§System Temperature

Temperature in °C, as an i8

  • Length: 1
  • Mode: RO
§

SystemVoltage33S = 34

§System Voltage (Standby 3.3V rail)

Voltage in Volts/32, as a u8

  • Length: 1
  • Mode: RO
§

SystemVoltage33 = 35

§System Voltage (Main 3.3V rail)

Voltage in Volts/32, as a u8

  • Length: 1
  • Mode: RO
§

SystemVoltage55 = 36

§System Voltage (5.0V rail)

Voltage in Volts/32, as a u8

  • Length: 1
  • Mode: RO
§

PowerControl = 37

§Power Control

Enable/disable the power supply

  • Length: 1
  • Mode: R/W
§

UartBuffer = 48

§UART Receive/Transmit Buffer

Data received/to be sent over the UART

  • Length: up to 64
  • Mode: FIFO
§

UartFifoControl = 49

§UART FIFO Control

Settings for the UART FIFO

  • Length: 1
  • Mode: R/W
§

UartControl = 50

§UART Control

Settings for the UART

  • Length: 1
  • Mode: R/W
§

UartStatus = 51

§UART Status

The current state of the UART

  • Length: 1
  • Mode: R/W1C
§

UartBaudRate = 52

§UART Baud Rate

The UART baud rate in bps, as a u32le

  • Length: 4
  • Mode: R/W
§

Ps2KbBuffer = 64

§PS/2 Keyboard Receive/Transmit Buffer

Data received/to be sent over the PS/2 keyboard port

  • Length: up to 16
  • Mode: FIFO
§

Ps2KbControl = 65

§PS/2 Keyboard Control

Settings for the PS/2 Keyboard port

  • Length: 1
  • Mode: R/W
§

Ps2KbStatus = 66

§PS/2 Keyboard Status

Current state of the PS/2 Keyboard port

  • Length: 1
  • Mode: R/W1C
§

Ps2MouseBuffer = 80

§PS/2 Mouse Receive/Transmit Buffer

Data received/to be sent over the PS/2 Mouse port

  • Length: up to 16
  • Mode: FIFO
§

Ps2MouseControl = 81

§PS/2 Mouse Control

Settings for the PS/2 Mouse port

  • Length: 1
  • Mode: R/W
§

Ps2MouseStatus = 82

§PS/2 Mouse Status

Current state of the PS/2 Mouse port

  • Length: 1
  • Mode: R/W1C
§

I2cBuffer = 96

§I²C Receive/Transmit Buffer

Data received/to be sent over the I²C Bus

  • Length: up to 16
  • Mode: FIFO
§

I2cFifoControl = 97

§I²C FIFO Control

Settings for the I²C FIFO

  • Length: 1
  • Mode: R/W
§

I2cControl = 98

§I²C Control

Settings for the I²C Bus

  • Length: 1
  • Mode: R/W
§

I2cStatus = 99

§I²C Status

Current state of the I²C Bus

  • Length: 1
  • Mode: R/W1C
§

I2cBaudRate = 100

§I²C Baud Rate

The I²C clock rate in Hz, as a u32le

  • Length: 4
  • Mode: R/W
§

SpeakerDuration = 112

§Speaker Duration

Duration of note, in milliseconds

  • Length: 1
  • Mode: R/W
§

SpeakerPeriodHigh = 113

§Speaker Tone Period (High byte)

High byte of 16-bit period (in 48kHz ticks)

  • Length: 1
  • Mode: R/W
§

SpeakerPeriodLow = 114

§Speaker Tone Period (Low byte)

Low byte of 16-bit period (in 48kHz ticks)

  • Length: 1
  • Mode: R/W
§

SpeakerDutyCycle = 115

§Speaker Duty Cycle

Speaker Duty cycle, in 1/255

  • Length: 1
  • Mode: R/W

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Command> for u8

Source§

fn from(enum_value: Command) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<u8> for Command

Source§

type Error = TryFromPrimitiveError<Command>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for Command

Source§

const NAME: &'static str = "Command"

Source§

type Primitive = u8

Source§

fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>

Source§

impl Copy for Command

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.