Login
1 branch 0 tags
Ben (Desktop/Arch) Added a testsuite 7a0c574 28 days ago 84 Commits
moon / esp32 / main / st7735.h
#pragma once

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

// Initialize ST7735 display over SPI
void st7735_init(void);

// Set drawing window (column/row address)
void st7735_set_window(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);

// Write RGB565 pixel data to display (blocking, 2 bytes per pixel)
void st7735_write_pixels(const uint16_t *data, size_t len);

// Queue entire flush (set_window + pixels) as async DMA pipeline
void st7735_flush_async(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,
                        const uint16_t *pixels, size_t pixel_count);

// Wait for all queued flush transactions to complete
void st7735_flush_wait(void);

// Put display into hardware sleep mode (SLPIN + DISPOFF)
void st7735_sleep(void);

// Wake display from hardware sleep mode (SLPOUT + DISPON)
void st7735_wake(void);

// Returns true if display is in hardware sleep mode
bool st7735_is_sleeping(void);