Skip to content

Commit 7ab1313

Browse files
committed
feat: Reorganize common and update README
1 parent 7db24a4 commit 7ab1313

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+236
-192
lines changed

Cargo.lock

Lines changed: 61 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ cortex-m-rt = "0.7.1"
2525
critical-section = "1.1"
2626
defmt = "0.3.2"
2727
defmt-rtt = "0.4"
28-
driver-services = { path = "./common/driver-services" }
2928
embassy-embedded-hal = { version = "0.3.0", features = ["defmt"] }
3029
embassy-executor = { version = "0.7.0", features = ["defmt"] }
3130
embassy-futures = { version = "0.1.0", features = ["defmt"] }
@@ -42,16 +41,17 @@ embedded-io = { version = "0.6.1" }
4241
embedded-io-async = { version = "0.6.1" }
4342
enum_dispatch = "0.3.11"
4443
heapless = "0.9.1"
45-
high-level-services = { path = "./common/high-level-services" }
4644
libm = "0.2.11"
4745
nb = "1.1.0"
4846
num-traits = { version = "0.2.19", default-features = false }
4947
panic-probe = { version = "0.3", features = ["print-defmt"] }
50-
peripheral-services = { path = "./common/peripheral-services" }
5148
prost = { version = "0.14.1", default-features = false, features = ["derive"] }
5249
serde = { version = "1.0.150", features = ["derive"], default-features = false }
5350
serde-csv-core = { version = "0.3.2", features = ["defmt"] }
5451
smlang = "0.8.0"
5552
static_cell = "2"
53+
uor-drivers = { path = "./common/drivers" }
54+
uor-high-level = { path = "./common/high-level" }
55+
uor-peripherals = { path = "./common/peripherals" }
5656
uor-proc-macros = { path = "./common/uor-proc-macros" }
5757
uor-utils = { path = "./common/uor-utils" }

boards/argus/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,20 @@ embedded-test = { version = "0.6.2", features = ["defmt", "embassy"] }
6767
enum_dispatch = { workspace = true }
6868
grounded = "0.2.0"
6969
heapless = { workspace = true }
70-
high-level-services = { workspace = true }
7170
itoa = { version = "1.0.15", features = ["no-panic"] }
7271
libm = { workspace = true, default-features = false }
7372
micromath = "2.0.0"
7473
num-traits = { workspace = true, features = ["libm"] }
7574
panic-probe = { workspace = true }
76-
peripheral-services = { workspace = true, features = ["messages"] }
7775
pid = "4.0.0"
7876
prost = { workspace = true }
7977
serde = { workspace = true, features = ["derive", "serde_derive"] }
8078
smlang = { workspace = true }
8179
static_cell = { workspace = true }
8280
stm32-fmc = "0.3.0"
8381
strum = { version = "0.27.2", default-features = false, features = ["derive"] }
82+
uor-high-level = { workspace = true }
83+
uor-peripherals = { workspace = true, features = ["messages"] }
8484
uor-utils = { workspace = true, features = ["messages"] }
8585

8686
[[test]]

boards/argus/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use embassy_stm32::gpio::Pin;
2121
use embassy_stm32::usart::Uart;
2222
use embassy_stm32::{bind_interrupts, peripherals, usart};
2323
use panic_probe as _;
24-
use peripheral_services::serial::service::SerialService;
2524
use serde::ser;
2625
use static_cell::StaticCell;
2726
use strum::EnumCount;
27+
use uor_peripherals::serial::peripheral::UORSerial;
2828
use uor_utils::messages::argus::envelope::{Node, NodeType};
2929
use uor_utils::utils::{hal::configure_hal, types::AsyncMutex};
3030

