From 6e952fe110c2a48204c8cb0a836309ab97e5979a Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Tue, 17 Feb 2026 11:24:06 -0800 Subject: added files --- code_refs/sharpmem.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 code_refs/sharpmem.h (limited to 'code_refs/sharpmem.h') diff --git a/code_refs/sharpmem.h b/code_refs/sharpmem.h new file mode 100644 index 0000000..288a18b --- /dev/null +++ b/code_refs/sharpmem.h @@ -0,0 +1,36 @@ +#include + +#ifndef _STM32_SHARPMEM +#define _STM32_SHARPMEM + +#define SHARPMEM_BIT_WRITECMD (0x01) // 0x80 in LSB format +#define SHARPMEM_BIT_VCOM (0x02) // 0x40 in LSB format +#define SHARPMEM_BIT_CLEAR (0x04) // 0x20 in LSB format + +typedef struct +{ + uint16_t width; + uint16_t height; + uint16_t cs_pin; + GPIO_TypeDef *cs_pin_bank; + uint16_t lcdmode_pin; + GPIO_TypeDef *lcdmode_pin_bank; + SPI_HandleTypeDef *spidev; + + uint8_t *_buffer; + uint8_t _sharpmem_vcom; +} SharpMemDisplay_t; + +void SHARPMEM_draw_pixel(SharpMemDisplay_t *display, uint16_t x, uint16_t y, bool white); +void SHARPMEM_draw_line(SharpMemDisplay_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool white, uint8_t thickness) +void SHARPMEM_draw_circle(SharpMemDisplay_t *display, uint16_t x, uint16_t y, uint8_t r, bool filled); +void SHARPMEM_draw_rect(SharpMemDisplay_t *display, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool filled); +uint8_t SHARPMEM_get_pixel(SharpMemDisplay_t *display, uint16_t x, uint16_t y); +void SHARPMEM_clear_display(SharpMemDisplay_t *display); +void SHARPMEM_refresh_display(SharpMemDisplay_t *display); +void SHARPMEM_clear_display_buffer(SharpMemDisplay_t *display); +uint8_t *SHARPMEM_get_buffer(SharpMemDisplay_t *display); + +void SHARPMEM_TOGGLEVCOM(SharpMemDisplay_t *display); + +#endif \ No newline at end of file -- cgit v1.2.3