├── docs ├── sleep.png ├── esp-wifi-dhcp.png └── esp-wifi-dhcp-ps-min-modem.png ├── rust-toolchain.toml ├── .gitignore ├── Cargo.toml ├── README.md ├── LICENSE-MIT ├── .github └── workflows │ └── rust_ci.yml ├── .cargo └── config.toml ├── src └── main.rs ├── LICENSE-APACHE └── Cargo.lock /docs/sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjoernQ/measure-current/main/docs/sleep.png -------------------------------------------------------------------------------- /docs/esp-wifi-dhcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjoernQ/measure-current/main/docs/esp-wifi-dhcp.png -------------------------------------------------------------------------------- /docs/esp-wifi-dhcp-ps-min-modem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjoernQ/measure-current/main/docs/esp-wifi-dhcp-ps-min-modem.png -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | targets = ["riscv32imc-unknown-none-elf"] 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "usb_measure" 3 | version = "0.1.0" 4 | authors = ["bjoernQ "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [dependencies] 9 | hal = { package = "esp32c3-hal", version = "0.12.0" } 10 | esp-backtrace = { version = "0.8.0", features = ["esp32c3", "panic-handler", "exception-handler", "print-uart"] } 11 | esp-println = { version = "0.6.0", features = ["esp32c3"] } 12 | 13 | ti-ina219 = { git="https://github.com/gpgreen/ti-ina219" } 14 | 15 | [patch.crates-io] 16 | hal = { git = "https://github.com/esp-rs/esp-hal", package = "esp32c3-hal"} 17 | esp-hal-common = { git = "https://github.com/esp-rs/esp-hal", package = "esp-hal-common"} 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32-C3 Current Sensing with INA219 2 | 3 | Read the current measured by INA219 (Adafruit breakout board) on ESP32-C3 (bare-metal Rust) and print it to be visualized with the Teleplot VSCode extension. 4 | The sensor is connected to two USB breakout boards to measure the current of a connected device. 5 | 6 | This is not a professional tool but cheap and better than nothing 🙂 7 | 8 | ## Examples 9 | 10 | ESP32 running code to delaying for 2 seconds, then deep-sleeping for 2 seconds and rebooting 11 | 12 | ![Screenshot](./docs/sleep.png) 13 | 14 | ESP32 running esp-wifi's dhcp example 15 | 16 | ![Screenshot](./docs/esp-wifi-dhcp.png) 17 | 18 | ESP32 running esp-wifi's dhcp example with `ps-min-modem` 19 | 20 | ![Screenshot](./docs/esp-wifi-dhcp-ps-min-modem.png) 21 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright [year] [fullname] 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /.github/workflows/rust_ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - "**/README.md" 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | env: 11 | CARGO_TERM_COLOR: always 12 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 13 | 14 | jobs: 15 | rust-checks: 16 | name: Rust Checks 17 | runs-on: ubuntu-latest 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | action: 22 | - command: build 23 | args: --release 24 | - command: fmt 25 | args: --all -- --check --color always 26 | - command: clippy 27 | args: --all-targets --all-features --workspace -- -D warnings 28 | steps: 29 | - name: Checkout repository 30 | uses: actions/checkout@v4 31 | - name: Enable caching 32 | uses: Swatinem/rust-cache@v2 33 | - name: Setup Rust 34 | uses: dtolnay/rust-toolchain@v1 35 | with: 36 | target: riscv32imc-unknown-none-elf 37 | toolchain: nightly 38 | components: rust-src 39 | - name: Run command 40 | run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} 41 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.riscv32imc-unknown-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | 5 | [build] 6 | rustflags = [ 7 | "-C", "link-arg=-Tlinkall.x", 8 | 9 | # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) 10 | # NOTE: May negatively impact performance of produced code 11 | "-C", "force-frame-pointers", 12 | 13 | # comment the cfgs below if you do _not_ wish to emulate atomics. 14 | # enable the atomic codegen option for RISCV 15 | "-C", "target-feature=+a", 16 | # tell the core library have atomics even though it's not specified in the target definition 17 | "--cfg", "target_has_atomic_load_store", 18 | "--cfg", 'target_has_atomic_load_store="8"', 19 | "--cfg", 'target_has_atomic_load_store="16"', 20 | "--cfg", 'target_has_atomic_load_store="32"', 21 | "--cfg", 'target_has_atomic_load_store="ptr"', 22 | # enable cas 23 | "--cfg", "target_has_atomic", 24 | "--cfg", 'target_has_atomic="8"', 25 | "--cfg", 'target_has_atomic="16"', 26 | "--cfg", 'target_has_atomic="32"', 27 | "--cfg", 'target_has_atomic="ptr"', 28 | ] 29 | 30 | target = "riscv32imc-unknown-none-elf" 31 | 32 | [unstable] 33 | build-std = ["core"] 34 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | 4 | use esp_backtrace as _; 5 | use esp_println::println; 6 | use hal::{clock::ClockControl, i2c::I2C, peripherals::Peripherals, prelude::*, Delay, IO}; 7 | 8 | #[entry] 9 | fn main() -> ! { 10 | let peripherals = Peripherals::take(); 11 | let system = peripherals.SYSTEM.split(); 12 | let clocks = ClockControl::max(system.clock_control).freeze(); 13 | let mut delay = Delay::new(&clocks); 14 | 15 | let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); 16 | 17 | let i2c = I2C::new( 18 | peripherals.I2C0, 19 | io.pins.gpio1, 20 | io.pins.gpio2, 21 | 100u32.kHz(), 22 | &clocks, 23 | ); 24 | 25 | let mut ina219 = ti_ina219::AdafruitIna219::init(i2c, ti_ina219::DeviceAddress::new()).unwrap(); 26 | 27 | loop { 28 | // let v = ina219.get_bus_voltage_v().unwrap(); 29 | // println!("bus voltage {v}"); 30 | 31 | // let sv = ina219.get_shunt_voltage_v().unwrap(); 32 | // println!("shunt voltage {sv}"); 33 | 34 | // let p = ina219.get_power_mw().unwrap(); 35 | // println!("power {p}"); 36 | 37 | let c = ina219.get_current_ma().unwrap(); 38 | println!(">current:{c}"); 39 | delay.delay_ms(50u32); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "basic-toml" 7 | version = "0.1.4" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" 10 | dependencies = [ 11 | "serde", 12 | ] 13 | 14 | [[package]] 15 | name = "bit_field" 16 | version = "0.10.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" 19 | 20 | [[package]] 21 | name = "bitfield" 22 | version = "0.14.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" 25 | 26 | [[package]] 27 | name = "bitflags" 28 | version = "1.3.2" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 31 | 32 | [[package]] 33 | name = "bitflags" 34 | version = "2.4.0" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" 37 | 38 | [[package]] 39 | name = "cfg-if" 40 | version = "1.0.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 43 | 44 | [[package]] 45 | name = "critical-section" 46 | version = "1.1.2" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" 49 | 50 | [[package]] 51 | name = "darling" 52 | version = "0.20.3" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" 55 | dependencies = [ 56 | "darling_core", 57 | "darling_macro", 58 | ] 59 | 60 | [[package]] 61 | name = "darling_core" 62 | version = "0.20.3" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" 65 | dependencies = [ 66 | "fnv", 67 | "ident_case", 68 | "proc-macro2", 69 | "quote", 70 | "strsim", 71 | "syn 2.0.37", 72 | ] 73 | 74 | [[package]] 75 | name = "darling_macro" 76 | version = "0.20.3" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" 79 | dependencies = [ 80 | "darling_core", 81 | "quote", 82 | "syn 2.0.37", 83 | ] 84 | 85 | [[package]] 86 | name = "defmt" 87 | version = "0.3.5" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" 90 | dependencies = [ 91 | "bitflags 1.3.2", 92 | "defmt-macros", 93 | ] 94 | 95 | [[package]] 96 | name = "defmt-macros" 97 | version = "0.3.6" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" 100 | dependencies = [ 101 | "defmt-parser", 102 | "proc-macro-error", 103 | "proc-macro2", 104 | "quote", 105 | "syn 2.0.37", 106 | ] 107 | 108 | [[package]] 109 | name = "defmt-parser" 110 | version = "0.3.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" 113 | dependencies = [ 114 | "thiserror", 115 | ] 116 | 117 | [[package]] 118 | name = "embedded-dma" 119 | version = "0.2.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446" 122 | dependencies = [ 123 | "stable_deref_trait", 124 | ] 125 | 126 | [[package]] 127 | name = "embedded-hal" 128 | version = "0.2.7" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 131 | dependencies = [ 132 | "nb 0.1.3", 133 | "void", 134 | ] 135 | 136 | [[package]] 137 | name = "embedded-io" 138 | version = "0.5.0" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "658bbadc628dc286b9ae02f0cb0f5411c056eb7487b72f0083203f115de94060" 141 | 142 | [[package]] 143 | name = "equivalent" 144 | version = "1.0.1" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 147 | 148 | [[package]] 149 | name = "esp-backtrace" 150 | version = "0.8.0" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "4c7d3ecccb0df809cb6ca79b08f863271c0aa24f586df96272988a85d34dfa62" 153 | dependencies = [ 154 | "esp-println", 155 | ] 156 | 157 | [[package]] 158 | name = "esp-hal-common" 159 | version = "0.12.0" 160 | source = "git+https://github.com/esp-rs/esp-hal#ab775e7106a078d7440d5db8e2ec4854bde0a4a1" 161 | dependencies = [ 162 | "basic-toml", 163 | "bitfield", 164 | "bitflags 2.4.0", 165 | "cfg-if", 166 | "critical-section", 167 | "embedded-dma", 168 | "embedded-hal", 169 | "embedded-io", 170 | "esp-hal-procmacros", 171 | "esp-riscv-rt", 172 | "esp32c3", 173 | "fugit", 174 | "nb 1.1.0", 175 | "paste", 176 | "riscv-atomic-emulation-trap", 177 | "serde", 178 | "strum", 179 | "void", 180 | ] 181 | 182 | [[package]] 183 | name = "esp-hal-procmacros" 184 | version = "0.6.1" 185 | source = "git+https://github.com/esp-rs/esp-hal#ab775e7106a078d7440d5db8e2ec4854bde0a4a1" 186 | dependencies = [ 187 | "darling", 188 | "litrs", 189 | "proc-macro-crate", 190 | "proc-macro-error", 191 | "proc-macro2", 192 | "quote", 193 | "syn 2.0.37", 194 | "toml_edit", 195 | ] 196 | 197 | [[package]] 198 | name = "esp-println" 199 | version = "0.6.0" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "79b429ea925356d60c10d7214cf0e1777d9578c1287cd50aad09df3c22c4c2f1" 202 | dependencies = [ 203 | "critical-section", 204 | ] 205 | 206 | [[package]] 207 | name = "esp-riscv-rt" 208 | version = "0.5.0" 209 | source = "git+https://github.com/esp-rs/esp-hal#ab775e7106a078d7440d5db8e2ec4854bde0a4a1" 210 | dependencies = [ 211 | "riscv", 212 | "riscv-rt-macros", 213 | ] 214 | 215 | [[package]] 216 | name = "esp32c3" 217 | version = "0.17.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "69fd4d0ce57e7c801cba8d01b5a833db804c8596485f0764ef20f2a9e1eb53bf" 220 | dependencies = [ 221 | "critical-section", 222 | "vcell", 223 | ] 224 | 225 | [[package]] 226 | name = "esp32c3-hal" 227 | version = "0.12.0" 228 | source = "git+https://github.com/esp-rs/esp-hal#ab775e7106a078d7440d5db8e2ec4854bde0a4a1" 229 | dependencies = [ 230 | "cfg-if", 231 | "esp-hal-common", 232 | ] 233 | 234 | [[package]] 235 | name = "fnv" 236 | version = "1.0.7" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 239 | 240 | [[package]] 241 | name = "fugit" 242 | version = "0.3.7" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" 245 | dependencies = [ 246 | "gcd", 247 | ] 248 | 249 | [[package]] 250 | name = "gcd" 251 | version = "2.3.0" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" 254 | 255 | [[package]] 256 | name = "hashbrown" 257 | version = "0.14.1" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" 260 | 261 | [[package]] 262 | name = "heck" 263 | version = "0.4.1" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 266 | 267 | [[package]] 268 | name = "ident_case" 269 | version = "1.0.1" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 272 | 273 | [[package]] 274 | name = "indexmap" 275 | version = "2.0.1" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" 278 | dependencies = [ 279 | "equivalent", 280 | "hashbrown", 281 | ] 282 | 283 | [[package]] 284 | name = "litrs" 285 | version = "0.4.0" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "4f17c3668f3cc1132437cdadc93dab05e52d592f06948d3f64828430c36e4a70" 288 | dependencies = [ 289 | "proc-macro2", 290 | ] 291 | 292 | [[package]] 293 | name = "memchr" 294 | version = "2.6.3" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" 297 | 298 | [[package]] 299 | name = "nb" 300 | version = "0.1.3" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 303 | dependencies = [ 304 | "nb 1.1.0", 305 | ] 306 | 307 | [[package]] 308 | name = "nb" 309 | version = "1.1.0" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 312 | 313 | [[package]] 314 | name = "once_cell" 315 | version = "1.18.0" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 318 | 319 | [[package]] 320 | name = "paste" 321 | version = "1.0.14" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 324 | 325 | [[package]] 326 | name = "proc-macro-crate" 327 | version = "1.3.1" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" 330 | dependencies = [ 331 | "once_cell", 332 | "toml_edit", 333 | ] 334 | 335 | [[package]] 336 | name = "proc-macro-error" 337 | version = "1.0.4" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 340 | dependencies = [ 341 | "proc-macro-error-attr", 342 | "proc-macro2", 343 | "quote", 344 | "syn 1.0.109", 345 | "version_check", 346 | ] 347 | 348 | [[package]] 349 | name = "proc-macro-error-attr" 350 | version = "1.0.4" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 353 | dependencies = [ 354 | "proc-macro2", 355 | "quote", 356 | "version_check", 357 | ] 358 | 359 | [[package]] 360 | name = "proc-macro2" 361 | version = "1.0.67" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" 364 | dependencies = [ 365 | "unicode-ident", 366 | ] 367 | 368 | [[package]] 369 | name = "quote" 370 | version = "1.0.33" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 373 | dependencies = [ 374 | "proc-macro2", 375 | ] 376 | 377 | [[package]] 378 | name = "riscv" 379 | version = "0.10.1" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "aa3145d2fae3778b1e31ec2e827b228bdc6abd9b74bb5705ba46dcb82069bc4f" 382 | dependencies = [ 383 | "bit_field", 384 | "critical-section", 385 | "embedded-hal", 386 | ] 387 | 388 | [[package]] 389 | name = "riscv-atomic-emulation-trap" 390 | version = "0.4.1" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "7979127070e70f34c0ad6cc5a3a13f09af8dab1e9e154c396eb818f478504143" 393 | 394 | [[package]] 395 | name = "riscv-rt-macros" 396 | version = "0.2.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "f38509d7b17c2f604ceab3e5ff8ac97bb8cd2f544688c512be75c715edaf4daf" 399 | dependencies = [ 400 | "proc-macro2", 401 | "quote", 402 | "syn 1.0.109", 403 | ] 404 | 405 | [[package]] 406 | name = "rustversion" 407 | version = "1.0.14" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 410 | 411 | [[package]] 412 | name = "serde" 413 | version = "1.0.188" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 416 | dependencies = [ 417 | "serde_derive", 418 | ] 419 | 420 | [[package]] 421 | name = "serde_derive" 422 | version = "1.0.188" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 425 | dependencies = [ 426 | "proc-macro2", 427 | "quote", 428 | "syn 2.0.37", 429 | ] 430 | 431 | [[package]] 432 | name = "stable_deref_trait" 433 | version = "1.2.0" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 436 | 437 | [[package]] 438 | name = "strsim" 439 | version = "0.10.0" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 442 | 443 | [[package]] 444 | name = "strum" 445 | version = "0.25.0" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" 448 | dependencies = [ 449 | "strum_macros", 450 | ] 451 | 452 | [[package]] 453 | name = "strum_macros" 454 | version = "0.25.2" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" 457 | dependencies = [ 458 | "heck", 459 | "proc-macro2", 460 | "quote", 461 | "rustversion", 462 | "syn 2.0.37", 463 | ] 464 | 465 | [[package]] 466 | name = "syn" 467 | version = "1.0.109" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 470 | dependencies = [ 471 | "proc-macro2", 472 | "quote", 473 | "unicode-ident", 474 | ] 475 | 476 | [[package]] 477 | name = "syn" 478 | version = "2.0.37" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" 481 | dependencies = [ 482 | "proc-macro2", 483 | "quote", 484 | "unicode-ident", 485 | ] 486 | 487 | [[package]] 488 | name = "thiserror" 489 | version = "1.0.49" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" 492 | dependencies = [ 493 | "thiserror-impl", 494 | ] 495 | 496 | [[package]] 497 | name = "thiserror-impl" 498 | version = "1.0.49" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" 501 | dependencies = [ 502 | "proc-macro2", 503 | "quote", 504 | "syn 2.0.37", 505 | ] 506 | 507 | [[package]] 508 | name = "ti-ina219" 509 | version = "0.1.0" 510 | source = "git+https://github.com/gpgreen/ti-ina219#8e2d62b03e3e194b58313b67bf549d27a79763c9" 511 | dependencies = [ 512 | "defmt", 513 | "embedded-hal", 514 | ] 515 | 516 | [[package]] 517 | name = "toml_datetime" 518 | version = "0.6.3" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" 521 | 522 | [[package]] 523 | name = "toml_edit" 524 | version = "0.19.14" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" 527 | dependencies = [ 528 | "indexmap", 529 | "toml_datetime", 530 | "winnow", 531 | ] 532 | 533 | [[package]] 534 | name = "unicode-ident" 535 | version = "1.0.12" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 538 | 539 | [[package]] 540 | name = "usb_measure" 541 | version = "0.1.0" 542 | dependencies = [ 543 | "esp-backtrace", 544 | "esp-println", 545 | "esp32c3-hal", 546 | "ti-ina219", 547 | ] 548 | 549 | [[package]] 550 | name = "vcell" 551 | version = "0.1.3" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" 554 | 555 | [[package]] 556 | name = "version_check" 557 | version = "0.9.4" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 560 | 561 | [[package]] 562 | name = "void" 563 | version = "1.0.2" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 566 | 567 | [[package]] 568 | name = "winnow" 569 | version = "0.5.15" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" 572 | dependencies = [ 573 | "memchr", 574 | ] 575 | --------------------------------------------------------------------------------