Skip to main content

I8080

Struct I8080 

Source
pub struct I8080<'d, Dm: DriverMode> { /* private fields */ }
Expand description

Represents the I8080 LCD interface.

Implementations§

Source§

impl<'d, Dm> I8080<'d, Dm>
where Dm: DriverMode,

Source

pub fn new( lcd: Lcd<'d, Dm>, channel: impl LcdDmaTxChannel<'d>, config: Config, ) -> Result<Self, ConfigError>

Creates a new instance of the I8080 LCD interface.

Source

pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>

Applies configuration.

§Errors

ConfigError::Clock when the frequency passed in Config is too low.

Source

pub fn set_byte_order(&mut self, byte_order: ByteOrder) -> &mut Self

Configures the byte order for data transmission in 16-bit mode. This must be set to ByteOrder::default() when transmitting in 8-bit mode.

Source

pub fn set_8bits_order(&mut self, byte_order: ByteOrder) -> &mut Self

Configures the byte order for data transmission in 8-bit mode. This must be set to ByteOrder::default() when transmitting in 16-bit mode.

Source

pub fn set_bit_order(&mut self, bit_order: BitOrder) -> &mut Self

Configures the bit order for data transmission.

Source

pub fn with_cs(self, cs: impl PeripheralOutput<'d>) -> Self

Associates a CS pin with the I8080 interface.

Source

pub fn with_dc(self, dc: impl PeripheralOutput<'d>) -> Self

Associates a DC pin with the I8080 interface.

Source

pub fn with_wrx(self, wrx: impl PeripheralOutput<'d>) -> Self

Associates a WRX pin with the I8080 interface.

Source

pub fn with_data0(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 0 pin with the I8080 interface.

Source

pub fn with_data1(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 1 pin with the I8080 interface.

Source

pub fn with_data2(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 2 pin with the I8080 interface.

Source

pub fn with_data3(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 3 pin with the I8080 interface.

Source

pub fn with_data4(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 4 pin with the I8080 interface.

Source

pub fn with_data5(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 5 pin with the I8080 interface.

Source

pub fn with_data6(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 6 pin with the I8080 interface.

Source

pub fn with_data7(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 7 pin with the I8080 interface.

Source

pub fn with_data8(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 8 pin with the I8080 interface.

Source

pub fn with_data9(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 9 pin with the I8080 interface.

Source

pub fn with_data10(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 10 pin with the I8080 interface.

Source

pub fn with_data11(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 11 pin with the I8080 interface.

Source

pub fn with_data12(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 12 pin with the I8080 interface.

Source

pub fn with_data13(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 13 pin with the I8080 interface.

Source

pub fn with_data14(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 14 pin with the I8080 interface.

Source

pub fn with_data15(self, pin: impl PeripheralOutput<'d>) -> Self

Associates a DATA 15 pin with the I8080 interface.

Source

pub fn send<W: Into<u16> + Copy, BUF: DmaTxBuffer>( self, cmd: impl Into<Command<W>>, dummy: u8, data: BUF, ) -> Result<I8080Transfer<'d, BUF, Dm>, (DmaError, Self, BUF)>

Sends a command and data to the LCD using DMA.

Passing a Command<u8> will make this an 8-bit transfer and a Command<u16> will make this a 16-bit transfer.

A 16-bit transfer on an 8-bit bus silently truncates the 2nd byte and an 8-bit transfer on a 16-bit bus silently pads each byte to 2 bytes.

Source§

impl I8080<'_, Blocking>

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the LCD_CAM interrupt.

The handler services the sources enabled via Self::listen.

Note that this replaces any previously registered handler for the LCD_CAM interrupt, including the one the async driver binds.

Source

pub fn set_dma_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the DMA TX channel used by this driver.

The handler services the sources enabled via Self::listen_dma. It fires on the channel’s own interrupt, which is separate from the LCD_CAM interrupt used by Self::set_interrupt_handler.

Binding the handler unlistens from and clears all DMA TX interrupt sources, so this function must be called before Self::listen_dma. It must also be called before Self::send, which consumes the driver.

Source

pub fn listen(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)

Listens for the given LCD interrupt sources.

Source

pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)

Stops listening for the given LCD interrupt sources.

Source

pub fn interrupts(&mut self) -> EnumSet<I8080Interrupt>

Returns the asserted LCD interrupt sources.

Source

pub fn clear_interrupts( &mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>, )

Clears the given asserted LCD interrupt sources.

Source

pub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)

Listens for the given DMA TX interrupt sources.

A handler must have been registered via Self::set_dma_interrupt_handler first.

Source

pub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)

Stops listening for the given DMA TX interrupt sources.

Source

pub fn interrupts_dma(&mut self) -> EnumSet<DmaTxInterrupt>

Returns the asserted DMA TX interrupt sources.

Source

pub fn clear_interrupts_dma( &mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>, )

Clears the given asserted DMA TX interrupt sources.

Trait Implementations§

Source§

impl<Dm: DriverMode> Debug for I8080<'_, Dm>

Available on crate feature unstable only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d, Dm> !RefUnwindSafe for I8080<'d, Dm>

§

impl<'d, Dm> !UnwindSafe for I8080<'d, Dm>

§

impl<'d, Dm> Freeze for I8080<'d, Dm>
where Lcd<'d, Dm>: Freeze,

§

impl<'d, Dm> Send for I8080<'d, Dm>
where Lcd<'d, Dm>: Send,

§

impl<'d, Dm> Sync for I8080<'d, Dm>
where Lcd<'d, Dm>: Sync,

§

impl<'d, Dm> Unpin for I8080<'d, Dm>
where Lcd<'d, Dm>: Unpin,

§

impl<'d, Dm> UnsafeUnpin for I8080<'d, Dm>
where Lcd<'d, Dm>: UnsafeUnpin,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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.
§

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

Performs the conversion.