[][src]Struct teensy::port::Pin

pub struct Pin {
    pub portname: PortName,
    pub id: usize,
    pub pcr: &'static mut Volatile<u32>,
}

Fields

portname: PortNameid: usizepcr: &'static mut Volatile<u32>

Methods

impl Pin[src]

pub unsafe fn new(number: usize) -> Self[src]

Create a pin from the pin number indicated in the schematic representation of the teensy Will panic if the number is more than 33

pub unsafe fn set_pin_mode(&mut self, mode: u32)[src]

update the mode of the pin. You should not use this function directly and look if there is a function handling this for you once you consumed your port into a pin (like make_gpio).

pub unsafe fn with_pin_mode(self, mode: u32) -> Self[src]

update the mode of the pin. You should not use this function directly and look if there is a function handling this for you once you consumed your port into a pin (like make_gpio).

pub unsafe fn set_pin_ps(&mut self, mode: bool)[src]

Pull Select

This bit is read only for pins that do not support a configurable pull resistor direction. Pull configuration is valid in all digital pin muxing modes.

  • false: Internal pulldown resistor is enabled on the corresponding pin, if the corresponding Port Pull Enable field is set.
  • true: Internal pullup resistor is enabled on the corresponding pin, if the corresponding Port Pull Enable field is set.

pub unsafe fn with_pin_ps(self, mode: bool) -> Self[src]

Refer to the set_pin_ps method

pub unsafe fn set_pin_pe(&mut self, mode: bool)[src]

Pull Enable

This bit is read only for pins that do not support a configurable pull resistor. Pull configuration is valid in all digital pin muxing modes.

  • false: Internal pullup or pulldown resistor is not enabled on the corresponding pin.
  • true: Internal pullup or pulldown resistor is enabled on the corresponding pin, if the pin is configured as a digital input.

pub unsafe fn with_pin_pe(self, mode: bool) -> Self[src]

Refer to the set_pin_pe method

pub unsafe fn set_pin_sre(&mut self, mode: bool)[src]

Slew Rate Enable

This bit is read only for pins that do not support a configurable slew rate. Slew rate configuration is valid in all digital pin muxing modes.

  • false: Fast slew rate is configured on the corresponding pin, if the pin is configured as a digital output.
  • true: Slow slew rate is configured on the corresponding pin, if the pin is configured as a digital output.

pub unsafe fn with_pin_sre(self, mode: bool) -> Self[src]

Refer to the set_pin_sre method

pub unsafe fn set_pin_pfe(&mut self, mode: bool)[src]

Passive Filter Enable

This bit is read only for pins that do not support a configurable passive input filter. Passive filter configuration is valid in all digital pin muxing modes.

  • false: Passive input filter is disabled on the corresponding pin.
  • true: Passive input filter is enabled on the corresponding pin, if the pin is configured as a digital input. A low pass filter of 10 MHz to 30 MHz bandwidth is enabled on the digital input path. Disable the passive input filter when high speed interfaces of more than 2 MHz are supported on the pin.

pub unsafe fn with_pin_pfe(self, mode: bool) -> Self[src]

Refer to the set_pin_pfe method

pub unsafe fn set_pin_ode(&mut self, mode: bool)[src]

Open Drain Enable

This bit is read only for pins that do not support a configurable open drain output. Open drain configuration is valid in all digital pin muxing modes.

  • false: Open drain output is disabled on the corresponding pin.
  • true: Open drain output is enabled on the corresponding pin, if the pin is configured as a digital output.

pub unsafe fn with_pin_ode(self, mode: bool) -> Self[src]

Refer to the set_pin_ode method

pub unsafe fn set_pin_dse(&mut self, mode: bool)[src]

Drive Strength Enable

This bit is read only for pins that do not support a configurable drive strength. Drive strength configuration is valid in all digital pin muxing modes.

  • false: Low drive strength is configured on the corresponding pin, if pin is configured as a digital output.
  • true: High drive strength is configured on the corresponding pin, if pin is configured as a digital output.

pub unsafe fn with_pin_dse(self, mode: bool) -> Self[src]

Refer to the set_pin_dse method

pub fn make_gpio(self) -> Gpio[src]

Put the pin in gpio mode and consume the pin into a gpio

Auto Trait Implementations

impl Send for Pin

impl Sync for Pin

impl Unpin for Pin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.