text/plain
•
1017 B
•
32 lines
#pragma once
#include <stdint.h>
#include <stddef.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);
// Set backlight brightness immediately (0-255)
void set_backlight_brightness(uint8_t level);
// Regularly call this to get smooth backlight updates
void update_backlight_brightness();