Move all gpio logic to Flex
This commit is contained in:
parent
a335589f34
commit
53e40860c1
@ -59,7 +59,7 @@ impl<'d, T: Pin> Input<'d, T> {
|
|||||||
/// Returns current pin level
|
/// Returns current pin level
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_level(&self) -> Level {
|
pub fn get_level(&self) -> Level {
|
||||||
self.pin.is_high().into()
|
self.pin.get_level()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,10 +145,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// Set the output level.
|
/// Set the output level.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_level(&mut self, level: Level) {
|
pub fn set_level(&mut self, level: Level) {
|
||||||
match level {
|
self.pin.set_level(level)
|
||||||
Level::Low => self.pin.set_low(),
|
|
||||||
Level::High => self.pin.set_high(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the output pin set as high?
|
/// Is the output pin set as high?
|
||||||
@ -166,7 +163,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// What level output is set to
|
/// What level output is set to
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_output_level(&self) -> Level {
|
pub fn get_output_level(&self) -> Level {
|
||||||
self.pin.is_set_high().into()
|
self.pin.get_output_level()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ impl<'d, T: Pin> Input<'d, T> {
|
|||||||
/// Returns current pin level
|
/// Returns current pin level
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_level(&self) -> Level {
|
pub fn get_level(&self) -> Level {
|
||||||
self.pin.is_high().into()
|
self.pin.get_level()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,10 +109,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// Set the output level.
|
/// Set the output level.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_level(&mut self, level: Level) {
|
pub fn set_level(&mut self, level: Level) {
|
||||||
match level {
|
self.pin.set_level(level)
|
||||||
Level::Low => self.pin.set_low(),
|
|
||||||
Level::High => self.pin.set_high(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the output pin set as high?
|
/// Is the output pin set as high?
|
||||||
@ -130,7 +127,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// What level output is set to
|
/// What level output is set to
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_output_level(&self) -> Level {
|
pub fn get_output_level(&self) -> Level {
|
||||||
self.pin.is_set_high().into()
|
self.pin.get_output_level()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Toggle pin output
|
/// Toggle pin output
|
||||||
|
@ -303,7 +303,7 @@ impl<'d, T: Pin> Input<'d, T> {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_level(&self) -> Level {
|
pub fn get_level(&self) -> Level {
|
||||||
self.pin.is_high().into()
|
self.pin.get_level()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,10 +365,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// Set the output level.
|
/// Set the output level.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_level(&mut self, level: Level) {
|
pub fn set_level(&mut self, level: Level) {
|
||||||
match level {
|
self.pin.set_level(level)
|
||||||
Level::Low => self.pin.set_low(),
|
|
||||||
Level::High => self.pin.set_high(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the output pin set as high?
|
/// Is the output pin set as high?
|
||||||
@ -386,7 +383,7 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// What level output is set to
|
/// What level output is set to
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_output_level(&self) -> Level {
|
pub fn get_output_level(&self) -> Level {
|
||||||
self.pin.is_set_high().into()
|
self.pin.get_output_level()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Toggle pin output
|
/// Toggle pin output
|
||||||
@ -428,7 +425,7 @@ impl<'d, T: Pin> OutputOpenDrain<'d, T> {
|
|||||||
/// Returns current pin level
|
/// Returns current pin level
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_level(&self) -> Level {
|
pub fn get_level(&self) -> Level {
|
||||||
self.pin.is_high().into()
|
self.pin.get_level()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the output as high.
|
/// Set the output as high.
|
||||||
@ -446,16 +443,13 @@ impl<'d, T: Pin> OutputOpenDrain<'d, T> {
|
|||||||
/// Set the output level.
|
/// Set the output level.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_level(&mut self, level: Level) {
|
pub fn set_level(&mut self, level: Level) {
|
||||||
match level {
|
self.pin.set_level(level);
|
||||||
Level::Low => self.pin.set_low(),
|
|
||||||
Level::High => self.pin.set_high(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the output pin set as high?
|
/// Is the output pin set as high?
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_set_high(&self) -> bool {
|
pub fn is_set_high(&self) -> bool {
|
||||||
!self.is_set_low()
|
self.pin.is_set_high()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is the output pin set as low?
|
/// Is the output pin set as low?
|
||||||
@ -467,7 +461,7 @@ impl<'d, T: Pin> OutputOpenDrain<'d, T> {
|
|||||||
/// What level output is set to
|
/// What level output is set to
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_output_level(&self) -> Level {
|
pub fn get_output_level(&self) -> Level {
|
||||||
self.pin.is_set_high().into()
|
self.pin.get_output_level()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Toggle pin output
|
/// Toggle pin output
|
||||||
|
Loading…
Reference in New Issue
Block a user