From 80a8d7d9798514cd1cfa7f4188c51f25334952dc Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 01:12:19 +0100 Subject: mspm0: bump mspm0-metapac rev. & add minimath lib as dependency --- embassy-mspm0/Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embassy-mspm0/Cargo.toml b/embassy-mspm0/Cargo.toml index b76bc7e41..254e0209b 100644 --- a/embassy-mspm0/Cargo.toml +++ b/embassy-mspm0/Cargo.toml @@ -70,9 +70,10 @@ log = { version = "0.4.14", optional = true } cortex-m-rt = ">=0.6.15,<0.8" cortex-m = "0.7.6" critical-section = "1.2.0" +micromath = "2.0.0" # mspm0-metapac = { version = "" } -mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-8542f260cc89645a983b7f1a874c87b21822279e" } +mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-f21b04e9de074af4965bf67ec3646cb9fe1b9852" } [build-dependencies] proc-macro2 = "1.0.94" @@ -80,7 +81,7 @@ quote = "1.0.40" cfg_aliases = "0.2.1" # mspm0-metapac = { version = "", default-features = false, features = ["metadata"] } -mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-8542f260cc89645a983b7f1a874c87b21822279e", default-features = false, features = ["metadata"] } +mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-f21b04e9de074af4965bf67ec3646cb9fe1b9852", default-features = false, features = ["metadata"] } [features] default = ["rt"] -- cgit From 535c6d378fb68083623338f8534b5da8efd6a139 Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 01:15:18 +0100 Subject: mspm0: add MATHACL module and following operations: sin,cos --- embassy-mspm0/build.rs | 1 + embassy-mspm0/src/lib.rs | 1 + embassy-mspm0/src/mathacl.rs | 244 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 246 insertions(+) create mode 100644 embassy-mspm0/src/mathacl.rs diff --git a/embassy-mspm0/build.rs b/embassy-mspm0/build.rs index 4942364aa..0fe056c4e 100644 --- a/embassy-mspm0/build.rs +++ b/embassy-mspm0/build.rs @@ -591,6 +591,7 @@ fn generate_peripheral_instances() -> TokenStream { "i2c" => Some(quote! { impl_i2c_instance!(#peri, #fifo_size); }), "wwdt" => Some(quote! { impl_wwdt_instance!(#peri); }), "adc" => Some(quote! { impl_adc_instance!(#peri); }), + "mathacl" => Some(quote! { impl_mathacl_instance!(#peri); }), _ => None, }; diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index 9f3e4d5e8..dda8c373c 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs @@ -19,6 +19,7 @@ pub mod dma; pub mod gpio; pub mod i2c; pub mod i2c_target; +pub mod mathacl; pub mod timer; pub mod uart; pub mod wwdt; diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs new file mode 100644 index 000000000..59687ce49 --- /dev/null +++ b/embassy-mspm0/src/mathacl.rs @@ -0,0 +1,244 @@ +//! MATHACL +//! +//! This HAL implements mathematical calculations performed by the CPU. + +#![macro_use] + +use embassy_hal_internal::PeripheralType; + +use crate::Peri; +use crate::pac::mathacl::{Mathacl as Regs, vals}; +use micromath::F32Ext; + +pub enum Precision { + High = 31, + Medium = 15, + Low = 1, +} + +/// Serial error +#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[non_exhaustive] +pub enum Error { + AngleInWrongRange, + NBitsTooBig, +} + +#[derive(Copy, Clone)] +pub struct Mathacl { + regs: &'static Regs, +} + +impl Mathacl { + /// Mathacl initialization. + pub fn new(_instance: Peri) -> Self { + // Init power + T::regs().gprcm(0).rstctl().write(|w| { + w.set_resetstkyclr(vals::Resetstkyclr::CLR); + w.set_resetassert(vals::Resetassert::ASSERT); + w.set_key(vals::ResetKey::KEY); + }); + + // Enable power + T::regs().gprcm(0).pwren().write(|w| { + w.set_enable(true); + w.set_key(vals::PwrenKey::KEY); + }); + + // init delay, 16 cycles + cortex_m::asm::delay(16); + + Self { regs: T::regs() } + } + + /// Internal helper SINCOS function. + fn sincos(&mut self, angle: f32, precision: Precision, sin: bool) -> Result { + self.regs.ctl().write(|w| { + w.set_func(vals::Func::SINCOS); + w.set_numiter(precision as u8); + }); + + if angle > 1.0 || angle < -1.0 { + return Err(Error::AngleInWrongRange); + } + + match signed_f32_to_register(angle, 0) { + Ok(val) => self.regs.op1().write(|w| {w.set_data(val);}), + Err(er) => return Err(er), + }; + + // check if done + while self.regs.status().read().busy() == vals::Busy::NOTDONE {} + + match sin { + true => register_to_signed_f32(self.regs.res2().read().data(), 0), + false => register_to_signed_f32(self.regs.res1().read().data(), 0), + } + } + + /// Calsulates trigonometric sine operation in the range [-1,1) with a give precision. + pub fn sin(&mut self, angle: f32, precision: Precision) -> Result { + self.sincos(angle, precision, true) + } + + /// Calsulates trigonometric cosine operation in the range [-1,1) with a give precision. + pub fn cos(&mut self, angle: f32, precision: Precision) -> Result { + self.sincos(angle, precision, false) + } +} + +pub(crate) trait SealedInstance { + fn regs() -> &'static Regs; +} + +/// Mathacl instance trait +#[allow(private_bounds)] +pub trait Instance: SealedInstance + PeripheralType {} + +macro_rules! impl_mathacl_instance { + ($instance: ident) => { + impl crate::mathacl::SealedInstance for crate::peripherals::$instance { + fn regs() -> &'static crate::pac::mathacl::Mathacl { + &crate::pac::$instance + } + } + + impl crate::mathacl::Instance for crate::peripherals::$instance {} + }; +} + +/// Convert f32 data to understandable by M0 format. +fn signed_f32_to_register(data: f32, n_bits: u8) -> Result { + let mut res: u32 = 0; + // check if negative + let negative = data < 0.0; + + // absolute value for extraction + let abs = data.abs(); + + // total integer bit count + let total_bits = 31; + + // Validate n_bits + if n_bits > 31 { + return Err(Error::NBitsTooBig); + } + + // number of fractional bits + let shift = total_bits - n_bits; + + // Compute masks + let (n_mask, m_mask) = if n_bits == 0 { + (0, 0x7FFFFFFF) + } else if n_bits == 31 { + (0x7FFFFFFF, 0) + } else { + ((1u32 << n_bits) - 1, (1u32 << shift) - 1) + }; + + // calc. integer(n) & fractional(m) parts + let n = abs.floor() as u32; + let mut m = ((abs - abs.floor()) * (1u32 << shift) as f32).round() as u32; + + // Handle trimming integer part + if n_bits == 0 && n > 0 { + m = 0x7FFFFFFF; + } + + // calculate result + if n_bits > 0 { + res = n << shift & n_mask; + } + if shift > 0 { + res = res | m & m_mask; + } + + // if negative, do 2’s compliment + if negative { + res = !res + 1; + } + Ok(res) +} + +/// Reversely converts M0-register format to native f32. +fn register_to_signed_f32(data: u32, n_bits: u8) -> Result { + // Validate n_bits + if n_bits > 31 { + return Err(Error::NBitsTooBig); + } + + // total integer bit count + let total_bits = 31; + + let negative = (data >> 31) == 1; + + // number of fractional bits + let shift = total_bits - n_bits; + + // Compute masks + let (n_mask, m_mask) = if n_bits == 0 { + (0, 0x7FFFFFFF) + } else if n_bits == 31 { + (0x7FFFFFFF, 0) + } else { + ((1u32 << n_bits) - 1, (1u32 << shift) - 1) + }; + + // Compute n and m + let mut n = if n_bits == 0 { + 0 + } else if shift >= 32 { + data & n_mask + } else { + (data >> shift) & n_mask + }; + let mut m = data & m_mask; + + // if negative, do 2’s compliment + if negative { + n = !n & n_mask; + m = (!m & m_mask) + 1; + } + + let mut value = (n as f32) + (m as f32) / (1u32 << shift) as f32; + if negative { + value = -value; + } + return Ok(value); +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn mathacl_convert_func_errors() { + assert_eq!(signed_f32_to_register(0.0, 32), Err(Error::NBitsTooBig)); + assert_eq!(register_to_signed_f32(0, 32), Err(Error::NBitsTooBig)); + } + + #[test] + fn mathacl_signed_f32_to_register() { + let mut test_float = 1.0; + assert_eq!(signed_f32_to_register(test_float, 0).unwrap(), 0x7FFFFFFF); + + test_float = 0.0; + assert_eq!(signed_f32_to_register(test_float, 0).unwrap(), 0x0); + + test_float = -1.0; + assert_eq!(signed_f32_to_register(test_float, 0).unwrap(), 0x80000001); + } + + #[test] + fn mathacl_register_to_signed_f32() { + let mut test_u32: u32 = 0x7FFFFFFF; + assert_eq!(register_to_signed_f32(test_u32, 0u8).unwrap(), 1.0); + + test_u32 = 0x0; + assert_eq!(register_to_signed_f32(test_u32, 0u8).unwrap(), 0.0); + + test_u32 = 0x80000001; + assert_eq!(register_to_signed_f32(test_u32, 0u8).unwrap(), -1.0); + } +} -- cgit From 5729b653ae5a95fe1af131dcbceb9dbb0397f4c6 Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 01:16:30 +0100 Subject: mspm0: add example of MATHACL based & tested on mspm0g3507 --- examples/mspm0g3507/src/bin/mathacl_ops.rs | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/mspm0g3507/src/bin/mathacl_ops.rs diff --git a/examples/mspm0g3507/src/bin/mathacl_ops.rs b/examples/mspm0g3507/src/bin/mathacl_ops.rs new file mode 100644 index 000000000..429cc5ad6 --- /dev/null +++ b/examples/mspm0g3507/src/bin/mathacl_ops.rs @@ -0,0 +1,37 @@ +//! Example of using mathematical calculations performed by the MSPM0G3507 chip. +//! +//! It prints the result of basics trigonometric calculation. + +#![no_std] +#![no_main] + +use defmt::*; +use embassy_executor::Spawner; +use embassy_mspm0::mathacl::{Mathacl, Precision}; +use embassy_time::Timer; +use {defmt_rtt as _, panic_halt as _}; + +#[embassy_executor::main] +async fn main(_spawner: Spawner) -> ! { + info!("Hello world!"); + + let d = embassy_mspm0::init(Default::default()); + + let mut macl = Mathacl::new(d.MATHACL); + + // in range [-1,1) + let angle = 0.5; + match macl.sin(angle, Precision::High) { + Ok(res) => info!("sin({}) = {}", angle*180.0, res), + Err(e) => error!("sin Error: {:?}", e), + } + + match macl.cos(angle, Precision::Medium) { + Ok(res) => info!("cos({}) = {}", angle*180.0, res), + Err(e) => error!("cos Error: {:?}", e), + } + + loop { + Timer::after_millis(500).await; + } +} -- cgit From 0e0253b67100b6ffbaad4f1307f671e9ddec3901 Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 01:24:21 +0100 Subject: mspm0: added PR #4897 description to CHANGELOG --- embassy-mspm0/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-mspm0/CHANGELOG.md b/embassy-mspm0/CHANGELOG.md index f0b5868f4..6972a8472 100644 --- a/embassy-mspm0/CHANGELOG.md +++ b/embassy-mspm0/CHANGELOG.md @@ -19,3 +19,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - feat: Add i2c target implementation (#4605) - fix: group irq handlers must check for NO_INTR (#4785) - feat: Add read_reset_cause function +- feat: Add module Mathacl & example for mspm0g3507 (#4897) \ No newline at end of file -- cgit From f236bb49301e3e726d60e0af8f6b998083b6215e Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 01:29:53 +0100 Subject: mspm0: apply formatting for new Mathacl & example --- embassy-mspm0/src/mathacl.rs | 10 ++++++---- examples/mspm0g3507/src/bin/mathacl_ops.rs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs index 59687ce49..1b1c67a71 100644 --- a/embassy-mspm0/src/mathacl.rs +++ b/embassy-mspm0/src/mathacl.rs @@ -5,10 +5,10 @@ #![macro_use] use embassy_hal_internal::PeripheralType; +use micromath::F32Ext; use crate::Peri; use crate::pac::mathacl::{Mathacl as Regs, vals}; -use micromath::F32Ext; pub enum Precision { High = 31, @@ -64,7 +64,9 @@ impl Mathacl { } match signed_f32_to_register(angle, 0) { - Ok(val) => self.regs.op1().write(|w| {w.set_data(val);}), + Ok(val) => self.regs.op1().write(|w| { + w.set_data(val); + }), Err(er) => return Err(er), }; @@ -142,7 +144,7 @@ fn signed_f32_to_register(data: f32, n_bits: u8) -> Result { let mut m = ((abs - abs.floor()) * (1u32 << shift) as f32).round() as u32; // Handle trimming integer part - if n_bits == 0 && n > 0 { + if n_bits == 0 && n > 0 { m = 0x7FFFFFFF; } @@ -189,7 +191,7 @@ fn register_to_signed_f32(data: u32, n_bits: u8) -> Result { let mut n = if n_bits == 0 { 0 } else if shift >= 32 { - data & n_mask + data & n_mask } else { (data >> shift) & n_mask }; diff --git a/examples/mspm0g3507/src/bin/mathacl_ops.rs b/examples/mspm0g3507/src/bin/mathacl_ops.rs index 429cc5ad6..06265ae18 100644 --- a/examples/mspm0g3507/src/bin/mathacl_ops.rs +++ b/examples/mspm0g3507/src/bin/mathacl_ops.rs @@ -22,12 +22,12 @@ async fn main(_spawner: Spawner) -> ! { // in range [-1,1) let angle = 0.5; match macl.sin(angle, Precision::High) { - Ok(res) => info!("sin({}) = {}", angle*180.0, res), + Ok(res) => info!("sin({}) = {}", angle * 180.0, res), Err(e) => error!("sin Error: {:?}", e), } match macl.cos(angle, Precision::Medium) { - Ok(res) => info!("cos({}) = {}", angle*180.0, res), + Ok(res) => info!("cos({}) = {}", angle * 180.0, res), Err(e) => error!("cos Error: {:?}", e), } -- cgit From d34dd3006dbcaff198c4e72469b5598dc3a8faa0 Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 11:59:57 +0100 Subject: mspm0-mathacl: switch to radians as input param for sincos operations --- embassy-mspm0/src/mathacl.rs | 22 +++++++++++++--------- examples/mspm0g3507/src/bin/mathacl_ops.rs | 13 +++++++------ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs index 1b1c67a71..60e8cc5ed 100644 --- a/embassy-mspm0/src/mathacl.rs +++ b/embassy-mspm0/src/mathacl.rs @@ -4,6 +4,7 @@ #![macro_use] +use core::f32::consts::PI; use embassy_hal_internal::PeripheralType; use micromath::F32Ext; @@ -21,7 +22,7 @@ pub enum Precision { #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[non_exhaustive] pub enum Error { - AngleInWrongRange, + ValueInWrongRange, NBitsTooBig, } @@ -53,17 +54,20 @@ impl Mathacl { } /// Internal helper SINCOS function. - fn sincos(&mut self, angle: f32, precision: Precision, sin: bool) -> Result { + fn sincos(&mut self, rad: f32, precision: Precision, sin: bool) -> Result { self.regs.ctl().write(|w| { w.set_func(vals::Func::SINCOS); w.set_numiter(precision as u8); }); - if angle > 1.0 || angle < -1.0 { - return Err(Error::AngleInWrongRange); + if rad > PI || rad < -PI { + return Err(Error::ValueInWrongRange); } - match signed_f32_to_register(angle, 0) { + // TODO: make f32 division on CPU + let native = rad / PI; + + match signed_f32_to_register(native, 0) { Ok(val) => self.regs.op1().write(|w| { w.set_data(val); }), @@ -80,13 +84,13 @@ impl Mathacl { } /// Calsulates trigonometric sine operation in the range [-1,1) with a give precision. - pub fn sin(&mut self, angle: f32, precision: Precision) -> Result { - self.sincos(angle, precision, true) + pub fn sin(&mut self, rad: f32, precision: Precision) -> Result { + self.sincos(rad, precision, true) } /// Calsulates trigonometric cosine operation in the range [-1,1) with a give precision. - pub fn cos(&mut self, angle: f32, precision: Precision) -> Result { - self.sincos(angle, precision, false) + pub fn cos(&mut self, rad: f32, precision: Precision) -> Result { + self.sincos(rad, precision, false) } } diff --git a/examples/mspm0g3507/src/bin/mathacl_ops.rs b/examples/mspm0g3507/src/bin/mathacl_ops.rs index 06265ae18..aeca96d2b 100644 --- a/examples/mspm0g3507/src/bin/mathacl_ops.rs +++ b/examples/mspm0g3507/src/bin/mathacl_ops.rs @@ -5,6 +5,7 @@ #![no_std] #![no_main] +use core::f32::consts::PI; use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::mathacl::{Mathacl, Precision}; @@ -19,15 +20,15 @@ async fn main(_spawner: Spawner) -> ! { let mut macl = Mathacl::new(d.MATHACL); - // in range [-1,1) - let angle = 0.5; - match macl.sin(angle, Precision::High) { - Ok(res) => info!("sin({}) = {}", angle * 180.0, res), + // value radians [-PI; PI] + let rads = PI * 0.5; + match macl.sin(rads, Precision::High) { + Ok(res) => info!("sin({}) = {}", rads, res), Err(e) => error!("sin Error: {:?}", e), } - match macl.cos(angle, Precision::Medium) { - Ok(res) => info!("cos({}) = {}", angle * 180.0, res), + match macl.cos(rads, Precision::Medium) { + Ok(res) => info!("cos({}) = {}", rads, res), Err(e) => error!("cos Error: {:?}", e), } -- cgit From a3fdfb6db4f9ae79e34875a06325cf9776ce3f8c Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 12:53:36 +0100 Subject: mspm0-mathacl: add phantomdata for module --- embassy-mspm0/src/mathacl.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs index 60e8cc5ed..a28c621c2 100644 --- a/embassy-mspm0/src/mathacl.rs +++ b/embassy-mspm0/src/mathacl.rs @@ -5,6 +5,7 @@ #![macro_use] use core::f32::consts::PI; +use core::marker::PhantomData; use embassy_hal_internal::PeripheralType; use micromath::F32Ext; @@ -26,14 +27,15 @@ pub enum Error { NBitsTooBig, } -#[derive(Copy, Clone)] -pub struct Mathacl { +pub struct Mathacl<'d, T: Instance> { + _peri: Peri<'d, T>, regs: &'static Regs, + _phantom: PhantomData, } -impl Mathacl { +impl<'d, T: Instance> Mathacl<'d, T> { /// Mathacl initialization. - pub fn new(_instance: Peri) -> Self { + pub fn new(instance: Peri<'d, T>) -> Self { // Init power T::regs().gprcm(0).rstctl().write(|w| { w.set_resetstkyclr(vals::Resetstkyclr::CLR); @@ -50,7 +52,11 @@ impl Mathacl { // init delay, 16 cycles cortex_m::asm::delay(16); - Self { regs: T::regs() } + Self { + _peri: instance, + regs: T::regs(), + _phantom: PhantomData, + } } /// Internal helper SINCOS function. -- cgit From 5539288b9e591ff0aa8d91d635bfd7f009d24cb1 Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Sun, 16 Nov 2025 13:07:37 +0100 Subject: mspm0-mathacl: another round of format --- embassy-mspm0/src/mathacl.rs | 1 + examples/mspm0g3507/src/bin/mathacl_ops.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs index a28c621c2..78646c90f 100644 --- a/embassy-mspm0/src/mathacl.rs +++ b/embassy-mspm0/src/mathacl.rs @@ -6,6 +6,7 @@ use core::f32::consts::PI; use core::marker::PhantomData; + use embassy_hal_internal::PeripheralType; use micromath::F32Ext; diff --git a/examples/mspm0g3507/src/bin/mathacl_ops.rs b/examples/mspm0g3507/src/bin/mathacl_ops.rs index aeca96d2b..25d74b29b 100644 --- a/examples/mspm0g3507/src/bin/mathacl_ops.rs +++ b/examples/mspm0g3507/src/bin/mathacl_ops.rs @@ -6,6 +6,7 @@ #![no_main] use core::f32::consts::PI; + use defmt::*; use embassy_executor::Spawner; use embassy_mspm0::mathacl::{Mathacl, Precision}; -- cgit From c646d589afc905020700376144da1dd1398287fc Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Fri, 21 Nov 2025 00:10:56 +0100 Subject: mspm0-mathacl: add non-generic phantomdata --- embassy-mspm0/src/mathacl.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/embassy-mspm0/src/mathacl.rs b/embassy-mspm0/src/mathacl.rs index 78646c90f..e29f4a59e 100644 --- a/embassy-mspm0/src/mathacl.rs +++ b/embassy-mspm0/src/mathacl.rs @@ -28,15 +28,14 @@ pub enum Error { NBitsTooBig, } -pub struct Mathacl<'d, T: Instance> { - _peri: Peri<'d, T>, +pub struct Mathacl<'d> { regs: &'static Regs, - _phantom: PhantomData, + _phantom: PhantomData<&'d mut ()>, } -impl<'d, T: Instance> Mathacl<'d, T> { +impl<'d> Mathacl<'d> { /// Mathacl initialization. - pub fn new(instance: Peri<'d, T>) -> Self { + pub fn new(_instance: Peri<'d, T>) -> Self { // Init power T::regs().gprcm(0).rstctl().write(|w| { w.set_resetstkyclr(vals::Resetstkyclr::CLR); @@ -54,7 +53,6 @@ impl<'d, T: Instance> Mathacl<'d, T> { cortex_m::asm::delay(16); Self { - _peri: instance, regs: T::regs(), _phantom: PhantomData, } -- cgit From 672165572e36d04a59eb672e19ebf4c1726fc8aa Mon Sep 17 00:00:00 2001 From: Siarhei B Date: Fri, 21 Nov 2025 18:22:24 +0100 Subject: mspm0-mathacl: exclude the module for non-supported chips --- embassy-mspm0/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index dda8c373c..c43c81853 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs @@ -19,6 +19,7 @@ pub mod dma; pub mod gpio; pub mod i2c; pub mod i2c_target; +#[cfg(any(mspm0g150x, mspm0g151x, mspm0g350x, mspm0g351x))] pub mod mathacl; pub mod timer; pub mod uart; -- cgit