Struct sam4l::gpio::GPIOPin
[−]
[src]
pub struct GPIOPin { port: *mut Registers, pin_mask: u32, client_data: Cell<usize>, client: Cell<Option<&'static Client>>, }
Fields
port: *mut Registers
pin_mask: u32
client_data: Cell<usize>
client: Cell<Option<&'static Client>>
Methods
impl GPIOPin
[src]
const fn new(pin: Pin) -> GPIOPin
[src]
pub fn set_client<C: Client>(&self, client: &'static C)
[src]
pub fn select_peripheral(&self, function: PeripheralFunction)
[src]
pub fn enable(&self)
[src]
pub fn disable(&self)
[src]
pub fn enable_output(&self)
[src]
pub fn disable_output(&self)
[src]
pub fn enable_pull_down(&self)
[src]
pub fn disable_pull_down(&self)
[src]
pub fn enable_pull_up(&self)
[src]
pub fn disable_pull_up(&self)
[src]
pub fn set_interrupt_mode(&self, mode: u8)
[src]
Sets the interrupt mode registers. Interrupts may fire on the rising or falling edge of the pin or on both.
The mode is a two-bit value based on the mapping from section 23.7.13 of the SAM4L datasheet (page 563):
mode value |
Interrupt Mode |
---|---|
0b00 | Pin change |
0b01 | Rising edge |
0b10 | Falling edge |
pub fn enable_interrupt(&self)
[src]
pub fn disable_interrupt(&self)
[src]
pub fn handle_interrupt(&self)
[src]
pub fn disable_schmidtt_trigger(&self)
[src]
pub fn enable_schmidtt_trigger(&self)
[src]
pub fn read(&self) -> bool
[src]
pub fn toggle(&self)
[src]
pub fn set(&self)
[src]
pub fn clear(&self)
[src]
Trait Implementations
impl Controller for GPIOPin
[src]
impl PinCtl for GPIOPin
[src]
fn set_input_mode(&self, mode: InputMode)
[src]
Configure whether the pin should have a pull-up or pull-down resistor or neither. Read more
impl Pin for GPIOPin
[src]
fn disable(&self)
[src]
Disable the GPIO pin and put it into its lowest power mode. Read more
fn make_output(&self)
[src]
Configure the GPIO pin as an output pin.
fn make_input(&self)
[src]
Configure the GPIO pin as an input pin.
fn read(&self) -> bool
[src]
Get the current state of an input GPIO pin.
fn toggle(&self)
[src]
Toggle the GPIO pin. It must be an output.
fn set(&self)
[src]
Set the GPIO pin high. It must be an output.
fn clear(&self)
[src]
Set the GPIO pin low. It must be an output.
fn enable_interrupt(&self, client_data: usize, mode: InterruptMode)
[src]
Enable an interrupt on the GPIO pin. It must be configured as an interrupt. The identifier
can be any value and will be returned to you when the interrupt on this pin fires. Read more
fn disable_interrupt(&self)
[src]
Disable the interrupt for the GPIO pin.