Expand description
i.MX RT GPIO driver
§Design
Allocate a Ports
collection. Use this to access GPIO pins and GPIO ports.
- A
Port
maps to a GPIO pin bank.GPIO3
is a port. Ports may provide access to pins. Ports handle interrupts. - A
Pin
maps to a physical GPIO pin.GPIO3[17]
is a pin. It’s identified by itsPinId
,SdB0_05
. Pins can be set as inputs or outputs.
§Example
use imxrt10xx::gpio::{Ports, Port, PinId};
let ports = Ports::new(&ccm);
let pin_from_id = ports.pin(PinId::Emc25);
let pin_from_port = ports.gpio4.pin(25);
assert_eq!(pin_from_id as *const _, pin_from_port as *const _);