Firmware SDK
twr_ls013b7dh03.h
1 #ifndef _TWR_LS013B7DH03_H
2 #define _TWR_LS013B7DH03_H
3 
4 #include <twr_gfx.h>
5 #include <twr_scheduler.h>
6 
10 
11 // http://www.mouser.com/ds/2/365/LS013B7DH03%20SPEC_SMA-224806.pdf
12 // https://www.embeddedartists.com/sites/default/files/support/datasheet/Memory_LCD_Programming.pdf
13 // See app note https://www.silabs.com/documents/public/application-notes/AN0048.pdf
14 // Figure 3.1
15 
16 #if TWR_LS013B7DH03_400x200 == 1
17  // For SHARP LS027B7DH01A bigger display
18  #define TWR_LS013B7DH03_WIDTH 400
19  #define TWR_LS013B7DH03_HEIGHT 240
20 #else
21  #define TWR_LS013B7DH03_WIDTH 128
22  #define TWR_LS013B7DH03_HEIGHT 128
23 #endif
24 
25 // 1B mode | 1B addr + 16B data + 1B dummy | 1B dummy END
26 #define TWR_LS013B7DH03_FRAMEBUFFER_SIZE (1 + ((1+(TWR_LS013B7DH03_WIDTH / 8)+1) * TWR_LS013B7DH03_HEIGHT) + 1)
27 
28 
30 
31 typedef struct
32 {
33  uint8_t _framebuffer[TWR_LS013B7DH03_FRAMEBUFFER_SIZE];
34  uint8_t _vcom;
35  twr_scheduler_task_id_t _task_id;
36  bool (*_pin_cs_set)(bool state);
37 
39 
42 
43 void twr_ls013b7dh03_init(twr_ls013b7dh03_t *self, bool (*pin_cs_set)(bool state));
44 
47 
49 
54 
56 
59 
61 
67 
68 void twr_ls013b7dh03_draw_pixel(twr_ls013b7dh03_t *self, int x, int y, uint32_t color);
69 
75 
76 uint32_t twr_ls013b7dh03_get_pixel(twr_ls013b7dh03_t *self, int x, int y);
77 
82 
84 
88 
90 
92 
94 
96 
97 #endif //_TWR_LS013B7DH03_H
bool twr_ls013b7dh03_is_ready(twr_ls013b7dh03_t *self)
Check if lcd is ready for commands.
twr_gfx_caps_t twr_ls013b7dh03_get_caps(twr_ls013b7dh03_t *self)
Get capabilities.
const twr_gfx_driver_t * twr_ls013b7dh03_get_driver(void)
Get Lcd driver.
bool twr_ls013b7dh03_clear_memory_command(twr_ls013b7dh03_t *self)
Send Lcd clear memory command.
uint32_t twr_ls013b7dh03_get_pixel(twr_ls013b7dh03_t *self, int x, int y)
Lcd get pixel.
void twr_ls013b7dh03_clear(twr_ls013b7dh03_t *self)
Clear.
bool twr_ls013b7dh03_update(twr_ls013b7dh03_t *self)
Lcd update, send data.
void twr_ls013b7dh03_draw_pixel(twr_ls013b7dh03_t *self, int x, int y, uint32_t color)
Lcd draw pixel.
void twr_ls013b7dh03_init(twr_ls013b7dh03_t *self, bool(*pin_cs_set)(bool state))
Initialize lcd driver.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
Definition: twr_scheduler.h:22
Display size.
Definition: twr_gfx.h:14
Display driver interface.
Definition: twr_gfx.h:23