|
| 1 | +//! # Neotron BMC Commands |
| 2 | +//! |
| 3 | +//! Definitions of all the commands supported by the BMC. |
| 4 | +
|
| 5 | +#![no_std] |
| 6 | + |
| 7 | +#[derive(Debug, Copy, Clone, num_enum::IntoPrimitive, num_enum::TryFromPrimitive)] |
| 8 | +#[repr(u8)] |
| 9 | +pub enum Command { |
| 10 | + /// # Protocol Version |
| 11 | + /// The NBMC protocol version, [1, 0, 0] |
| 12 | + /// * Length: 3 |
| 13 | + /// * Mode: RO |
| 14 | + ProtocolVersion = 0x00, |
| 15 | + /// # Firmware Version |
| 16 | + /// The NBMC firmware version, as a null-padded UTF-8 string |
| 17 | + /// * Length: 32 |
| 18 | + /// * Mode: RO |
| 19 | + FirmwareVersion = 0x01, |
| 20 | + /// # Interrupt Status |
| 21 | + /// Which interrupts are currently active, as a bitmask. |
| 22 | + /// * Length: 2 |
| 23 | + /// * Mode: R/W1C |
| 24 | + InterruptStatus = 0x10, |
| 25 | + /// # Interrupt Control |
| 26 | + /// Which interrupts are currently enabled, as a bitmask. |
| 27 | + /// * Length: 2 |
| 28 | + /// * Mode: R/W |
| 29 | + InterruptControl = 0x11, |
| 30 | + /// # Button Status |
| 31 | + /// The current state of the buttons |
| 32 | + /// * Length: 1 |
| 33 | + /// * Mode: RO |
| 34 | + ButtonStatus = 0x20, |
| 35 | + /// # System Temperature |
| 36 | + /// Temperature in °C, as an `i8` |
| 37 | + /// * Length: 1 |
| 38 | + /// * Mode: RO |
| 39 | + SystemTemperature = 0x21, |
| 40 | + /// # System Voltage (Standby 3.3V rail) |
| 41 | + /// Voltage in Volts/32, as a `u8` |
| 42 | + /// * Length: 1 |
| 43 | + /// * Mode: RO |
| 44 | + SystemVoltage33S = 0x22, |
| 45 | + /// # System Voltage (Main 3.3V rail) |
| 46 | + /// Voltage in Volts/32, as a `u8` |
| 47 | + /// * Length: 1 |
| 48 | + /// * Mode: RO |
| 49 | + SystemVoltage33 = 0x23, |
| 50 | + /// # System Voltage (5.0V rail) |
| 51 | + /// Voltage in Volts/32, as a `u8` |
| 52 | + /// * Length: 1 |
| 53 | + /// * Mode: RO |
| 54 | + SystemVoltage55 = 0x24, |
| 55 | + /// # Power Control |
| 56 | + /// Enable/disable the power supply |
| 57 | + /// * Length: 1 |
| 58 | + /// * Mode: R/W |
| 59 | + PowerControl = 0x25, |
| 60 | + /// # UART Receive/Transmit Buffer |
| 61 | + /// Data received/to be sent over the UART |
| 62 | + /// * Length: up to 64 |
| 63 | + /// * Mode: FIFO |
| 64 | + UartBuffer = 0x30, |
| 65 | + /// # UART FIFO Control |
| 66 | + /// Settings for the UART FIFO |
| 67 | + /// * Length: 1 |
| 68 | + /// * Mode: R/W |
| 69 | + UartFifoControl = 0x31, |
| 70 | + /// # UART Control |
| 71 | + /// Settings for the UART |
| 72 | + /// * Length: 1 |
| 73 | + /// * Mode: R/W |
| 74 | + UartControl = 0x32, |
| 75 | + /// # UART Status |
| 76 | + /// The current state of the UART |
| 77 | + /// * Length: 1 |
| 78 | + /// * Mode: R/W1C |
| 79 | + UartStatus = 0x33, |
| 80 | + /// # UART Baud Rate |
| 81 | + /// The UART baud rate in bps, as a `u32le` |
| 82 | + /// * Length: 4 |
| 83 | + /// * Mode: R/W |
| 84 | + UartBaudRate = 0x34, |
| 85 | + /// # PS/2 Keyboard Receive/Transmit Buffer |
| 86 | + /// Data received/to be sent over the PS/2 keyboard port |
| 87 | + /// * Length: up to 16 |
| 88 | + /// * Mode: FIFO |
| 89 | + Ps2KbBuffer = 0x40, |
| 90 | + /// # PS/2 Keyboard Control |
| 91 | + /// Settings for the PS/2 Keyboard port |
| 92 | + /// * Length: 1 |
| 93 | + /// * Mode: R/W |
| 94 | + Ps2KbControl = 0x41, |
| 95 | + /// # PS/2 Keyboard Status |
| 96 | + /// Current state of the PS/2 Keyboard port |
| 97 | + /// * Length: 1 |
| 98 | + /// * Mode: R/W1C |
| 99 | + Ps2KbStatus = 0x42, |
| 100 | + /// # PS/2 Mouse Receive/Transmit Buffer |
| 101 | + /// Data received/to be sent over the PS/2 Mouse port |
| 102 | + /// * Length: up to 16 |
| 103 | + /// * Mode: FIFO |
| 104 | + Ps2MouseBuffer = 0x50, |
| 105 | + /// # PS/2 Mouse Control |
| 106 | + /// Settings for the PS/2 Mouse port |
| 107 | + /// * Length: 1 |
| 108 | + /// * Mode: R/W |
| 109 | + Ps2MouseControl = 0x51, |
| 110 | + /// # PS/2 Mouse Status |
| 111 | + /// Current state of the PS/2 Mouse port |
| 112 | + /// * Length: 1 |
| 113 | + /// * Mode: R/W1C |
| 114 | + Ps2MouseStatus = 0x52, |
| 115 | + /// # I²C Receive/Transmit Buffer |
| 116 | + /// Data received/to be sent over the I²C Bus |
| 117 | + /// * Length: up to 16 |
| 118 | + /// * Mode: FIFO |
| 119 | + I2cBuffer = 0x60, |
| 120 | + /// # I²C FIFO Control |
| 121 | + /// Settings for the I²C FIFO |
| 122 | + /// * Length: 1 |
| 123 | + /// * Mode: R/W |
| 124 | + I2cFifoControl = 0x61, |
| 125 | + /// # I²C Control |
| 126 | + /// Settings for the I²C Bus |
| 127 | + /// * Length: 1 |
| 128 | + /// * Mode: R/W |
| 129 | + I2cControl = 0x62, |
| 130 | + /// # I²C Status |
| 131 | + /// Current state of the I²C Bus |
| 132 | + /// * Length: 1 |
| 133 | + /// * Mode: R/W1C |
| 134 | + I2cStatus = 0x63, |
| 135 | + /// # I²C Baud Rate |
| 136 | + /// The I²C clock rate in Hz, as a `u32le` |
| 137 | + /// * Length: 4 |
| 138 | + /// * Mode: R/W |
| 139 | + I2cBaudRate = 0x64, |
| 140 | +} |
0 commit comments