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,
impl<'d, Dm> I8080<'d, Dm>where
Dm: DriverMode,
Sourcepub fn new(
lcd: Lcd<'d, Dm>,
channel: impl LcdDmaTxChannel<'d>,
config: Config,
) -> Result<Self, ConfigError>
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.
Sourcepub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
Sourcepub fn set_byte_order(&mut self, byte_order: ByteOrder) -> &mut Self
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.
Sourcepub fn set_8bits_order(&mut self, byte_order: ByteOrder) -> &mut Self
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.
Sourcepub fn set_bit_order(&mut self, bit_order: BitOrder) -> &mut Self
pub fn set_bit_order(&mut self, bit_order: BitOrder) -> &mut Self
Configures the bit order for data transmission.
Sourcepub fn with_cs(self, cs: impl PeripheralOutput<'d>) -> Self
pub fn with_cs(self, cs: impl PeripheralOutput<'d>) -> Self
Associates a CS pin with the I8080 interface.
Sourcepub fn with_dc(self, dc: impl PeripheralOutput<'d>) -> Self
pub fn with_dc(self, dc: impl PeripheralOutput<'d>) -> Self
Associates a DC pin with the I8080 interface.
Sourcepub fn with_wrx(self, wrx: impl PeripheralOutput<'d>) -> Self
pub fn with_wrx(self, wrx: impl PeripheralOutput<'d>) -> Self
Associates a WRX pin with the I8080 interface.
Sourcepub fn with_data0(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data0(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 0 pin with the I8080 interface.
Sourcepub fn with_data1(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data1(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 1 pin with the I8080 interface.
Sourcepub fn with_data2(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data2(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 2 pin with the I8080 interface.
Sourcepub fn with_data3(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data3(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 3 pin with the I8080 interface.
Sourcepub fn with_data4(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data4(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 4 pin with the I8080 interface.
Sourcepub fn with_data5(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data5(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 5 pin with the I8080 interface.
Sourcepub fn with_data6(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data6(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 6 pin with the I8080 interface.
Sourcepub fn with_data7(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data7(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 7 pin with the I8080 interface.
Sourcepub fn with_data8(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data8(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 8 pin with the I8080 interface.
Sourcepub fn with_data9(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data9(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 9 pin with the I8080 interface.
Sourcepub fn with_data10(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data10(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 10 pin with the I8080 interface.
Sourcepub fn with_data11(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data11(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 11 pin with the I8080 interface.
Sourcepub fn with_data12(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data12(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 12 pin with the I8080 interface.
Sourcepub fn with_data13(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data13(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 13 pin with the I8080 interface.
Sourcepub fn with_data14(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data14(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 14 pin with the I8080 interface.
Sourcepub fn with_data15(self, pin: impl PeripheralOutput<'d>) -> Self
pub fn with_data15(self, pin: impl PeripheralOutput<'d>) -> Self
Associates a DATA 15 pin with the I8080 interface.
Sourcepub 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)>
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.
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.
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
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.
Sourcepub fn set_dma_interrupt_handler(&mut self, handler: InterruptHandler)
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.
Sourcepub fn listen(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)
pub fn listen(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)
Listens for the given LCD interrupt sources.
Sourcepub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>)
Stops listening for the given LCD interrupt sources.
Sourcepub fn interrupts(&mut self) -> EnumSet<I8080Interrupt>
pub fn interrupts(&mut self) -> EnumSet<I8080Interrupt>
Returns the asserted LCD interrupt sources.
Sourcepub fn clear_interrupts(
&mut self,
interrupts: impl Into<EnumSet<I8080Interrupt>>,
)
pub fn clear_interrupts( &mut self, interrupts: impl Into<EnumSet<I8080Interrupt>>, )
Clears the given asserted LCD interrupt sources.
Sourcepub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
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.
Sourcepub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
pub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
Stops listening for the given DMA TX interrupt sources.
Sourcepub fn interrupts_dma(&mut self) -> EnumSet<DmaTxInterrupt>
pub fn interrupts_dma(&mut self) -> EnumSet<DmaTxInterrupt>
Returns the asserted DMA TX interrupt sources.
Sourcepub fn clear_interrupts_dma(
&mut self,
interrupts: impl Into<EnumSet<DmaTxInterrupt>>,
)
pub fn clear_interrupts_dma( &mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>, )
Clears the given asserted DMA TX interrupt sources.