initial reoder of folders and library crate creation
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
|
||||
[target."riscv32imc-unknown-none-elf"]
|
||||
rustflags = [
|
||||
# "-C", "link-arg=-Tlink.x",
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "lib-bms-protocol"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
|
||||
[profile.dev]
|
||||
#lto = true
|
||||
opt-level = 1
|
||||
|
||||
[profile.release]
|
||||
strip = false # symbols are not flashed to the microcontroller, so don't strip them.
|
||||
#lto = true
|
||||
debug = true
|
||||
opt-level = "z" # Optimize for size.
|
||||
@@ -0,0 +1,27 @@
|
||||
#![no_std]
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Version(u32);
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Config {
|
||||
capacity_mah: u32,
|
||||
v_full_mv: u32,
|
||||
v_empty_mv: u32,
|
||||
}
|
||||
|
||||
pub struct BatteryState {
|
||||
lifetime_capacity_mAh: u32,
|
||||
remaining_capacity_mAh: u32,
|
||||
current_milli_volts: u16,
|
||||
temperature_celcius: i32,
|
||||
health_percent: u8
|
||||
}
|
||||
|
||||
pub enum BmsCommand {
|
||||
GetVersion,
|
||||
GetConfig,
|
||||
GetBatteryState,
|
||||
}
|
||||
Reference in New Issue
Block a user