This module is an abstraction layer between the graphic library and the 2832HSWEG04 monochrome LCD display connected to a SSD1306 LCD controller.
As the controller does not provide any hardware accelerated graphic, all the graphic primitives are provided by the Generic monochrome graphic primitives service.
|
#define | gfx_mono_draw_circle(x, y, radius, color, octant_mask) |
|
#define | gfx_mono_draw_filled_circle(x, y, radius, color, quadrant_mask) |
|
#define | gfx_mono_draw_filled_rect(x, y, width, height, color) |
|
#define | gfx_mono_draw_horizontal_line(x, y, length, color) gfx_mono_generic_draw_horizontal_line(x, y, length, color) |
|
#define | gfx_mono_draw_line(x1, y1, x2, y2, color) gfx_mono_generic_draw_line(x1, y1, x2, y2, color) |
|
#define | gfx_mono_draw_pixel(x, y, color) gfx_mono_ssd1306_draw_pixel(x, y, color) |
|
#define | gfx_mono_draw_rect(x, y, width, height, color) gfx_mono_generic_draw_rect(x, y, width, height, color) |
|
#define | gfx_mono_draw_vertical_line(x, y, length, color) gfx_mono_generic_draw_vertical_line(x, y, length, color) |
|
#define | gfx_mono_get_byte(page, column) gfx_mono_ssd1306_get_byte(page, column) |
|
#define | gfx_mono_get_page(data, page, column, width) gfx_mono_ssd1306_get_page(data, page, column, width) |
|
#define | gfx_mono_get_pixel(x, y) gfx_mono_ssd1306_get_pixel(x, y) |
|
#define | gfx_mono_init() gfx_mono_ssd1306_init() |
|
#define | GFX_MONO_LCD_FRAMEBUFFER_SIZE |
|
#define | GFX_MONO_LCD_PAGES |
|
#define | GFX_MONO_LCD_PIXELS_PER_BYTE 8 |
|
#define | GFX_MONO_LCD_WIDTH 128 |
|
#define | gfx_mono_mask_byte(page, column, pixel_mask, color) gfx_mono_ssd1306_mask_byte(page, column, pixel_mask, color) |
|
#define | gfx_mono_put_bitmap(bitmap, x, y) gfx_mono_generic_put_bitmap(bitmap, x, y) |
|
#define | gfx_mono_put_byte(page, column, data) gfx_mono_ssd1306_put_byte(page, column, data, false) |
|
#define | gfx_mono_put_framebuffer() gfx_mono_ssd1306_put_framebuffer() |
|
#define | gfx_mono_put_page(data, page, column, width) gfx_mono_ssd1306_put_page(data, page, column, width) |
|
|
void | gfx_mono_ssd1306_draw_pixel (gfx_coord_t x, gfx_coord_t y, gfx_mono_color_t color) |
| Draw pixel to screen. More...
|
|
uint8_t | gfx_mono_ssd1306_get_byte (gfx_coord_t page, gfx_coord_t column) |
| Get a byte from the display controller RAM. More...
|
|
void | gfx_mono_ssd1306_get_page (gfx_mono_color_t *data, gfx_coord_t page, gfx_coord_t page_offset, gfx_coord_t width) |
| Read a page from the LCD controller. More...
|
|
uint8_t | gfx_mono_ssd1306_get_pixel (gfx_coord_t x, gfx_coord_t y) |
| Get the pixel value at x,y. More...
|
|
void | gfx_mono_ssd1306_init (void) |
| Initialize SSD1306 controller and LCD display. More...
|
|
void | gfx_mono_ssd1306_mask_byte (gfx_coord_t page, gfx_coord_t column, gfx_mono_color_t pixel_mask, gfx_mono_color_t color) |
| Read/Modify/Write a byte on the display controller. More...
|
|
void | gfx_mono_ssd1306_put_byte (gfx_coord_t page, gfx_coord_t column, uint8_t data, bool force) |
| Put a byte to the display controller RAM. More...
|
|
void | gfx_mono_ssd1306_put_framebuffer (void) |
|
void | gfx_mono_ssd1306_put_page (gfx_mono_color_t *data, gfx_coord_t page, gfx_coord_t page_offset, gfx_coord_t width) |
| Put a page from RAM to display controller. More...
|
|
Get a byte from the display controller RAM.
If the LCD controller is accessed by the SPI interface we cannot read the data. In this case return the data from the local framebuffer instead.
- Parameters
-
[in] | page | Page address |
[in] | column | Page offset (x coordinate) |
- Returns
- data from LCD controller or framebuffer.
The following code will read the first byte from the display memory or the local framebuffer if direct read is not possible. The data represents the pixels from x = 0 and y = 0 to y = 7.
References gfx_mono_framebuffer_get_byte(), ssd1306_read_data(), ssd1306_set_column_address(), and ssd1306_set_page_address().
Read/Modify/Write a byte on the display controller.
This function will read the byte from the display controller (or the framebuffer if we cannot read directly from the controller) and do a mask operation on the byte according to the pixel operation selected by the color argument and the pixel mask provided.
- Parameters
-
[in] | page | Page address |
[in] | column | Page offset (x coordinate) |
[in] | pixel_mask | Mask for pixel operation |
[in] | color | Pixel operation |
A small example that will XOR the first byte of display memory with 0xAA
References gfx_mono_get_byte, gfx_mono_put_byte, GFX_PIXEL_CLR, GFX_PIXEL_SET, and GFX_PIXEL_XOR.
Put a page from RAM to display controller.
If the controller is accessed by the SPI interface, we can not read back data from the LCD controller RAM. Because of this all data that is written to the LCD controller in this mode is also written to a framebuffer in MCU RAM.
- Parameters
-
[in] | data | Pointer to data to be written |
[in] | page | Page address |
[in] | column | Offset into page (x coordinate) |
[in] | width | Number of bytes to be written. |
The following example will write 32 bytes from data_buf to the page 0, column 10. This will place data_buf in the rectangle x1=10,y1=0,x2=42,y2=8 (10 pixels from the upper left corner of the screen):
References gfx_mono_framebuffer_put_page(), ssd1306_set_column_address(), ssd1306_set_page_address(), and ssd1306_write_data().