Skip to content

Commit d0d7dd7

Browse files
committed
sealed -> marker
1 parent 11ada10 commit d0d7dd7

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/gpio.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub struct Analog;
157157
/// JTAG/SWD mote (type state)
158158
pub type Debugger = Alternate<0, PushPull>;
159159

160-
mod sealed {
160+
mod marker {
161161
/// Marker trait that show if `ExtiPin` can be implemented
162162
pub trait Interruptable {}
163163
/// Marker trait for readable pin modes
@@ -170,16 +170,16 @@ mod sealed {
170170
pub trait NotAlt {}
171171
}
172172

173-
impl sealed::Readable for Input {}
174-
impl sealed::Readable for Output<OpenDrain> {}
175-
impl sealed::Active for Input {}
176-
impl<Otype> sealed::OutputSpeed for Output<Otype> {}
177-
impl<const A: u8, Otype> sealed::OutputSpeed for Alternate<A, Otype> {}
178-
impl<Otype> sealed::Active for Output<Otype> {}
179-
impl<const A: u8, Otype> sealed::Active for Alternate<A, Otype> {}
180-
impl sealed::NotAlt for Input {}
181-
impl<Otype> sealed::NotAlt for Output<Otype> {}
182-
impl sealed::NotAlt for Analog {}
173+
impl marker::Readable for Input {}
174+
impl marker::Readable for Output<OpenDrain> {}
175+
impl marker::Active for Input {}
176+
impl<Otype> marker::OutputSpeed for Output<Otype> {}
177+
impl<const A: u8, Otype> marker::OutputSpeed for Alternate<A, Otype> {}
178+
impl<Otype> marker::Active for Output<Otype> {}
179+
impl<const A: u8, Otype> marker::Active for Alternate<A, Otype> {}
180+
impl marker::NotAlt for Input {}
181+
impl<Otype> marker::NotAlt for Output<Otype> {}
182+
impl marker::NotAlt for Analog {}
183183

184184
/// GPIO Pin speed selection
185185
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
@@ -205,7 +205,7 @@ pub enum Edge {
205205
RisingFalling,
206206
}
207207

208-
use sealed::Interruptable;
208+
use marker::Interruptable;
209209
impl<MODE> Interruptable for Output<MODE> {}
210210
impl Interruptable for Input {}
211211

@@ -417,7 +417,7 @@ impl<const P: char, const N: u8, MODE> PinExt for Pin<P, N, MODE> {
417417

418418
impl<const P: char, const N: u8, MODE> Pin<P, N, MODE>
419419
where
420-
MODE: sealed::OutputSpeed,
420+
MODE: marker::OutputSpeed,
421421
{
422422
/// Set pin speed
423423
pub fn set_speed(&mut self, _ospeedr: &mut OSPEEDR<P>, speed: Speed) {
@@ -439,7 +439,7 @@ where
439439

440440
impl<const P: char, const N: u8, MODE> Pin<P, N, MODE>
441441
where
442-
MODE: sealed::Active,
442+
MODE: marker::Active,
443443
{
444444
/// Set the internal pull-up and pull-down resistor
445445
pub fn set_internal_resistor(&mut self, _pupdr: &mut PUPDR<P>, resistor: Pull) {
@@ -586,7 +586,7 @@ impl<const P: char, const N: u8, MODE> Pin<P, N, Output<MODE>> {
586586

587587
impl<const P: char, const N: u8, MODE> Pin<P, N, MODE>
588588
where
589-
MODE: sealed::Readable,
589+
MODE: marker::Readable,
590590
{
591591
/// Is the input pin high?
592592
#[inline(always)]

src/gpio/erased.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<MODE> ErasedPin<Output<MODE>> {
138138

139139
impl<MODE> ErasedPin<MODE>
140140
where
141-
MODE: super::sealed::Readable,
141+
MODE: super::marker::Readable,
142142
{
143143
/// Is the input pin high?
144144
#[inline(always)]

src/gpio/hal_02.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<const P: char, const N: u8, MODE> ToggleableOutputPin for Pin<P, N, Output<
5151

5252
impl<const P: char, const N: u8, MODE> InputPin for Pin<P, N, MODE>
5353
where
54-
MODE: super::sealed::Readable,
54+
MODE: super::marker::Readable,
5555
{
5656
type Error = Infallible;
5757

@@ -147,7 +147,7 @@ impl<MODE> ToggleableOutputPin for ErasedPin<Output<MODE>> {
147147

148148
impl<MODE> InputPin for ErasedPin<MODE>
149149
where
150-
MODE: super::sealed::Readable,
150+
MODE: super::marker::Readable,
151151
{
152152
type Error = core::convert::Infallible;
153153

@@ -204,7 +204,7 @@ impl<const P: char, MODE> ToggleableOutputPin for PartiallyErasedPin<P, Output<M
204204

205205
impl<const P: char, MODE> InputPin for PartiallyErasedPin<P, MODE>
206206
where
207-
MODE: super::sealed::Readable,
207+
MODE: super::marker::Readable,
208208
{
209209
type Error = Infallible;
210210

src/gpio/partially_erased.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<const P: char, MODE> PartiallyErasedPin<P, Output<MODE>> {
119119

120120
impl<const P: char, MODE> PartiallyErasedPin<P, MODE>
121121
where
122-
MODE: super::sealed::Readable,
122+
MODE: super::marker::Readable,
123123
{
124124
/// Is the input pin high?
125125
#[inline(always)]

0 commit comments

Comments
 (0)