components

Module st77xx

Source
Expand description

Components for the ST77XX screen.

§Usage


let bus = components::bus::SpiMasterBusComponent::new().finalize(
    components::spi_bus_component_static!(
        // spi type
        nrf52840::spi::SPIM,
        // chip select
        &nrf52840::gpio::PORT[GPIO_D4],
        // spi mux
        spi_mux
    ),
);

let tft = components::st77xx::ST77XXComponent::new(mux_alarm,
                                                   bus,
                                                   Some(&nrf52840::gpio::PORT[GPIO_D3]),
                                                   Some(&nrf52840::gpio::PORT[GPIO_D2]),
                                                   &capsules_extra::st77xx::ST7735).finalize(
    components::st77xx_component_static!(
        // bus type
        capsules_extra::bus::SpiMasterBus<
            'static,
            VirtualSpiMasterDevice<'static, nrf52840::spi::SPIM>,
        >,
        // timer type
        nrf52840::rtc::Rtc,
        // pin type
        nrf52::gpio::GPIOPin<'static>,
    ),
);

Structs§