diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 43f7c78..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "external/spdm-lib"] - path = external/spdm-lib - url = git@github.com:OpenPRoT/spdm-lib.git -[submodule "external/pldm-lib"] - path = external/pldm-lib - url = git@github.com:OpenPRoT/pldm-lib.git -[submodule "external/mctp-lib"] - path = external/mctp-lib - url = git@github.com:OpenPRoT/mctp-lib.git diff --git a/Cargo.lock b/Cargo.lock index 623cf38..34fe644 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,10 +2,96 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal", + "nb", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + [[package]] name = "openprot" version = "0.1.0" +[[package]] +name = "openprot-hal-async" +version = "0.1.0" +dependencies = [ + "embedded-hal-async", +] + +[[package]] +name = "openprot-hal-blocking" +version = "0.1.0" +dependencies = [ + "embedded-hal", +] + +[[package]] +name = "openprot-hal-nb" +version = "0.1.0" +dependencies = [ + "embedded-hal-nb", + "nb", +] + +[[package]] +name = "openprot-platform-hubris" +version = "0.1.0" +dependencies = [ + "openprot-platform-traits", +] + +[[package]] +name = "openprot-platform-linux" +version = "0.1.0" +dependencies = [ + "openprot-platform-traits", +] + +[[package]] +name = "openprot-platform-tock" +version = "0.1.0" +dependencies = [ + "openprot-platform-traits", +] + +[[package]] +name = "openprot-platform-traits" +version = "0.1.0" + +[[package]] +name = "openprot-services-storage" +version = "0.1.0" + +[[package]] +name = "openprot-services-telemetry" +version = "0.1.0" + [[package]] name = "same-file" version = "1.0.6" diff --git a/Cargo.toml b/Cargo.toml index bdbafb8..34a542b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,14 @@ members = [ "openprot", "xtask", + "hal/blocking", + "hal/async", + "hal/nb", + "platform/traits", + "platform/impls/linux", + "platform/impls/tock", + "platform/impls/hubris", + "services/telemetry", + "services/storage", ] resolver = "2" diff --git a/external/mctp-lib b/external/mctp-lib deleted file mode 160000 index 23e6f7e..0000000 --- a/external/mctp-lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23e6f7e77d954e6bd3f71e0c7825376a4aa406e1 diff --git a/external/pldm-lib b/external/pldm-lib deleted file mode 160000 index 756c42a..0000000 --- a/external/pldm-lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 756c42aa51836161a775fc2dd0d09031b789f036 diff --git a/external/spdm-lib b/external/spdm-lib deleted file mode 160000 index 26996f2..0000000 --- a/external/spdm-lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 26996f258edb593fc276c35f45e6157447b7b631 diff --git a/hal/async/Cargo.toml b/hal/async/Cargo.toml new file mode 100644 index 0000000..71a2121 --- /dev/null +++ b/hal/async/Cargo.toml @@ -0,0 +1,11 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-hal-async" +version = "0.1.0" +edition = "2021" +description = "Async HAL traits for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +embedded-hal-async = "1.0" \ No newline at end of file diff --git a/hal/async/src/lib.rs b/hal/async/src/lib.rs new file mode 100644 index 0000000..6f9c4d6 --- /dev/null +++ b/hal/async/src/lib.rs @@ -0,0 +1,13 @@ +// Licensed under the Apache-2.0 license + +//! Async HAL traits for OpenPRoT +//! +//! This crate re-exports embedded-hal-async 1.0 traits for async/await-based +//! hardware abstraction layer operations compatible with modern async runtimes. + +#![no_std] +#![forbid(unsafe_code)] +#![deny(missing_docs)] + +// Re-export embedded-hal-async 1.0 traits +pub use embedded_hal_async::*; diff --git a/hal/blocking/Cargo.toml b/hal/blocking/Cargo.toml new file mode 100644 index 0000000..6671e98 --- /dev/null +++ b/hal/blocking/Cargo.toml @@ -0,0 +1,11 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-hal-blocking" +version = "0.1.0" +edition = "2021" +description = "Blocking/synchronous HAL traits for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +embedded-hal = "1.0" \ No newline at end of file diff --git a/hal/blocking/src/lib.rs b/hal/blocking/src/lib.rs new file mode 100644 index 0000000..fe1ce27 --- /dev/null +++ b/hal/blocking/src/lib.rs @@ -0,0 +1,16 @@ +// Licensed under the Apache-2.0 license + +//! Blocking/synchronous HAL traits for OpenPRoT +//! +//! This crate re-exports embedded-hal 1.0 traits for blocking hardware abstraction +//! layer operations such as SPI, I2C, GPIO, and other hardware interfaces. + +#![no_std] +#![forbid(unsafe_code)] +#![deny(missing_docs)] + +// Re-export embedded-hal 1.0 traits +pub use embedded_hal::delay::DelayNs; +pub use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin}; +pub use embedded_hal::i2c::{I2c, SevenBitAddress, TenBitAddress}; +pub use embedded_hal::spi::{SpiBus, SpiDevice}; diff --git a/hal/nb/Cargo.toml b/hal/nb/Cargo.toml new file mode 100644 index 0000000..973da74 --- /dev/null +++ b/hal/nb/Cargo.toml @@ -0,0 +1,12 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-hal-nb" +version = "0.1.0" +edition = "2021" +description = "Non-blocking HAL traits for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +embedded-hal-nb = "1.0" +nb = "1.0" \ No newline at end of file diff --git a/hal/nb/src/lib.rs b/hal/nb/src/lib.rs new file mode 100644 index 0000000..76cb0a0 --- /dev/null +++ b/hal/nb/src/lib.rs @@ -0,0 +1,14 @@ +// Licensed under the Apache-2.0 license + +//! Non-blocking HAL traits for OpenPRoT +//! +//! This crate re-exports embedded-hal-nb 1.0 traits for non-blocking, polling-based +//! hardware abstraction layer operations using the `nb` crate for error handling. + +#![no_std] +#![forbid(unsafe_code)] +#![deny(missing_docs)] + +// Re-export nb and embedded-hal-nb 1.0 traits +pub use embedded_hal_nb::*; +pub use nb; diff --git a/platform/impls/hubris/Cargo.toml b/platform/impls/hubris/Cargo.toml new file mode 100644 index 0000000..f9b03cf --- /dev/null +++ b/platform/impls/hubris/Cargo.toml @@ -0,0 +1,11 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-platform-hubris" +version = "0.1.0" +edition = "2021" +description = "Hubris OS platform implementation for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +openprot-platform-traits = { path = "../../traits" } \ No newline at end of file diff --git a/platform/impls/hubris/src/lib.rs b/platform/impls/hubris/src/lib.rs new file mode 100644 index 0000000..935893a --- /dev/null +++ b/platform/impls/hubris/src/lib.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache-2.0 license + +//! Hubris OS platform implementation for OpenPRoT +//! +//! This crate provides Hubris OS-specific implementations of platform abstraction traits. + +#![no_std] diff --git a/platform/impls/linux/Cargo.toml b/platform/impls/linux/Cargo.toml new file mode 100644 index 0000000..f5c0fd9 --- /dev/null +++ b/platform/impls/linux/Cargo.toml @@ -0,0 +1,11 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-platform-linux" +version = "0.1.0" +edition = "2021" +description = "Linux platform implementation for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +openprot-platform-traits = { path = "../../traits" } \ No newline at end of file diff --git a/platform/impls/linux/src/lib.rs b/platform/impls/linux/src/lib.rs new file mode 100644 index 0000000..6ba7406 --- /dev/null +++ b/platform/impls/linux/src/lib.rs @@ -0,0 +1,5 @@ +// Licensed under the Apache-2.0 license + +//! Linux platform implementation for OpenPRoT +//! +//! This crate provides Linux-specific implementations of platform abstraction traits. diff --git a/platform/impls/tock/Cargo.toml b/platform/impls/tock/Cargo.toml new file mode 100644 index 0000000..5ebc54e --- /dev/null +++ b/platform/impls/tock/Cargo.toml @@ -0,0 +1,11 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-platform-tock" +version = "0.1.0" +edition = "2021" +description = "Tock OS platform implementation for OpenPRoT" +license = "Apache-2.0" + +[dependencies] +openprot-platform-traits = { path = "../../traits" } \ No newline at end of file diff --git a/platform/impls/tock/src/lib.rs b/platform/impls/tock/src/lib.rs new file mode 100644 index 0000000..98d4aa5 --- /dev/null +++ b/platform/impls/tock/src/lib.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache-2.0 license + +//! Tock OS platform implementation for OpenPRoT +//! +//! This crate provides Tock OS-specific implementations of platform abstraction traits. + +#![no_std] diff --git a/platform/traits/Cargo.toml b/platform/traits/Cargo.toml new file mode 100644 index 0000000..1a51439 --- /dev/null +++ b/platform/traits/Cargo.toml @@ -0,0 +1,10 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-platform-traits" +version = "0.1.0" +edition = "2021" +description = "OS abstraction traits for OpenPRoT" +license = "Apache-2.0" + +[dependencies] \ No newline at end of file diff --git a/platform/traits/src/lib.rs b/platform/traits/src/lib.rs new file mode 100644 index 0000000..1a85e95 --- /dev/null +++ b/platform/traits/src/lib.rs @@ -0,0 +1,12 @@ +// Licensed under the Apache-2.0 license + +//! OS abstraction traits for OpenPRoT +//! +//! This crate defines the core OS abstraction traits that provide a uniform interface +//! for cross-platform compatibility across different operating systems and embedded platforms. + +#![no_std] +#![forbid(unsafe_code)] +#![deny(missing_docs)] + +// Platform abstraction traits will be defined here diff --git a/services/storage/Cargo.toml b/services/storage/Cargo.toml new file mode 100644 index 0000000..b5354df --- /dev/null +++ b/services/storage/Cargo.toml @@ -0,0 +1,10 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-services-storage" +version = "0.1.0" +edition = "2021" +description = "Persistent storage service and abstractions for OpenPRoT" +license = "Apache-2.0" + +[dependencies] \ No newline at end of file diff --git a/services/storage/src/lib.rs b/services/storage/src/lib.rs new file mode 100644 index 0000000..c5d58c3 --- /dev/null +++ b/services/storage/src/lib.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache-2.0 license + +//! Persistent storage service and abstractions for OpenPRoT +//! +//! This crate provides storage abstractions and persistence capabilities. + +#![no_std] diff --git a/services/telemetry/Cargo.toml b/services/telemetry/Cargo.toml new file mode 100644 index 0000000..b6aad4d --- /dev/null +++ b/services/telemetry/Cargo.toml @@ -0,0 +1,10 @@ +# Licensed under the Apache-2.0 license + +[package] +name = "openprot-services-telemetry" +version = "0.1.0" +edition = "2021" +description = "Telemetry, monitoring, and logging service for OpenPRoT" +license = "Apache-2.0" + +[dependencies] \ No newline at end of file diff --git a/services/telemetry/src/lib.rs b/services/telemetry/src/lib.rs new file mode 100644 index 0000000..7255b37 --- /dev/null +++ b/services/telemetry/src/lib.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache-2.0 license + +//! Telemetry, monitoring, and logging service for OpenPRoT +//! +//! This crate provides telemetry collection and monitoring capabilities. + +#![no_std]