Crates.io | st7789v2_driver |
lib.rs | st7789v2_driver |
version | 0.1.0 |
source | src |
created_at | 2024-09-24 18:10:31.363611 |
updated_at | 2024-09-24 18:10:31.363611 |
description | Display Driver to Support for ST7789V2 LCD 1.69 inch with embedded-graphics support |
homepage | |
repository | https://github.com/GordonCox/st7789v2_driver.git |
max_upload_size | |
id | 1385519 |
size | 40,572 |
This crate provides a driver for the ST7789V2 display, enabling basic operations such as initialization, clearing the screen, setting pixels, drawing images, and displaying buffers. The driver is built using the embedded-hal
and embedded-graphics
crates to ensure compatibility with various embedded platforms. The crate has been updated to accommodate the latest versions of embedded-hal
and embedded-graphics
.
toml
Copy code
[dependencies] embedded-hal = { version = "1.0.0" } embedded-graphics = { version = "0.7.1" }
For projects that still rely on the older version of the crate, version 0.3.2 continues to provide compatibility with embedded-graphics 0.7.1. This is useful for maintaining projects that use older libraries or hardware.
To use this crate, add the following dependencies to your Cargo.toml
:
embedded-hal
embedded-graphics
st7789v2_driver
The ST7789V2
struct provides methods to interact with the display. Key methods include:
new
: Creates a new instance of the ST7789V2 driver.init
: Initializes the display with a given delay provider.clear_screen
: Clears the screen with a specific color.write_pixel
: Sets the color of a single pixel.draw_image
: Draws an image from a slice of RGB565 data.show
: Displays the provided buffer on the screen.show_region
: Updates only the specified region of the display with the provided buffer.The FrameBuffer
struct represents a frame buffer and includes methods to manipulate it:
new
: Creates a new frame buffer.get_buffer
: Returns a reference to the buffer.clear
: Clears the frame buffer with the specified color.copy_region
: Copies a region from another buffer into this buffer.Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.