mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
add a method to clone an iox handle
gpios for everyone!
This commit is contained in:
parent
30fdc139e5
commit
c001b2759e
1 changed files with 2 additions and 0 deletions
|
|
@ -108,6 +108,8 @@ pub struct Iox {
|
||||||
impl Iox {
|
impl Iox {
|
||||||
pub fn new(base_address: *mut u32) -> Self { Iox { csr: SharedCsr::new(base_address) } }
|
pub fn new(base_address: *mut u32) -> Self { Iox { csr: SharedCsr::new(base_address) } }
|
||||||
|
|
||||||
|
pub fn clone(&self) -> Self { Iox { csr: SharedCsr::new(self.csr.base) } }
|
||||||
|
|
||||||
pub fn set_gpio_dir(&self, port: IoxPort, pin: u8, direction: IoxDir) {
|
pub fn set_gpio_dir(&self, port: IoxPort, pin: u8, direction: IoxDir) {
|
||||||
set_pin_in_bank!(self, iox::SFR_GPIOOE_CRGOE0, port, pin, direction)
|
set_pin_in_bank!(self, iox::SFR_GPIOOE_CRGOE0, port, pin, direction)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue