diff --git a/src/gpio.rs b/src/gpio.rs index 49bfc67..6964730 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -150,7 +150,7 @@ impl Pin { pub fn get_gpio_mode(&mut self) -> Result { ensure_library_setup!(); - self.pin_mode = unsafe { ffi::orangepi_get_gpio_mode(self.pin_id).try_into()? }; + self.pin_mode = unsafe { ffi::getAlt(self.pin_id).try_into()? }; Ok(self.pin_mode) } @@ -174,7 +174,7 @@ impl Pin { self.ensure_pin_mode(PinMode::Input)?; - unsafe { ffi::orangepi_digitalRead(self.pin_id).try_into() } + unsafe { ffi::digitalRead(self.pin_id).try_into() } } pub fn digital_write(&mut self, value: PinState) -> Result { @@ -182,7 +182,7 @@ impl Pin { self.ensure_pin_mode(PinMode::Output)?; - unsafe { Ok(ffi::orangepi_digitalWrite(self.pin_id, value.into()) == 0) } + unsafe { Ok(ffi::digitalWrite(self.pin_id, value.into()) == 0) } } pub fn pull_up_down_control(&mut self, mode: PullUpMode) {