Skip to content

Commit d8b7a12

Browse files
committed
Update trait name and visibility
1 parent c61a55e commit d8b7a12

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gpio.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait GpioExt {
1111
fn split(self) -> Self::Parts;
1212
}
1313

14-
pub trait Gpio {
14+
trait GpioRegExt {
1515
fn in_low(&self, pos: u8) -> bool;
1616
fn out_low(&self, pos: u8) -> bool;
1717
fn set_high(&self, pos: u8);
@@ -61,7 +61,7 @@ use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, toggleable};
6161
/// Fully erased pin
6262
pub struct Pin<MODE> {
6363
i: u8,
64-
port: *const Gpio,
64+
port: *const GpioRegExt,
6565
_mode: PhantomData<MODE>,
6666
}
6767

@@ -109,7 +109,7 @@ impl<MODE> InputPin for Pin<Input<MODE>> {
109109

110110
macro_rules! gpio_trait {
111111
($gpiox:ident) => {
112-
impl Gpio for crate::stm32::$gpiox::RegisterBlock {
112+
impl GpioRegExt for crate::stm32::$gpiox::RegisterBlock {
113113
fn in_low(&self, pos :u8) -> bool {
114114
// NOTE(unsafe) atomic read with no side effects
115115
self.idr.read().bits() & (1 << pos) == 0
@@ -151,7 +151,7 @@ macro_rules! gpio {
151151
use super::{
152152
Alternate, Floating, GpioExt, Input, OpenDrain, Output,
153153
PullDown, PullUp, PushPull, AF0, AF1, AF2, AF3, AF4, AF5, AF6, AF7,
154-
Pin, Gpio,
154+
Pin, GpioRegExt,
155155
};
156156

157157
/// GPIO parts
@@ -431,7 +431,7 @@ macro_rules! gpio {
431431
pub fn downgrade(self) -> Pin<Output<MODE>> {
432432
Pin {
433433
i: $i,
434-
port: $GPIOX::ptr() as *const Gpio,
434+
port: $GPIOX::ptr() as *const GpioRegExt,
435435
_mode: self._mode,
436436
}
437437
}
@@ -477,7 +477,7 @@ macro_rules! gpio {
477477
pub fn downgrade(self) -> Pin<Input<MODE>> {
478478
Pin {
479479
i: $i,
480-
port: $GPIOX::ptr() as *const Gpio,
480+
port: $GPIOX::ptr() as *const GpioRegExt,
481481
_mode: self._mode,
482482
}
483483
}

0 commit comments

Comments
 (0)