Skip to content

Commit 128cc66

Browse files
committed
feat: Implement modular workspace structure with HAL and platform abstractions
- Add HAL layers with strict safety guarantees: * hal/blocking - Blocking/synchronous HAL traits * hal/async - Async HAL traits * hal/nb - Non-blocking HAL traits * All HAL crates forbid unsafe code and require documentation - Add platform abstraction layer: * platform/traits - Core OS abstraction traits (empty, ready for future traits) * platform/impls/{linux,tock,hubris} - Platform-specific implementations * Enforces strict safety and documentation requirements - Add service layer scaffolding: * services/telemetry - Telemetry and monitoring service * services/storage - Persistent storage service - Add comprehensive build automation via cargo-xtask with precheckin validation - Remove git submodules in favor of direct dependencies when needed The workspace follows Rust best practices with clear separation of concerns between hardware abstraction, platform abstraction, and service layers.
1 parent 9fe5bb9 commit 128cc66

File tree

24 files changed

+280
-12
lines changed

24 files changed

+280
-12
lines changed

.gitmodules

Lines changed: 0 additions & 9 deletions
This file was deleted.

Cargo.lock

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,14 @@
44
members = [
55
"openprot",
66
"xtask",
7+
"hal/blocking",
8+
"hal/async",
9+
"hal/nb",
10+
"platform/traits",
11+
"platform/impls/linux",
12+
"platform/impls/tock",
13+
"platform/impls/hubris",
14+
"services/telemetry",
15+
"services/storage",
716
]
817
resolver = "2"

external/mctp-lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/pldm-lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/spdm-lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

hal/async/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Licensed under the Apache-2.0 license
2+
3+
[package]
4+
name = "openprot-hal-async"
5+
version = "0.1.0"
6+
edition = "2021"
7+
description = "Async HAL traits for OpenPRoT"
8+
license = "Apache-2.0"
9+
10+
[dependencies]
11+
embedded-hal-async = "1.0"

hal/async/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Licensed under the Apache-2.0 license
2+
3+
//! Async HAL traits for OpenPRoT
4+
//!
5+
//! This crate re-exports embedded-hal-async 1.0 traits for async/await-based
6+
//! hardware abstraction layer operations compatible with modern async runtimes.
7+
8+
#![no_std]
9+
#![forbid(unsafe_code)]
10+
#![deny(missing_docs)]
11+
12+
// Re-export embedded-hal-async 1.0 traits
13+
pub use embedded_hal_async::*;

hal/blocking/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Licensed under the Apache-2.0 license
2+
3+
[package]
4+
name = "openprot-hal-blocking"
5+
version = "0.1.0"
6+
edition = "2021"
7+
description = "Blocking/synchronous HAL traits for OpenPRoT"
8+
license = "Apache-2.0"
9+
10+
[dependencies]
11+
embedded-hal = "1.0"

hal/blocking/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Licensed under the Apache-2.0 license
2+
3+
//! Blocking/synchronous HAL traits for OpenPRoT
4+
//!
5+
//! This crate re-exports embedded-hal 1.0 traits for blocking hardware abstraction
6+
//! layer operations such as SPI, I2C, GPIO, and other hardware interfaces.
7+
8+
#![no_std]
9+
#![forbid(unsafe_code)]
10+
#![deny(missing_docs)]
11+
12+
// Re-export embedded-hal 1.0 traits
13+
pub use embedded_hal::delay::DelayNs;
14+
pub use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin};
15+
pub use embedded_hal::i2c::{I2c, SevenBitAddress, TenBitAddress};
16+
pub use embedded_hal::spi::{SpiBus, SpiDevice};

0 commit comments

Comments
 (0)