aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Bevenius <[email protected]>2022-05-11 16:23:31 +0200
committerDaniel Bevenius <[email protected]>2022-05-11 16:23:31 +0200
commit6d4a49bca86415b88f282d084cfa4045c171e63a (patch)
tree1e2f595054f0aa405fcd0f38a8a8aae18f34970e
parent69e0f9f0fea8731fa23b4b62707ca2641f5f301a (diff)
Implement Output::is_set_low for embassy-rp
This commit implements a suggestion for the method is_set_low which is currently a 'todo', by reading last value written to GPIO_OUT.
-rw-r--r--embassy-rp/src/gpio.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 598759036..9cdba8bf3 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -127,8 +127,8 @@ impl<'d, T: Pin> Output<'d, T> {
127 127
128 /// Is the output pin set as low? 128 /// Is the output pin set as low?
129 pub fn is_set_low(&self) -> bool { 129 pub fn is_set_low(&self) -> bool {
130 // todo 130 // Reading from SIO: GPIO_OUT gives the last value written.
131 true 131 unsafe { self.pin.sio_out().value().read() == 0 }
132 } 132 }
133} 133}
134 134