Trait stm32_extras::GPIOExtras
[−]
[src]
pub trait GPIOExtras<T> { fn write_pin_range(&self, offset: usize, count: usize, data: u16); fn read_pin_range(&self, offset: usize, count: usize) -> u16; fn pin_config(&self, pin: usize) -> &T; fn write_pin(&self, offset: usize, bit: bool) { ... } fn read_pin(&self, offset: usize) -> bool { ... } }
Convenient access to the bit blocks on GPIO ports.
Required Methods
fn write_pin_range(&self, offset: usize, count: usize, data: u16)
Set count
bits on the GPIO port starting from the bit number offset
. Other bits are not
affected. Uses BSRR register to set/clear individual bits.
Bits must fit into 16 bits of the GPIO port.
fn read_pin_range(&self, offset: usize, count: usize) -> u16
Get count
bits on the GPIO port starting from the bit number offset
.
fn pin_config(&self, pin: usize) -> &T
Get access to configuration bits for pin
of GPIO port.
Provided Methods
fn write_pin(&self, offset: usize, bit: bool)
Set single bit at the given offset
in GPIO port. offset
must be in the range 0..16.
fn read_pin(&self, offset: usize) -> bool
Get single bit at the given offset
in GPIO port. offset
must be in the range 0..16.