hollyhock
Loading...
Searching...
No Matches
lcd.hpp
Go to the documentation of this file.
1
27#pragma once
28#include <stdint.h>
29
35const uint8_t PALETTE_BLACK = 0;
36const uint8_t PALETTE_BLUE = 1;
37const uint8_t PALETTE_GREEN = 2;
38const uint8_t PALETTE_CYAN = 3;
39const uint8_t PALETTE_RED = 4;
40const uint8_t PALETTE_MAGENTA = 5;
41const uint8_t PALETTE_YELLOW = 6;
42const uint8_t PALETTE_WHITE = 7;
44
53#define RGB_TO_RGB565(r, g, b) ( \
54 ((r & 0x1F) << 11) | \
55 ((g & 0x3F) << 5) | \
56 (b & 0x1F) \
57)
58
65#define RGB565_TO_R(rgb565) ((rgb565 >> 11) & 0x1F)
66
73#define RGB565_TO_G(rgb565) ((rgb565 >> 5) & 0x3F)
74
81#define RGB565_TO_B(rgb565) (rgb565 & 0x1F)
82
86extern "C"
88
97extern "C"
98uint16_t LCD_GetPixel(int x, int y);
99
105extern "C"
106void LCD_GetSize(int *width, int *height);
107
115extern "C"
117
121extern "C"
123
131extern "C"
132void LCD_SetPixel(int x, int y, uint16_t color);
133
141extern "C"
142void LCD_SetPixelFromPalette(int x, int y, uint8_t index);
143
151extern "C"
153
160extern "C"
void LCD_VRAMRestore()
uint16_t * LCD_GetVRAMAddress()
void LCD_ClearScreen()
void LCD_VRAMBackup()
uint16_t LCD_GetPixel(int x, int y)
void LCD_SetPixelFromPalette(int x, int y, uint8_t index)
void LCD_GetSize(int *width, int *height)
void LCD_SetPixel(int x, int y, uint16_t color)
void LCD_Refresh()