Struct Commands

Source
pub struct Commands<S> { /* private fields */ }
Expand description

Commands of ST7735 in their original form, except that the parameters of each command are typed.

Implementations§

Source§

impl<S: DcxPin> Commands<S>

Source

pub fn new(spi: S) -> Self

Creates a new instance with an spi object.

Source§

impl<S> Commands<S>
where for<'a> S: DcxPin + WriteU8<'a> + WriteU8s<'a>,

Source

pub async fn caset(&mut self, begin: u16, end: u16)

Sets the column address window as begin to end, both inclusive.

Source

pub async fn raset(&mut self, begin: u16, end: u16)

Sets the row address window as begin to end, both inclusive.

Source

pub async fn ramwr(&mut self) -> RamWriter<'_, S>

Starts writing memory. The returned object can be used to actually do the memory writing.

Source

pub async fn rgbset(&mut self) -> RamWriter<'_, S>

Starts writing the RGB lookup table (see the ST7735S datasheet sec 9.18).

The returned object can be used to actually do the memory writing. The user is expected to write exactly 128 bytes, which is not enforced by the library.

The lookup table is needed when the color mode (see colmod()) is not Colmod::R6G6B6.

Source

pub async fn ptlar(&mut self, begin: u16, end: u16)

Sets the partial area address window as begin to end, both inclusive.

Source

pub async fn scrlar(&mut self, top: u16, visible: u16, bottom: u16)

Sets the scroll area address windows.

Source

pub async fn nop(&mut self)

Does nothing.

Source

pub async fn swreset(&mut self)

Software-resets.

Source

pub async fn slpin(&mut self)

Enters the sleep mode.

Source

pub async fn slpout(&mut self)

Exits the sleep mode.

Source

pub async fn ptlon(&mut self)

Enters the partial mode.

Source

pub async fn noron(&mut self)

Enters the normal mode (i.e., exits the partial mode).

Source

pub async fn invoff(&mut self)

Disables the inversion mode.

Source

pub async fn invon(&mut self)

Enables the inversion mode.

Source

pub async fn dispoff(&mut self)

Turns the display/screen off.

Source

pub async fn dispon(&mut self)

Turns the display/screen on.

Source

pub async fn teoff(&mut self)

Turns the tear effect line off.

Source

pub async fn teon(&mut self, te_mode: bool)

Turns the tear effect line on with the given mode.

Source

pub async fn madctl(&mut self, data: Madctl)

Sets the MADCTL register.

Source

pub async fn idmoff(&mut self)

Turns the idle mode off, i.e., enables the full color mode.

Source

pub async fn idmon(&mut self)

Turns the idle mode on, i.e., enables the 8-color mode.

Source

pub async fn colmod(&mut self, data: Colmod)

Sets the color mode, i.e., how many bits of the R, G and B components have.

Source§

impl<S> Commands<S>
where for<'a> S: DcxPin + WriteU8<'a> + Read<'a>,

Source

pub async fn rddid(&mut self) -> [u8; 3]

Reads ID1, ID2 and ID3 of the screen with a single command.

Source

pub async fn rdid1(&mut self) -> u8

Reads ID1, i.e., the manufacturer ID. Unless reprogrammed, the value should be 0x7C (decimal 124).

Source

pub async fn rdid2(&mut self) -> u8

Reads ID2’ i.e., the LCD’s “module/driver version ID”. The highest bit is always 1.

Source

pub async fn rdid3(&mut self) -> u8

Reads ID3, i.e., the LCD’s “module/driver ID”.

Trait Implementations§

Source§

impl<S: Debug> Debug for Commands<S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for Commands<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Commands<S>
where S: RefUnwindSafe,

§

impl<S> Send for Commands<S>
where S: Send,

§

impl<S> Sync for Commands<S>
where S: Sync,

§

impl<S> Unpin for Commands<S>
where S: Unpin,

§

impl<S> UnwindSafe for Commands<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

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

Performs the conversion.