initial reoder of folders and library crate creation

This commit is contained in:
2025-12-29 23:22:18 +01:00
parent 70931c00f1
commit 03f17d5cd6
13 changed files with 1119 additions and 180 deletions
+5
View File
@@ -0,0 +1,5 @@
[target."riscv32imc-unknown-none-elf"]
rustflags = [
# "-C", "link-arg=-Tlink.x",
]
+17
View File
@@ -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.
+27
View File
@@ -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,
}