Skip to main content

Module i8080

Module i8080 

Source
Expand description

§LCD - I8080/MOTO6800 Mode.

§Overview

The LCD_CAM peripheral I8080 driver provides support for the I8080 format/timing. The driver mandates DMA (Direct Memory Access) for efficient data transfer.

§Examples

§MIPI-DSI Display

The following example shows how to send a command to a MIPI-DSI display over the I8080 protocol.



let lcd_cam = LcdCam::new(peripherals.LCD_CAM);

let config = Config::default().with_frequency(Rate::from_mhz(20));

let mut i8080 = I8080::new(lcd_cam.lcd, peripherals.DMA_CH0, config)?
    .with_dc(peripherals.GPIO0)
    .with_wrx(peripherals.GPIO47)
    .with_data0(peripherals.GPIO9)
    .with_data1(peripherals.GPIO46)
    .with_data2(peripherals.GPIO3)
    .with_data3(peripherals.GPIO8)
    .with_data4(peripherals.GPIO18)
    .with_data5(peripherals.GPIO17)
    .with_data6(peripherals.GPIO16)
    .with_data7(peripherals.GPIO15);

dma_buf.fill(&[0x55]);
let transfer = i8080.send(0x3Au8, 0, dma_buf)?; // RGB565
transfer.wait();

§Interrupts

The I8080 driver owns two interrupt domains: the LCD half of the LCD_CAM peripheral, and the DMA TX channel it was created with. The LCD sources fire on the LCD_CAM interrupt, while the DMA sources fire on the DMA channel’s own interrupt, so each domain binds its own handler and controls its sources separately. Handlers are registered with I8080::set_interrupt_handler and I8080::set_dma_interrupt_handler, and sources are enabled with I8080::listen and I8080::listen_dma.

§Notifying on descriptor completion

In continuous output mode the transfer does not finish, but every descriptor with the suc_eof bit set raises the DMA channel’s DmaTxInterrupt::Eof source once its data has been sent:


#[handler]
fn dma_handler() {
    EOF_COUNT.fetch_add(1, core::sync::atomic::Ordering::Relaxed);
    // The source is cleared through the transfer, see below.
}

// Binding the handler must happen before listening for DMA sources, and
// before `send` consumes the driver.
i8080.set_dma_interrupt_handler(dma_handler);
i8080.listen_dma(DmaTxInterrupt::Eof);

let transfer = i8080.send(0x3Au8, 0, dma_buf)?; // RGB565

// In `dma_handler`, clear the source through the transfer:
// transfer.clear_interrupts_dma(DmaTxInterrupt::Eof);
transfer.wait();

Structs§

Config
Configuration settings for the I8080 interface.
I8080
Represents the I8080 LCD interface.
I8080Transfer
Represents an ongoing (or potentially finished) transfer using the I8080 LCD interface

Enums§

Command
LCD_CAM I8080 command.
ConfigError
A configuration error.
I8080Interruptunstable
Interrupt sources of the LCD half of the LCD_CAM peripheral, as exposed by the I8080 driver.