rp/gpio: fix is_set_high/is_set_low, expand tests.

This commit is contained in:
Dario Nieuwenhuis
2023-07-11 12:38:53 +02:00
parent 8a811cfcf7
commit 91c1d17f16
3 changed files with 70 additions and 6 deletions

View File

@ -566,13 +566,13 @@ impl<'d, T: Pin> Flex<'d, T> {
/// Is the output level high?
#[inline]
pub fn is_set_high(&self) -> bool {
(self.pin.sio_out().value().read() & self.bit()) == 0
!self.is_set_low()
}
/// Is the output level low?
#[inline]
pub fn is_set_low(&self) -> bool {
!self.is_set_high()
(self.pin.sio_out().value().read() & self.bit()) == 0
}
/// What level output is set to