Skip to content

Commit

Permalink
Merge branch 'release/v0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Dec 24, 2022
2 parents 8084e8d + aacd1ce commit 58c03ae
Show file tree
Hide file tree
Showing 13 changed files with 507 additions and 183 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased Changes

## v0.4.1

* Update dependencies (moves away from yanked critical-section 0.2.x)
* Fixes to the protocol documentation
* Add skeleton SPI command interface, with PS/2 Keyboard FIFO read command
* PS/2 Keyboard words time-out if you get a glitch

## v0.4.0

* Add very basic SPI interface support to neotron-bmc-pico
Expand Down
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[workspace]

# Include all the generic library crates
members = [
"neotron-bmc-protocol",
"neotron-bmc-commands"
]

# Exclude the BMC firmwares as they build using different targets/features
exclude = [
"neotron-bmc-pico",
"neotron-bmc-nucleo",
]
9 changes: 9 additions & 0 deletions neotron-bmc-commands/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "neotron-bmc-commands"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
num_enum = { version = "0.5", default-features=false }
140 changes: 140 additions & 0 deletions neotron-bmc-commands/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
//! # Neotron BMC Commands
//!
//! Definitions of all the commands supported by the BMC.

#![no_std]

#[derive(Debug, Copy, Clone, num_enum::IntoPrimitive, num_enum::TryFromPrimitive)]
#[repr(u8)]
pub enum Command {
/// # Protocol Version
/// The NBMC protocol version, [1, 0, 0]
/// * Length: 3
/// * Mode: RO
ProtocolVersion = 0x00,
/// # Firmware Version
/// The NBMC firmware version, as a null-padded UTF-8 string
/// * Length: 32
/// * Mode: RO
FirmwareVersion = 0x01,
/// # Interrupt Status
/// Which interrupts are currently active, as a bitmask.
/// * Length: 2
/// * Mode: R/W1C
InterruptStatus = 0x10,
/// # Interrupt Control
/// Which interrupts are currently enabled, as a bitmask.
/// * Length: 2
/// * Mode: R/W
InterruptControl = 0x11,
/// # Button Status
/// The current state of the buttons
/// * Length: 1
/// * Mode: RO
ButtonStatus = 0x20,
/// # System Temperature
/// Temperature in °C, as an `i8`
/// * Length: 1
/// * Mode: RO
SystemTemperature = 0x21,
/// # System Voltage (Standby 3.3V rail)
/// Voltage in Volts/32, as a `u8`
/// * Length: 1
/// * Mode: RO
SystemVoltage33S = 0x22,
/// # System Voltage (Main 3.3V rail)
/// Voltage in Volts/32, as a `u8`
/// * Length: 1
/// * Mode: RO
SystemVoltage33 = 0x23,
/// # System Voltage (5.0V rail)
/// Voltage in Volts/32, as a `u8`
/// * Length: 1
/// * Mode: RO
SystemVoltage55 = 0x24,
/// # Power Control
/// Enable/disable the power supply
/// * Length: 1
/// * Mode: R/W
PowerControl = 0x25,
/// # UART Receive/Transmit Buffer
/// Data received/to be sent over the UART
/// * Length: up to 64
/// * Mode: FIFO
UartBuffer = 0x30,
/// # UART FIFO Control
/// Settings for the UART FIFO
/// * Length: 1
/// * Mode: R/W
UartFifoControl = 0x31,
/// # UART Control
/// Settings for the UART
/// * Length: 1
/// * Mode: R/W
UartControl = 0x32,
/// # UART Status
/// The current state of the UART
/// * Length: 1
/// * Mode: R/W1C
UartStatus = 0x33,
/// # UART Baud Rate
/// The UART baud rate in bps, as a `u32le`
/// * Length: 4
/// * Mode: R/W
UartBaudRate = 0x34,
/// # PS/2 Keyboard Receive/Transmit Buffer
/// Data received/to be sent over the PS/2 keyboard port
/// * Length: up to 16
/// * Mode: FIFO
Ps2KbBuffer = 0x40,
/// # PS/2 Keyboard Control
/// Settings for the PS/2 Keyboard port
/// * Length: 1
/// * Mode: R/W
Ps2KbControl = 0x41,
/// # PS/2 Keyboard Status
/// Current state of the PS/2 Keyboard port
/// * Length: 1
/// * Mode: R/W1C
Ps2KbStatus = 0x42,
/// # PS/2 Mouse Receive/Transmit Buffer
/// Data received/to be sent over the PS/2 Mouse port
/// * Length: up to 16
/// * Mode: FIFO
Ps2MouseBuffer = 0x50,
/// # PS/2 Mouse Control
/// Settings for the PS/2 Mouse port
/// * Length: 1
/// * Mode: R/W
Ps2MouseControl = 0x51,
/// # PS/2 Mouse Status
/// Current state of the PS/2 Mouse port
/// * Length: 1
/// * Mode: R/W1C
Ps2MouseStatus = 0x52,
/// # I²C Receive/Transmit Buffer
/// Data received/to be sent over the I²C Bus
/// * Length: up to 16
/// * Mode: FIFO
I2cBuffer = 0x60,
/// # I²C FIFO Control
/// Settings for the I²C FIFO
/// * Length: 1
/// * Mode: R/W
I2cFifoControl = 0x61,
/// # I²C Control
/// Settings for the I²C Bus
/// * Length: 1
/// * Mode: R/W
I2cControl = 0x62,
/// # I²C Status
/// Current state of the I²C Bus
/// * Length: 1
/// * Mode: R/W1C
I2cStatus = 0x63,
/// # I²C Baud Rate
/// The I²C clock rate in Hz, as a `u32le`
/// * Length: 4
/// * Mode: R/W
I2cBaudRate = 0x64,
}
4 changes: 2 additions & 2 deletions neotron-bmc-nucleo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ edition = "2018"
version = "0.3.1"