@@ -37,7 +37,7 @@ bind_interrupts!(struct InterruptRequests {
3737
// And wrapped around a mutex so they can be accessed safely from multiple async tasks
3838
static SD_CARD_SERVICE: StaticCell<AsyncMutex<SDCardService>> = StaticCell::new();
3939
static ADC_SERVICE: StaticCell<AsyncMutex<AdcService<{ AdcDevice::COUNT }>>> = StaticCell::new();
40-
static SERIAL_SERVICE: StaticCell<AsyncMutex<SerialService>> = StaticCell::new();
40+
static SERIAL_SERVICE: StaticCell<AsyncMutex<UORSerial>> = StaticCell::new();
4141
static SESSION_SERVICE: StaticCell<AsyncMutex<SessionService>> = StaticCell::new();
4242
static LED_INDICATOR_SERVICE: StaticCell<AsyncMutex<LedIndicatorService<2>>> = StaticCell::new();
4343
static STATE_MACHINE_ORCHESTRATOR: StaticCell<AsyncMutex<StateMachineOrchestrator>> = StaticCell::new();
@@ -98,7 +98,7 @@ async fn main(spawner: Spawner) {
9898
],
9999
)));
100100
let serial_service = SERIAL_SERVICE.init(AsyncMutex::new(
101-
SerialService::new(
101+
UORSerial::new(
102102
peripherals.UART7,
103103
peripherals.PE8,
104104
peripherals.PE7,

boards/argus/src/pressure/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use defmt::{error, info};
22
use embassy_time::{Instant, Timer};
3-
use peripheral_services::serial::service::SerialService;
43
use strum::EnumCount;
4+
use uor_peripherals::serial::peripheral::UORSerial;
55
use uor_utils::utils::types::AsyncMutex;
66

77
use crate::adc::driver::types::{DataRate, Filter, Gain, ReferenceRange};
@@ -20,7 +20,7 @@ pub struct PressureService<const ADC_COUNT: usize> {
2020
// Other services are passed by a mutex to ensure safe concurrent access
2121
pub adc_service: &'static AsyncMutex<AdcService<ADC_COUNT>>,
2222
pub sd_card_service: &'static AsyncMutex<SDCardService>,
23-
pub serial_service: &'static AsyncMutex<SerialService>,
23+
pub serial_service: &'static AsyncMutex<UORSerial>,
2424
pub session_service: &'static AsyncMutex<SessionService>,
2525

2626
// Linear transformations that are applied on top of the raw readings for each ADC and channel
@@ -31,7 +31,7 @@ impl<const ADC_COUNT: usize> PressureService<ADC_COUNT> {
3131
pub fn new(
3232
adc_service: &'static AsyncMutex<AdcService<ADC_COUNT>>,
3333
sd_card_service: &'static AsyncMutex<SDCardService>,
34-
serial_service: &'static AsyncMutex<SerialService>,
34+
serial_service: &'static AsyncMutex<UORSerial>,
3535
session_service: &'static AsyncMutex<SessionService>,
3636
) -> Self {
3737
Self {

boards/argus/src/pressure/tasks/log_measurements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use defmt::info;
22
use embassy_executor::task;
33
use heapless::format;
4-
use peripheral_services::serial::service::SerialService;
54
use strum::EnumCount;
5+
use uor_peripherals::serial::peripheral::UORSerial;
66
use uor_utils::csv::SerializeCSV;
77
use uor_utils::messages::argus::envelope::envelope::Message;
88
use uor_utils::utils::types::AsyncMutex;
@@ -20,7 +20,7 @@ use crate::state_machine::types::States;
2020
#[task]
2121
pub async fn log_measurements(
2222
mut worker: StateMachineWorker,
23-
serial_service_mutex: &'static AsyncMutex<SerialService>,
23+
serial_service_mutex: &'static AsyncMutex<UORSerial>,
2424
sd_card_service_mutex: &'static AsyncMutex<SDCardService>,
2525
session_service: &'static AsyncMutex<SessionService>,
2626
) {

boards/argus/src/pressure/types/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use defmt::Format;
22
use derive_more::From;
3-
use peripheral_services::serial::service::UsartError;
3+
use uor_peripherals::serial::peripheral::UsartError;
44

55
use crate::adc::service::AdcError;
66
use crate::sd::types::SdCardError;

boards/argus/src/strain/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use defmt::error;
22
use embassy_time::{Instant, Timer};
3-
use peripheral_services::serial::service::SerialService;
43
use strum::EnumCount;
4+
use uor_peripherals::serial::peripheral::UORSerial;
55
use uor_utils::utils::types::AsyncMutex;
66

77
use crate::adc::driver::types::{DataRate, Filter, Gain, ReferenceRange};
@@ -20,7 +20,7 @@ pub struct StrainService<const ADC_COUNT: usize> {
2020
// Other services are passed by a mutex to ensure safe concurrent access
2121
pub adc_service: &'static AsyncMutex<AdcService<ADC_COUNT>>,
2222
pub sd_card_service: &'static AsyncMutex<SDCardService>,
23-
pub serial_service: &'static AsyncMutex<SerialService>,
23+
pub serial_service: &'static AsyncMutex<UORSerial>,
2424
pub session_service: &'static AsyncMutex<SessionService>,
2525

2626
// Linear transformations that are applied on top of the raw readings for each ADC and channel
@@ -31,7 +31,7 @@ impl<const ADC_COUNT: usize> StrainService<ADC_COUNT> {
3131
pub fn new(
3232
adc_service: &'static AsyncMutex<AdcService<ADC_COUNT>>,
3333
sd_card_service: &'static AsyncMutex<SDCardService>,
34-
serial_service: &'static AsyncMutex<SerialService>,
34+
serial_service: &'static AsyncMutex<UORSerial>,
3535
session_service: &'static AsyncMutex<SessionService>,
3636
) -> Self {
3737
Self {

boards/argus/src/strain/tasks/log_measurements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use defmt::info;
22
use embassy_executor::task;
33
use heapless::format;
4-
use peripheral_services::serial::service::SerialService;
54
use strum::EnumCount;
5+
use uor_peripherals::serial::peripheral::UORSerial;
66
use uor_utils::csv::SerializeCSV;
77
use uor_utils::messages::argus::envelope::envelope::Message;
88
use uor_utils::utils::types::AsyncMutex;
@@ -20,7 +20,7 @@ use crate::strain::types::{StrainChannel, StrainReading};
2020
#[task]
2121
pub async fn log_measurements(
2222
mut worker: StateMachineWorker,
23-
serial_service_mutex: &'static AsyncMutex<SerialService>,
23+
serial_service_mutex: &'static AsyncMutex<UORSerial>,
2424
sd_card_service_mutex: &'static AsyncMutex<SDCardService>,
2525
session_service: &'static AsyncMutex<SessionService>,
2626
) {

boards/argus/src/strain/types/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use defmt::Format;
22
use derive_more::From;
3-
use peripheral_services::serial::service::UsartError;
3+
use uor_peripherals::serial::peripheral::UsartError;
44

55
use crate::adc::service::AdcError;
66
use crate::sd::types::SdCardError;

0 commit comments

Comments
 (0)