12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
-
-
- #ifndef __LCD_H__
- #define __LCD_H__
-
- #include <stdint.h>
-
- #define LCD_WIDTH 240
- #define LCD_HEIGHT 240
-
- #define RGB_565(r, g, b) ( \
- (((r) >> 3) << 11) \
- | (((g) >> 2) << 5) \
- | ((b) >> 3) \
- )
-
- #define RGB_565_REV(c) \
- ((c & 0xF800) >> 8) / 255.0f, \
- ((c & 0x07E0) >> 3) / 255.0f, \
- ((c & 0x001F) << 3) / 255.0f
-
- #define LCD_BLACK RGB_565(0x00, 0x00, 0x00)
- #define LCD_WHITE RGB_565(0xFF, 0xFF, 0xFF)
-
- uint32_t from_hsv(float h, float s, float v);
-
- void lcd_init(void);
-
- uint16_t lcd_get_backlight(void);
- void lcd_set_backlight(uint16_t value);
-
- void lcd_clear(void);
- void lcd_write_point(uint16_t x, uint16_t y, uint32_t color);
- void lcd_write_rect(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint32_t color);
-
- #endif
|