Struct tm4c123x_hal::spi::Spi

source ·
pub struct Spi<SPI, PINS> { /* private fields */ }
Expand description

SPI peripheral operating in full duplex master mode

Implementations§

source§

impl<SCK, MISO, MOSI> Spi<SSI0, (SCK, MISO, MOSI)>

source

pub fn spi0<F>( spi: SSI0, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCK: SckPin<SSI0>, MISO: MisoPin<SSI0>, MOSI: MosiPin<SSI0>,

Configures the SPI peripheral to operate in full duplex master mode

source

pub fn free(self) -> (SSI0, (SCK, MISO, MOSI))

Releases the SPI peripheral and associated pins

source

pub fn reclock<F>(&mut self, freq: F, clocks: &Clocks)where F: Into<Hertz>,

Change the clock frequency of the SPI device.

source§

impl<SCK, MISO, MOSI> Spi<SSI1, (SCK, MISO, MOSI)>

source

pub fn spi1<F>( spi: SSI1, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCK: SckPin<SSI1>, MISO: MisoPin<SSI1>, MOSI: MosiPin<SSI1>,

Configures the SPI peripheral to operate in full duplex master mode

source

pub fn free(self) -> (SSI1, (SCK, MISO, MOSI))

Releases the SPI peripheral and associated pins

source

pub fn reclock<F>(&mut self, freq: F, clocks: &Clocks)where F: Into<Hertz>,

Change the clock frequency of the SPI device.

source§

impl<SCK, MISO, MOSI> Spi<SSI2, (SCK, MISO, MOSI)>

source

pub fn spi2<F>( spi: SSI2, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCK: SckPin<SSI2>, MISO: MisoPin<SSI2>, MOSI: MosiPin<SSI2>,

Configures the SPI peripheral to operate in full duplex master mode

source

pub fn free(self) -> (SSI2, (SCK, MISO, MOSI))

Releases the SPI peripheral and associated pins

source

pub fn reclock<F>(&mut self, freq: F, clocks: &Clocks)where F: Into<Hertz>,

Change the clock frequency of the SPI device.

source§

impl<SCK, MISO, MOSI> Spi<SSI3, (SCK, MISO, MOSI)>

source

pub fn spi3<F>( spi: SSI3, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCK: SckPin<SSI3>, MISO: MisoPin<SSI3>, MOSI: MosiPin<SSI3>,

Configures the SPI peripheral to operate in full duplex master mode

source

pub fn free(self) -> (SSI3, (SCK, MISO, MOSI))

Releases the SPI peripheral and associated pins

source

pub fn reclock<F>(&mut self, freq: F, clocks: &Clocks)where F: Into<Hertz>,

Change the clock frequency of the SPI device.

Trait Implementations§

source§

impl<PINS> FullDuplex<u8> for Spi<SSI0, PINS>

§

type Error = Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u8, Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, byte: u8) -> Result<(), Error>

Sends a word to the slave
source§

impl<PINS> FullDuplex<u8> for Spi<SSI1, PINS>

§

type Error = Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u8, Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, byte: u8) -> Result<(), Error>

Sends a word to the slave
source§

impl<PINS> FullDuplex<u8> for Spi<SSI2, PINS>

§

type Error = Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u8, Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, byte: u8) -> Result<(), Error>

Sends a word to the slave
source§

impl<PINS> FullDuplex<u8> for Spi<SSI3, PINS>

§

type Error = Error

An enumeration of SPI errors
source§

fn read(&mut self) -> Result<u8, Error>

Reads the word stored in the shift register Read more
source§

fn send(&mut self, byte: u8) -> Result<(), Error>

Sends a word to the slave
source§

impl<PINS> Default<u8> for Spi<SSI0, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI0, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI1, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI1, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI2, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI2, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI3, PINS>

source§

impl<PINS> Default<u8> for Spi<SSI3, PINS>

Auto Trait Implementations§

§

impl<SPI, PINS> RefUnwindSafe for Spi<SPI, PINS>where PINS: RefUnwindSafe, SPI: RefUnwindSafe,

§

impl<SPI, PINS> Send for Spi<SPI, PINS>where PINS: Send, SPI: Send,

§

impl<SPI, PINS> Sync for Spi<SPI, PINS>where PINS: Sync, SPI: Sync,

§

impl<SPI, PINS> Unpin for Spi<SPI, PINS>where PINS: Unpin, SPI: Unpin,

§

impl<SPI, PINS> UnwindSafe for Spi<SPI, PINS>where PINS: UnwindSafe, SPI: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<W, S> Transfer<W> for Swhere S: Default<W>, W: Clone,

§

type Error = <S as FullDuplex<W>>::Error

Error type
source§

fn transfer<'w>( &mut self, words: &'w mut [W] ) -> Result<&'w [W], <S as FullDuplex<W>>::Error>

Sends words to the slave. Returns the words received from the slave
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
source§

impl<W, S> Write<W> for Swhere S: Default<W>, W: Clone,

§

type Error = <S as FullDuplex<W>>::Error

Error type
source§

fn write(&mut self, words: &[W]) -> Result<(), <S as FullDuplex<W>>::Error>

Sends words to the slave, ignoring all the incoming words