hollyhock
lcd.hpp
Go to the documentation of this file.
1 
27 #pragma once
28 #include <stdint.h>
29 
35 const uint8_t PALETTE_BLACK = 0;
36 const uint8_t PALETTE_BLUE = 1;
37 const uint8_t PALETTE_GREEN = 2;
38 const uint8_t PALETTE_CYAN = 3;
39 const uint8_t PALETTE_RED = 4;
40 const uint8_t PALETTE_MAGENTA = 5;
41 const uint8_t PALETTE_YELLOW = 6;
42 const 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 
86 extern "C"
88 
97 extern "C"
98 uint16_t LCD_GetPixel(int x, int y);
99 
105 extern "C"
106 void LCD_GetSize(int *width, int *height);
107 
115 extern "C"
116 uint16_t *LCD_GetVRAMAddress();
117 
121 extern "C"
122 void LCD_Refresh();
123 
131 extern "C"
132 void LCD_SetPixel(int x, int y, uint16_t color);
133 
141 extern "C"
142 void LCD_SetPixelFromPalette(int x, int y, uint8_t index);
143 
151 extern "C"
153 
160 extern "C"
void LCD_VRAMRestore()
void LCD_ClearScreen()
void LCD_VRAMBackup()
uint16_t LCD_GetPixel(int x, int y)
void LCD_SetPixelFromPalette(int x, int y, uint8_t index)
uint16_t * LCD_GetVRAMAddress()
void LCD_GetSize(int *width, int *height)
void LCD_SetPixel(int x, int y, uint16_t color)
void LCD_Refresh()