| 881 |
theseven |
1 |
#ifndef __INTERFACE_LCD_LCD_H__
|
|
|
2 |
#define __INTERFACE_LCD_LCD_H__
|
|
|
3 |
|
|
|
4 |
#include "global.h"
|
|
|
5 |
#include "interface/framebuffer/framebuffer.h"
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
struct __attribute__((packed,aligned(4))) lcd_instance;
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
struct __attribute__((packed,aligned(4))) lcd_driver
|
|
|
12 |
{
|
|
|
13 |
void (*init)(const struct lcd_instance* instance);
|
|
|
14 |
enum framebuffer_format (*get_native_format)(const struct lcd_instance* instance);
|
|
|
15 |
void (*power)(const struct lcd_instance* instance, bool on);
|
|
|
16 |
void (*backlight)(const struct lcd_instance* instance, int brightness);
|
|
|
17 |
void (*setup_range)(const struct lcd_instance* instance, int x, int y, int w, int h);
|
|
|
18 |
void (*fill_pixels)(const struct lcd_instance* instance, uint32_t color, int count);
|
|
|
19 |
void (*blit_pixels)(const struct lcd_instance* instance, void* buffer, int count);
|
|
|
20 |
};
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
struct __attribute__((packed,aligned(4))) lcd_instance
|
|
|
24 |
{
|
|
|
25 |
const struct lcd_driver* driver;
|
|
|
26 |
const void* driver_config;
|
|
|
27 |
void* driver_state;
|
|
|
28 |
};
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
extern void lcd_init(const struct lcd_instance* instance);
|
|
|
32 |
extern enum framebuffer_format lcd_get_native_format(const struct lcd_instance* instance);
|
|
|
33 |
extern void lcd_power(const struct lcd_instance* instance, bool on);
|
|
|
34 |
extern void lcd_backlight(const struct lcd_instance* instance, int brightness);
|
|
|
35 |
extern void lcd_setup_range(const struct lcd_instance* instance, int x, int y, int w, int h);
|
|
|
36 |
extern void lcd_fill_pixels(const struct lcd_instance* instance, uint32_t color, int count);
|
|
|
37 |
extern void lcd_blit_pixels(const struct lcd_instance* instance, void* buffer, int count);
|
|
|
38 |
extern void lcd_fill(const struct lcd_instance* instance, int x, int y, int w, int h,
|
|
|
39 |
enum framebuffer_format format, uint32_t color, enum framebuffer_conversion_quality quality);
|
|
|
40 |
extern void lcd_blit(const struct lcd_instance* instance, int x, int y, int w, int h,
|
|
|
41 |
const struct framebuffer_instance* framebuffer, int fx, int fy, enum framebuffer_conversion_quality quality);
|
|
|
42 |
extern void lcd_fb_update_handler(const void* arg, const struct framebuffer_instance* instance, int x, int y, int w, int h);
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
#endif
|