Struct apollo3::gpio::Port

source ·
pub struct Port<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Port<'a>

source

pub const fn new() -> Self

source§

impl Port<'_>

source

pub fn handle_interrupt(&self)

source

pub fn enable_uart(&self, tx_pin: &GpioPin<'_>, rx_pin: &GpioPin<'_>)

source

pub fn enable_sx1262_radio_pins(&self)

This function configures some GPIO pins on the Apollo3 to allow communication with a SX1262 LoRa module.

The pin mapping is setup to match what is used by the NM180100 SoC (shown below)

IOM3: Semtech SX1262 Apollo 3 Pin Number | Apollo 3 Name | SX1262 Pin Number | SX1262 Name | SX1262 Description H6 | GPIO 36 | 19 | NSS | SPI slave select J6 | GPIO 38 | 17 | MOSI | SPI slave input J5 | GPIO 43 | 16 | MISO | SPI slave output H5 | GPIO 42 | 18 | SCK | SPI clock input J8 | GPIO 39 | 14 | BUSY | Radio busy indicator J9 | GPIO 40 | 13 | DIO1 | Multipurpose digital I/O H9 | GPIO 47 | 6 | DIO3 | Multipurpose digital I/O J7 | GPIO 44 | 15 | NRESET | Radio reset signal, active low

This should be used by the lora_things_plus board or any other board using the Apollo3 based NM180100 SoC. This function would also work for any Apollo3 board using the same pins and IOM as specified above.

source

pub fn enable_i2c(&self, sda: &GpioPin<'_>, scl: &GpioPin<'_>)

source

pub fn enable_i2c_slave(&self, sda: &GpioPin<'_>, scl: &GpioPin<'_>)

source

pub fn enable_spi( &self, sck: &GpioPin<'_>, mosi: &GpioPin<'_>, miso: &GpioPin<'_> )

Trait Implementations§

source§

impl<'a> Index<usize> for Port<'a>

§

type Output = GpioPin<'a>

The returned type after indexing.
source§

fn index(&self, index: usize) -> &GpioPin<'a>

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> IndexMut<usize> for Port<'a>

source§

fn index_mut(&mut self, index: usize) -> &mut GpioPin<'a>

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Port<'a>

§

impl<'a> !RefUnwindSafe for Port<'a>

§

impl<'a> !Send for Port<'a>

§

impl<'a> !Sync for Port<'a>

§

impl<'a> Unpin for Port<'a>

§

impl<'a> !UnwindSafe for Port<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.