display-driver 0.1.0

Async display driver for embedded systems, supporting various display panels and buses.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Implementation of `SimpleDisplayBus` for `display-interface` traits.

use super::{ErrorType, SimpleDisplayBus};
use display_interface::{AsyncWriteOnlyDataCommand, DataFormat, DisplayError};

impl<DI: AsyncWriteOnlyDataCommand> ErrorType for DI {
    type Error = DisplayError;
}

impl<DI: AsyncWriteOnlyDataCommand> SimpleDisplayBus for DI {
    async fn write_cmds(&mut self, cmds: &[u8]) -> Result<(), Self::Error> {
        self.send_commands(DataFormat::U8(cmds)).await
    }

    async fn write_data(&mut self, data: &[u8]) -> Result<(), Self::Error> {
        self.send_data(DataFormat::U8(data)).await
    }
}