diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 013c2c75..4ebe7e9d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -53,25 +53,23 @@ jobs: fmt: runs-on: ubuntu-latest - name: nightly / fmt + name: stable / fmt needs: commit_list strategy: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: submodules: true ref: ${{ matrix.commit }} - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly + - name: Install stable + uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: cargo fmt --check run: cargo fmt --check - working-directory: ${{ matrix.workdir }} clippy: runs-on: ubuntu-latest @@ -86,7 +84,6 @@ jobs: # Get early warning of new lints which are regularly introduced in beta channels. toolchain: [stable, beta] commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: @@ -102,7 +99,6 @@ jobs: with: reporter: 'github-pr-check' github_token: ${{ secrets.GITHUB_TOKEN }} - working-directory: ${{ matrix.workdir }} # Enable once we have a released crate # semver: @@ -136,7 +132,6 @@ jobs: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: @@ -150,7 +145,6 @@ jobs: cargo doc --no-deps -F defmt env: RUSTDOCFLAGS: --cfg docsrs - working-directory: ${{ matrix.workdir }} hack: # cargo-hack checks combinations of feature flags to ensure that features are all additive @@ -162,7 +156,6 @@ jobs: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: @@ -176,7 +169,6 @@ jobs: # --feature-powerset runs for every combination of features - name: cargo hack run: cargo hack --feature-powerset --mutually-exclusive-features=log,defmt check - working-directory: ${{ matrix.workdir }} deny: # cargo-deny checks licenses, advisories, sources, and bans for @@ -188,7 +180,6 @@ jobs: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: @@ -200,10 +191,27 @@ jobs: uses: EmbarkStudios/cargo-deny-action@v2 with: log-level: warn - manifest-path: ${{ matrix.workdir }}/Cargo.toml command: check arguments: --all-features + test: + runs-on: ubuntu-latest + name: ubuntu / stable / test + needs: commit_list + strategy: + fail-fast: false + matrix: + commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + ref: ${{ matrix.commit }} + - name: Install stable + uses: dtolnay/rust-toolchain@stable + - name: cargo test + run: cargo test + msrv: # check that we can build using the minimal rust version that is specified by this crate runs-on: ubuntu-latest @@ -214,13 +222,7 @@ jobs: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} - workdir: [ "embedded-service", "cfu-service", "espi-service", "hid-service", "power-button-service", "storage-bus", "battery-service"] - msrv: ["1.83"] # We're relying on namespaced-features, which - # was released in 1.60 - # - # We also depend on `fixed' which requires rust - # 1.79 - # Embassy requires 1.83 + msrv: ["1.85"] name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v4 @@ -235,4 +237,26 @@ jobs: run: | cargo check -F log cargo check -F defmt - working-directory: ${{ matrix.workdir }} + + check-examples: + runs-on: ubuntu-latest + needs: commit_list + # we use a matrix here just because env can't be used in job names + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability + strategy: + fail-fast: false + matrix: + commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} + example_directory: ["examples/rt633"] + name: ubuntu / check-examples + steps: + - uses: actions/checkout@v4 + with: + submodules: true + ref: ${{ matrix.commit }} + - name: Install stable + uses: dtolnay/rust-toolchain@stable + - name: cargo check + working-directory: ${{ matrix.example_directory }} + run: | + cargo check --target thumbv8m.main-none-eabihf diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 74315fa8..c5d16bf8 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -18,7 +18,6 @@ jobs: strategy: matrix: target: [thumbv8m.main-none-eabihf] - workdir: [ "embedded-service", "espi-service", "power-button-service", "storage-bus", "battery-service"] steps: - uses: actions/checkout@v4 with: @@ -27,6 +26,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }} + - name: cargo install cargo-hack + uses: taiki-e/install-action@cargo-hack - name: cargo check - run: cargo check --target ${{ matrix.target }} --no-default-features - working-directory: ${{ matrix.workdir }} + run: cargo hack --feature-powerset --mutually-exclusive-features=log,defmt check --target ${{ matrix.target }} diff --git a/.gitignore b/.gitignore index 196e176d..a3040a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk diff --git a/.vscode/settings.json b/.vscode/settings.json index a469ff3b..0660a219 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,18 +10,10 @@ }, "rust-analyzer.check.allTargets": false, "rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", + "rust-analyzer.cargo.features": [], "rust-analyzer.linkedProjects": [ - "${workspaceFolder}/embedded-service/Cargo.toml", - "${workspaceFolder}/espi-service/Cargo.toml", - "${workspaceFolder}/hid-service/Cargo.toml", - "${workspaceFolder}/power-button-service/Cargo.toml", - "${workspaceFolder}/power-policy-service/Cargo.toml", - "${workspaceFolder}/battery-service/Cargo.toml", - "${workspaceFolder}/examples/rt633/Cargo.toml", - "${workspaceFolder}/examples/rt685s-evk/Cargo.toml", - "${workspaceFolder}/examples/std/Cargo.toml", - "${workspaceFolder}/type-c-service/Cargo.toml", - ], - "rust-analyzer.cargo.features": [ + "examples/rt633/Cargo.toml", + "examples/rt685s-evk/Cargo.toml", + "examples/std/Cargo.toml" ] -} \ No newline at end of file +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..c9888eae --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1283 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "battery-service" +version = "0.1.0" +dependencies = [ + "defmt", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-batteries-async", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-services", + "log", +] + +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "bincode_derive", + "unty", +] + +[[package]] +name = "bincode_derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" +dependencies = [ + "virtue", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + +[[package]] +name = "bitfield" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bitfield-struct" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfu-service" +version = "0.1.0" +dependencies = [ + "defmt", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embedded-cfu-protocol", + "embedded-services", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "critical-section", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cortex-m-rt" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +dependencies = [ + "cortex-m-rt-macros", +] + +[[package]] +name = "cortex-m-rt-macros" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dd-manifest-tree" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5793572036e0a6638977c7370c6afc423eac848ee8495f079b8fd3964de7b9f9" +dependencies = [ + "yaml-rust2", +] + +[[package]] +name = "defmt" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" +dependencies = [ + "defmt-parser", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "defmt-parser" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" +dependencies = [ + "thiserror", +] + +[[package]] +name = "device-driver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c424cfcc4a418769975185d1d9066ad07fa05cb343fda8ea0adf98a9e9d195d2" +dependencies = [ + "defmt", + "device-driver-macros", + "embedded-io", + "embedded-io-async", +] + +[[package]] +name = "device-driver-generation" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86194cbb84f0bc87b08d6a0d2265a44251ab27620ae100b6b555d50b17878b3f" +dependencies = [ + "anyhow", + "bitvec", + "convert_case", + "dd-manifest-tree", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "device-driver-macros" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fa38c0ce9a825f21055f2e0cd033f47c366ab397cb892fdbf59df7be7cec353" +dependencies = [ + "device-driver-generation", + "proc-macro2", + "syn", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "document-features", + "embassy-executor-macros", + "log", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "defmt", + "log", +] + +[[package]] +name = "embassy-hal-internal" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "cortex-m", + "critical-section", + "defmt", + "num-traits", +] + +[[package]] +name = "embassy-imxrt" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embassy-imxrt#c0117f38d30f15a613923b015b5f3587a6278d4e" +dependencies = [ + "cfg-if", + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "document-features", + "embassy-futures", + "embassy-hal-internal", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embassy-time-queue-utils", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "fixed", + "mimxrt633s-pac", + "mimxrt685s-pac", + "nb 1.1.0", + "paste", + "rand_core", +] + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "cfg-if", + "critical-section", + "defmt", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "cfg-if", + "critical-section", + "defmt", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", + "log", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy#502c188cf4c08a1acf9d7095e790e0b5d77d3702" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] + +[[package]] +name = "embedded-batteries" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-batteries#1223e7093dea2c8ccdb72f8346b2b0a773eef97b" +dependencies = [ + "bitfield-struct", + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-batteries-async" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-batteries#1223e7093dea2c8ccdb72f8346b2b0a773eef97b" +dependencies = [ + "bitfield-struct", + "embedded-batteries", + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-cfu-protocol" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-cfu#3ae19bb02eee75eface86acd89dbdf3252ec907f" +dependencies = [ + "defmt", + "embedded-io-async", + "log", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[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 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" +dependencies = [ + "defmt", +] + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-services" +version = "0.1.0" +dependencies = [ + "bitfield 0.17.0", + "bitflags 2.9.0", + "cfg-if", + "chrono", + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "document-features", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-cfu-protocol", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "embedded-usb-pd", + "fixed", + "heapless 0.8.0", + "log", + "postcard", + "rand_core", + "serde", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "embedded-usb-pd" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#d91252d11f60cb6dabb123472ce23b7a745488d8" +dependencies = [ + "bitfield 0.18.1", + "defmt", + "embedded-hal-async", +] + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "espi-service" +version = "0.1.0" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "defmt", + "embassy-executor", + "embassy-imxrt", + "embassy-sync", + "embassy-time", + "embedded-services", + "log", +] + +[[package]] +name = "fixed" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" +dependencies = [ + "az", + "bytemuck", + "half", + "typenum", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "half" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "hid-service" +version = "0.1.0" +dependencies = [ + "defmt", + "embassy-sync", + "embassy-time", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-services", + "log", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "mimxrt633s-pac" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a1edd8317cebedee09f61910c2a5612576254367b1ca74375ee987b4db20df2" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "vcell", +] + +[[package]] +name = "mimxrt685s-pac" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c0b80e5add9dc74500acbb1ca70248e237d242b77988631e41db40a225f3a40" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "critical-section", + "defmt", + "vcell", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "serde", +] + +[[package]] +name = "power-button-service" +version = "0.1.0" +dependencies = [ + "defmt", + "embassy-time", + "embedded-hal 1.0.0", + "embedded-hal-async", + "log", +] + +[[package]] +name = "power-policy-service" +version = "0.1.0" +dependencies = [ + "defmt", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-services", + "log", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "storage_bus" +version = "0.1.1" +dependencies = [ + "defmt", + "embassy-executor", + "embassy-sync", + "embassy-time", + "embedded-services", + "log", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tps6699x" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/tps6699x#b2c807afaa11e69056481b2f88f0ab22af232ba2" +dependencies = [ + "bincode", + "defmt", + "device-driver", + "embassy-sync", + "embassy-time", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io-async", + "embedded-usb-pd", + "log", +] + +[[package]] +name = "type-c-service" +version = "0.1.0" +dependencies = [ + "bitfield 0.17.0", + "defmt", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io-async", + "embedded-services", + "embedded-usb-pd", + "log", + "tps6699x", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yaml-rust2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..62e5375e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,55 @@ +[workspace] +resolver = "2" +members = [ + "battery-service", + "cfu-service", + "embedded-service", + "espi-service", + "hid-service", + "power-button-service", + "power-policy-service", + "storage-bus", + "type-c-service", +] +exclude = ["examples/*"] + +[workspace.package] +version = "0.1.0" +edition = "2021" +license = "MIT" +repository = "https://github.com/OpenDevicePartnership/embedded-services" + +[workspace.dependencies] +bitfield = "0.17.0" +bitflags = "2.8.0" +cfg-if = "1.0.0" +chrono = { version = "0.4", default-features = false } +cortex-m = "0.7.6" +cortex-m-rt = "0.7.5" +critical-section = "1.1" +defmt = "0.3" +document-features = "0.2.7" +embassy-executor = { git = "https://github.com/embassy-rs/embassy" } +embassy-futures = { git = "https://github.com/embassy-rs/embassy" } +embassy-imxrt = { git = "https://github.com/OpenDevicePartnership/embassy-imxrt" } +embassy-sync = { git = "https://github.com/embassy-rs/embassy" } +embassy-time = { git = "https://github.com/embassy-rs/embassy" } +embassy-time-driver = { git = "https://github.com/embassy-rs/embassy" } +embedded-batteries-async = { git = "https://github.com/OpenDevicePartnership/embedded-batteries" } +embedded-cfu-protocol = { git = "https://github.com/OpenDevicePartnership/embedded-cfu" } +embedded-hal = "1.0" +embedded-hal-async = "1.0" +embedded-hal-nb = "1.0" +embedded-io = "0.6.1" +embedded-io-async = "0.6.1" +embedded-services = { path = "./embedded-service" } +embedded-storage = "0.3" +embedded-storage-async = "0.4.1" +embedded-usb-pd = { git = "https://github.com/OpenDevicePartnership/embedded-usb-pd", default-features = false } +fixed = "1.23.1" +heapless = "0.8.*" +log = "0.4" +postcard = "1.*" +rand_core = "0.6.4" +serde = { version = "1.0.*", default-features = false } +tps6699x = { git = "https://github.com/OpenDevicePartnership/tps6699x" } diff --git a/battery-service/Cargo.toml b/battery-service/Cargo.toml index 2b946c46..86eb975b 100644 --- a/battery-service/Cargo.toml +++ b/battery-service/Cargo.toml @@ -4,21 +4,20 @@ version = "0.1.0" edition = "2021" description = "Battery fuel gauge and charger embedded service implementation" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy" } -embedded-hal-async = { version = "1.0" } -embedded-hal = { package = "embedded-hal", version = "1.0" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4", optional = true } - -embedded-batteries-async = { git = "https://github.com/OpenDevicePartnership/embedded-batteries" } +defmt = { workspace = true, optional = true } +embassy-executor.workspace = true +embassy-futures.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-batteries-async.workspace = true +embedded-hal-async.workspace = true +embedded-hal.workspace = true +embedded-services.workspace = true +log = { workspace = true, optional = true } [features] default = [] diff --git a/cfu-service/Cargo.toml b/cfu-service/Cargo.toml index fb2b1227..3096f626 100644 --- a/cfu-service/Cargo.toml +++ b/cfu-service/Cargo.toml @@ -5,17 +5,14 @@ edition = "2021" license = "MIT" [dependencies] -# ODP dependencies -embedded-cfu-protocol = { git = "https://github.com/OpenDevicePartnership/embedded-cfu" } -embedded-services = { path = "../embedded-service" } - -# External dependencies -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } -log = { version = "0.4.14", optional = true } -defmt = { version = "0.3", optional = true } -heapless = "0.8.*" +defmt = { workspace = true, optional = true } +embassy-executor.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-cfu-protocol.workspace = true +embedded-services.workspace = true +heapless.workspace = true +log = { workspace = true, optional = true } [features] default = [] diff --git a/deny.toml b/deny.toml index 4962c33c..07fcabd8 100644 --- a/deny.toml +++ b/deny.toml @@ -94,10 +94,9 @@ allow = [ "MIT", "Apache-2.0", "Unicode-DFS-2016", - + "BSD-3-Clause", # unicode-ident 1.0.14 switched from Unicode-DFS-2016 to Unicode-3.0 license. "Unicode-3.0", - #"Apache-2.0 WITH LLVM-exception", ] # The confidence threshold for detecting a license from license text. # The higher the value, the more closely the license text must be to the diff --git a/embedded-service/Cargo.toml b/embedded-service/Cargo.toml index 7befe68e..20756003 100644 --- a/embedded-service/Cargo.toml +++ b/embedded-service/Cargo.toml @@ -5,53 +5,42 @@ edition = "2021" license = "MIT" description = "Embedded Service Layer for IPC, Feature Customization and Extension in Embedded Devices." repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" [dependencies] -embedded-cfu-protocol = { git = "https://github.com/OpenDevicePartnership/embedded-cfu" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-time-driver = { git = "https://github.com/embassy-rs/embassy", optional = true } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } - -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } -nb = "1.0.0" -cfg-if = "1.0.0" -cortex-m-rt = ">=0.6.15,<0.8" -cortex-m = "0.7.6" -critical-section = "1.1" -chrono = { version = "0.4", default-features = false, optional = true } -embedded-io = { version = "0.6.1" } -embedded-io-async = { version = "0.6.1" } -embedded-storage = { version = "0.3" } -embedded-storage-async = { version = "0.4.1" } -rand_core = "0.6.4" -fixed = "1.23.1" -heapless = "0.8.*" - -postcard = "1.*" -serde = { version = "1.0.*", default-features = false } - -embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ - "unproven", -] } -embedded-hal-1 = { package = "embedded-hal", version = "1.0" } -embedded-hal-async = { version = "1.0" } -embedded-hal-nb = { version = "1.0" } -embedded-usb-pd = { git = "https://github.com/OpenDevicePartnership/embedded-usb-pd" } - -document-features = "0.2.7" - -bitfield = "0.17.0" -bitflags = "2.8.0" +bitfield.workspace = true +bitflags.workspace = true +cfg-if.workspace = true +chrono = { workspace = true, optional = true } +critical-section.workspace = true +defmt = { workspace = true, optional = true } +document-features.workspace = true +embassy-executor.workspace = true +embassy-futures.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-cfu-protocol.workspace = true +embedded-hal-async.workspace = true +embedded-hal-nb.workspace = true +embedded-io-async.workspace = true +embedded-io.workspace = true +embedded-storage-async.workspace = true +embedded-storage.workspace = true +embedded-usb-pd.workspace = true +fixed.workspace = true +heapless.workspace = true +log = { workspace = true, optional = true } +postcard.workspace = true +rand_core.workspace = true +serde.workspace = true + +[target.'cfg(target_os = "none")'.dependencies] +cortex-m-rt.workspace = true +cortex-m.workspace = true [dev-dependencies] -embassy-sync = { git = "https://github.com/embassy-rs/embassy", features = [ - "std", -] } -embassy-futures = { git = "https://github.com/embassy-rs/embassy" } +embassy-sync = { workspace = true, features = ["std"] } +embassy-futures.workspace = true [features] default = [] diff --git a/espi-service/Cargo.toml b/espi-service/Cargo.toml index 0fea0894..b8f773db 100644 --- a/espi-service/Cargo.toml +++ b/espi-service/Cargo.toml @@ -4,39 +4,47 @@ version = "0.1.0" edition = "2021" description = "eSPI embedded service implementation" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } -embassy-imxrt = { git = "https://github.com/OpenDevicePartnership/embassy-imxrt", features = [ - "defmt", +embedded-services.workspace = true +defmt = { workspace = true, optional = true } +log = { workspace = true, optional = true } +embassy-time.workspace = true +embassy-sync.workspace = true +embassy-imxrt = { workspace = true, features = [ "time-driver", "time", "mimxrt633s", ] } -embassy-executor = { git = "https://github.com/embassy-rs/embassy", features = [ - "arch-cortex-m", +embassy-executor = { workspace = true, features = [ "executor-thread", "executor-interrupt", - "defmt", ] } -cortex-m = { version = "0.7.7", features = [ + +[target.'cfg(target_os = "none")'.dependencies] +embassy-executor = { workspace = true, features = [ + "executor-thread", + "executor-interrupt", + "arch-cortex-m", +] } +cortex-m-rt.workspace = true +cortex-m = { workspace = true, features = [ "inline-asm", "critical-section-single-core", ] } -cortex-m-rt = "0.7.3" [features] -default = ["defmt"] +default = [] defmt = [ "dep:defmt", "embedded-services/defmt", "embassy-time/defmt", "embassy-time/defmt-timestamp-uptime", "embassy-sync/defmt", + "embassy-imxrt/defmt", + "embassy-executor/defmt", ] + +log = ["dep:log", "embedded-services/log", "embassy-time/log"] diff --git a/espi-service/rustfmt.toml b/espi-service/rustfmt.toml index 9eb3c3b4..75306517 100644 --- a/espi-service/rustfmt.toml +++ b/espi-service/rustfmt.toml @@ -1,3 +1 @@ -group_imports = "StdExternalCrate" -imports_granularity = "Module" max_width = 120 diff --git a/examples/rt633/Cargo.toml b/examples/rt633/Cargo.toml index d92ec09e..fa6c53b8 100644 --- a/examples/rt633/Cargo.toml +++ b/examples/rt633/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "rt633-examples" version = "0.1.0" @@ -35,14 +37,13 @@ embassy-time = { git = "https://github.com/embassy-rs/embassy", features = [ "defmt", "defmt-timestamp-uptime", ] } -embedded-hal-1 = { package = "embedded-hal", version = "1.0" } embedded-hal-async = "1.0.0" futures = { version = "0.3.30", default-features = false, features = [ "async-await", ] } mimxrt600-fcb = "0.2.0" rand = { version = "0.8.5", default-features = false } -espi-service = { path = "../../espi-service" } +espi-service = { path = "../../espi-service", features = ["defmt"] } embedded-services = { path = "../../embedded-service", features = ["defmt"] } battery-service = { path = "../../battery-service", features = ["defmt"] } diff --git a/examples/rt633/rustfmt.toml b/examples/rt633/rustfmt.toml index 9eb3c3b4..75306517 100644 --- a/examples/rt633/rustfmt.toml +++ b/examples/rt633/rustfmt.toml @@ -1,3 +1 @@ -group_imports = "StdExternalCrate" -imports_granularity = "Module" max_width = 120 diff --git a/examples/rt633/src/bin/espi.rs b/examples/rt633/src/bin/espi.rs index 9b767f83..cb99515e 100644 --- a/examples/rt633/src/bin/espi.rs +++ b/examples/rt633/src/bin/espi.rs @@ -42,7 +42,7 @@ mod battery_service { let msg = message .data .get::() - .ok_or(comms::MailboxDelegateError::MessageNotFound); + .ok_or(comms::MailboxDelegateError::MessageNotFound)?; self.signal.signal(*msg); diff --git a/examples/rt685s-evk/Cargo.toml b/examples/rt685s-evk/Cargo.toml index fe153dfc..75b4a009 100644 --- a/examples/rt685s-evk/Cargo.toml +++ b/examples/rt685s-evk/Cargo.toml @@ -1,5 +1,7 @@ +[workspace] + [package] -name = "embedded-services-examples" +name = "rt685s-evk-example" version = "0.1.0" edition = "2021" license = "MIT" diff --git a/examples/std/Cargo.lock b/examples/std/Cargo.lock new file mode 100644 index 00000000..ce18a9d3 --- /dev/null +++ b/examples/std/Cargo.lock @@ -0,0 +1,1092 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "battery-service" +version = "0.1.0" +dependencies = [ + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-batteries-async", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-services", + "log", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" + +[[package]] +name = "bitfield" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7e6caee68becd795bfd65f1a026e4d00d8f0c2bc9be5eb568e1015f9ce3c34" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331afbb18ce7b644c0b428726d369c5dd37ca0b815d72a459fcc2896c3c8ad32" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bitfield-struct" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be5a46ba01b60005ae2c51a36a29cfe134bcacae2dd5cedcd4615fbaad1494b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "bytemuck" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfu-service" +version = "0.1.0" +dependencies = [ + "embassy-executor", + "embassy-sync", + "embassy-time", + "embedded-cfu-protocol", + "embedded-services", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cortex-m-rt" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" +dependencies = [ + "cortex-m-rt-macros", +] + +[[package]] +name = "cortex-m-rt-macros" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + +[[package]] +name = "embassy-executor" +version = "0.7.0" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", + "log", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "log", +] + +[[package]] +name = "embassy-sync" +version = "0.6.2" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-sink", + "futures-util", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embassy-time-queue-utils", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", + "log", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-utils" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy#3a3ab6cded53f84ffd6144840714d0631217df18" +dependencies = [ + "embassy-executor", + "heapless 0.8.0", +] + +[[package]] +name = "embedded-batteries" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-batteries#1223e7093dea2c8ccdb72f8346b2b0a773eef97b" +dependencies = [ + "bitfield-struct", + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-batteries-async" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-batteries#1223e7093dea2c8ccdb72f8346b2b0a773eef97b" +dependencies = [ + "bitfield-struct", + "embedded-batteries", + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-cfu-protocol" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-cfu#3ae19bb02eee75eface86acd89dbdf3252ec907f" +dependencies = [ + "embedded-io-async", + "log", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[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 1.0.0", +] + +[[package]] +name = "embedded-hal-mock" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a0f04f8886106faf281c47b6a0e4054a369baedaf63591fdb8da9761f3f379" +dependencies = [ + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-time", + "nb 1.1.0", + "void", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-services" +version = "0.1.0" +dependencies = [ + "bitfield 0.17.0", + "bitflags", + "cfg-if", + "cortex-m", + "cortex-m-rt", + "critical-section", + "document-features", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-cfu-protocol", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "embedded-storage", + "embedded-storage-async", + "embedded-usb-pd", + "fixed", + "heapless 0.8.0", + "log", + "postcard", + "rand_core", + "serde", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "embedded-time" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a4b4d10ac48d08bfe3db7688c402baadb244721f30a77ce360bd24c3dffe58" +dependencies = [ + "num", +] + +[[package]] +name = "embedded-usb-pd" +version = "0.1.0" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#d91252d11f60cb6dabb123472ce23b7a745488d8" +dependencies = [ + "bitfield 0.18.1", + "embedded-hal-async", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fixed" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707070ccf8c4173548210893a0186e29c266901b71ed20cd9e2ca0193dfe95c3" +dependencies = [ + "az", + "bytemuck", + "half", + "typenum", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "half" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" +dependencies = [ + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "heapless 0.7.17", + "serde", +] + +[[package]] +name = "power-policy-service" +version = "0.1.0" +dependencies = [ + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embedded-services", + "log", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "std-examples" +version = "0.1.0" +dependencies = [ + "battery-service", + "cfu-service", + "embassy-executor", + "embassy-futures", + "embassy-sync", + "embassy-time", + "embassy-time-driver", + "embedded-batteries-async", + "embedded-cfu-protocol", + "embedded-hal-async", + "embedded-hal-mock", + "embedded-services", + "embedded-usb-pd", + "env_logger", + "heapless 0.8.0", + "log", + "power-policy-service", + "static_cell", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index acb1c24f..ad106485 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml @@ -1,5 +1,7 @@ +[workspace] + [package] -name = "embedded-services-examples" +name = "std-examples" version = "0.1.0" edition = "2021" diff --git a/hid-service/Cargo.toml b/hid-service/Cargo.toml index 5c0febc9..d5782553 100644 --- a/hid-service/Cargo.toml +++ b/hid-service/Cargo.toml @@ -4,20 +4,20 @@ version = "0.1.0" edition = "2021" description = "HID embedded service implementation" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embedded-hal-async = { version = "1.0" } -embedded-hal = { package = "embedded-hal", version = "1.0" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } +defmt = { workspace = true, optional = true } +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-hal-async.workspace = true +embedded-hal.workspace = true +embedded-services.workspace = true +log = { workspace = true, optional = true } [features] -default = ["defmt"] +default = [] defmt = [ "dep:defmt", "embedded-services/defmt", @@ -25,3 +25,4 @@ defmt = [ "embassy-time/defmt-timestamp-uptime", "embassy-sync/defmt", ] +log = ["dep:log", "embedded-services/log", "embassy-time/log"] diff --git a/power-button-service/Cargo.toml b/power-button-service/Cargo.toml index 20e204a8..ad2bf059 100644 --- a/power-button-service/Cargo.toml +++ b/power-button-service/Cargo.toml @@ -5,11 +5,11 @@ edition = "2021" license = "MIT" description = "Power button service built upon embedded service" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" [dependencies] -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embedded-hal-1 = { package = "embedded-hal", version = "1.0" } -embedded-hal-async = { version = "1.0" } +defmt = { workspace = true, optional = true } +embassy-time.workspace = true +embedded-hal-async.workspace = true +embedded-hal.workspace = true +log = { workspace = true, optional = true } diff --git a/power-button-service/src/button.rs b/power-button-service/src/button.rs index 63952f89..c5651313 100644 --- a/power-button-service/src/button.rs +++ b/power-button-service/src/button.rs @@ -1,7 +1,7 @@ //! Button Service Definitions use embassy_time::{with_timeout, Duration, Instant, TimeoutError, Timer}; -use embedded_hal_1::digital::InputPin; +use embedded_hal::digital::InputPin; use embedded_hal_async::digital::Wait; use super::debounce::Debouncer; diff --git a/power-button-service/src/button_interpreter.rs b/power-button-service/src/button_interpreter.rs index 13e4d57d..5a5d0182 100644 --- a/power-button-service/src/button_interpreter.rs +++ b/power-button-service/src/button_interpreter.rs @@ -1,6 +1,6 @@ //! Button Interpreter Module -use embedded_hal_1::digital::InputPin; +use embedded_hal::digital::InputPin; use embedded_hal_async::digital::Wait; use super::button::Button; diff --git a/power-button-service/src/debounce.rs b/power-button-service/src/debounce.rs index df4e2afb..97d5ae84 100644 --- a/power-button-service/src/debounce.rs +++ b/power-button-service/src/debounce.rs @@ -1,7 +1,7 @@ //! Debounce Module use embassy_time::{Duration, Timer}; -use embedded_hal_1::digital::InputPin; +use embedded_hal::digital::InputPin; use embedded_hal_async::digital::Wait; #[derive(Debug)] diff --git a/power-policy-service/Cargo.toml b/power-policy-service/Cargo.toml index 1ee2f093..ac0e2af7 100644 --- a/power-policy-service/Cargo.toml +++ b/power-policy-service/Cargo.toml @@ -4,17 +4,17 @@ version = "0.1.0" edition = "2021" description = "HID embedded service implementation" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } +defmt = { workspace = true, optional = true } +embassy-executor.workspace = true +embassy-futures.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-services.workspace = true +log = { workspace = true, optional = true } [features] default = [] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9e8f5b7a..1ecb3e6f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -targets = [ "thumbv8m.main-none-eabihf" ] -components = [ "rust-src", "rustfmt", "llvm-tools-preview", "clippy" ] +targets = ["thumbv8m.main-none-eabihf"] +components = ["rust-src", "rustfmt", "llvm-tools-preview", "clippy"] diff --git a/rustfmt.toml b/rustfmt.toml index 9eb3c3b4..75306517 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1 @@ -group_imports = "StdExternalCrate" -imports_granularity = "Module" max_width = 120 diff --git a/storage-bus/Cargo.toml b/storage-bus/Cargo.toml index f6a611d0..4dcc4327 100644 --- a/storage-bus/Cargo.toml +++ b/storage-bus/Cargo.toml @@ -4,16 +4,16 @@ version = "0.1.1" edition = "2021" description = "Storage Bus interfaces" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } +defmt = { workspace = true, optional = true } +embassy-executor.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-services.workspace = true +log = { workspace = true, optional = true } [features] default = [] diff --git a/type-c-service/Cargo.toml b/type-c-service/Cargo.toml index 98a15f12..c88f84a9 100644 --- a/type-c-service/Cargo.toml +++ b/type-c-service/Cargo.toml @@ -4,28 +4,23 @@ version = "0.1.0" edition = "2021" description = "HID embedded service implementation" repository = "https://github.com/OpenDevicePartnership/embedded-services" -rust-version = "1.83" +rust-version = "1.85" license = "MIT" [dependencies] -embedded-services = { path = "../embedded-service" } -embassy-time = { git = "https://github.com/embassy-rs/embassy" } -embassy-sync = { git = "https://github.com/embassy-rs/embassy" } -embassy-executor = { git = "https://github.com/embassy-rs/embassy" } -embassy-futures = { git = "https://github.com/embassy-rs/embassy" } -defmt = { version = "0.3", optional = true } -log = { version = "0.4.14", optional = true } - -embedded-io-async = "0.6.1" -embedded-hal = "1.0.0" -embedded-hal-async = "1.0.0" -bitfield = "0.17.0" - -tps6699x = { git = "https://github.com/OpenDevicePartnership/tps6699x", features = [ - "embassy", -] } -embedded-usb-pd = { git = "https://github.com/OpenDevicePartnership/embedded-usb-pd", default-features = false } - +bitfield.workspace = true +defmt = { workspace = true, optional = true } +embassy-executor.workspace = true +embassy-futures.workspace = true +embassy-sync.workspace = true +embassy-time.workspace = true +embedded-hal-async.workspace = true +embedded-hal.workspace = true +embedded-io-async.workspace = true +embedded-services.workspace = true +embedded-usb-pd.workspace = true +log = { workspace = true, optional = true } +tps6699x = { workspace = true, features = ["embassy"] } [features] default = []