mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
stm32 CORDIC: use private_bounds for sealed traits.
This commit is contained in:
parent
0abcccee96
commit
8fa1d06a6a
@ -11,16 +11,11 @@ pub use enums::*;
|
||||
mod errors;
|
||||
pub use errors::*;
|
||||
|
||||
mod sealed;
|
||||
use self::sealed::SealedInstance;
|
||||
|
||||
pub mod utils;
|
||||
|
||||
pub(crate) mod sealed;
|
||||
|
||||
/// Low-level CORDIC access.
|
||||
#[cfg(feature = "unstable-pac")]
|
||||
pub mod low_level {
|
||||
pub use super::sealed::*;
|
||||
}
|
||||
|
||||
/// CORDIC driver
|
||||
pub struct Cordic<'d, T: Instance> {
|
||||
peri: PeripheralRef<'d, T>,
|
||||
@ -28,7 +23,8 @@ pub struct Cordic<'d, T: Instance> {
|
||||
}
|
||||
|
||||
/// CORDIC instance trait
|
||||
pub trait Instance: sealed::Instance + Peripheral<P = Self> + crate::rcc::RccPeripheral {}
|
||||
#[allow(private_bounds)]
|
||||
pub trait Instance: SealedInstance + Peripheral<P = Self> + crate::rcc::RccPeripheral {}
|
||||
|
||||
/// CORDIC configuration
|
||||
#[derive(Debug)]
|
||||
@ -609,7 +605,7 @@ foreach_interrupt!(
|
||||
impl Instance for peripherals::$inst {
|
||||
}
|
||||
|
||||
impl sealed::Instance for peripherals::$inst {
|
||||
impl SealedInstance for peripherals::$inst {
|
||||
fn regs() -> crate::pac::cordic::Cordic {
|
||||
crate::pac::$inst
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use super::*;
|
||||
use crate::pac::cordic::vals;
|
||||
|
||||
/// Cordic instance
|
||||
pub trait Instance {
|
||||
pub(super) trait SealedInstance {
|
||||
/// Get access to CORDIC registers
|
||||
fn regs() -> crate::pac::cordic::Cordic;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user