[dependencies]
cortex-m = "0.7.1"
cortex-m = { version = "0.7.1", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7"
defmt = "0.3.0"
defmt-rtt = "0.3.0"
defmt-rtt = "0.4"
cortex-m-rtic = "1.0"
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
stm32f4xx-hal = { version = "0.11", features = ["stm32f401", "rt"] }
Expand Down
9 changes: 5 additions & 4 deletions neotron-bmc-pico/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ edition = "2018"
version = "0.4.0"

[dependencies]
cortex-m = { version = "0.7.5", features = ["inline-asm"] }
cortex-m = { version = "0.7.5", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rtic = "1.0"
debouncr = "0.2"
defmt = "0.3"
defmt-rtt = "0.3"
defmt-rtt = "0.4"
heapless= "0.7"
panic-probe = { version = "0.3", features = ["print-defmt"] }
stm32f0xx-hal = { version = "0.17", features = ["stm32f030x6", "rt"] }
neotron-bmc-protocol = { version = "0.1", path = "../neotron-bmc-protocol" }
stm32f0xx-hal = { version = "0.18", features = ["stm32f030x6", "rt"] }
neotron-bmc-protocol = { version = "0.1", path = "../neotron-bmc-protocol", features = ["defmt"] }
neotron-bmc-commands = { version = "0.1", path = "../neotron-bmc-commands" }
systick-monotonic = "1.0"
embedded-hal = "*"

Expand Down
2 changes: 1 addition & 1 deletion neotron-bmc-pico/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() {
// Generate a file containing the firmware version
let version_output = std::process::Command::new("git")
.current_dir(env::var_os("CARGO_MANIFEST_DIR").unwrap())
.args(&["describe", "--tags", "--all", "--dirty"])
.args(["describe", "--tags", "--all", "--dirty"])
.output()
.expect("running git-describe");
assert!(version_output.status.success());
Expand Down
Loading

0 comments on commit 58c03ae

Please sign in to comment.