#include <pico/stdlib.h>#include <hardware/i2c.h>Go to the source code of this file.
Classes | |
| struct | ssd1306_t |
| holds the configuration More... | |
Enumerations | |
| enum | ssd1306_command_t |
| defines commands used in ssd1306 | |
Functions | |
| void | ssd1306_bmp_show_image (ssd1306_t *p, const uint8_t *data, const long size) |
| draw monochrome bitmap | |
| void | ssd1306_bmp_show_image_with_offset (ssd1306_t *p, const uint8_t *data, const long size, uint32_t x_offset, uint32_t y_offset) |
| draw monochrome bitmap with offset | |
| void | ssd1306_clear (ssd1306_t *p) |
| clear display buffer | |
| void | ssd1306_clear_pixel (ssd1306_t *p, uint32_t x, uint32_t y) |
| clear pixel on buffer | |
| void | ssd1306_clear_square (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t width, uint32_t height) |
| clear square at given position with given size | |
| void | ssd1306_contrast (ssd1306_t *p, uint8_t val) |
| set contrast of display | |
| void | ssd1306_deinit (ssd1306_t *p) |
| deinitialize display | |
| void | ssd1306_draw_char (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t scale, char c) |
| draw char with builtin font | |
| void | ssd1306_draw_char_with_font (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t scale, const uint8_t *font, char c) |
| draw char with given font | |
| void | ssd1306_draw_empty_square (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t width, uint32_t height) |
| draw empty square at given position with given size | |
| void | ssd1306_draw_line (ssd1306_t *p, int32_t x1, int32_t y1, int32_t x2, int32_t y2) |
| draw line on buffer | |
| void | ssd1306_draw_pixel (ssd1306_t *p, uint32_t x, uint32_t y) |
| draw pixel on buffer | |
| void | ssd1306_draw_square (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t width, uint32_t height) |
| draw filled square at given position with given size | |
| void | ssd1306_draw_string (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t scale, const char *s) |
| draw string with builtin font | |
| void | ssd1306_draw_string_with_font (ssd1306_t *p, uint32_t x, uint32_t y, uint32_t scale, const uint8_t *font, const char *s) |
| draw string with given font | |
| bool | ssd1306_init (ssd1306_t *p, uint16_t width, uint16_t height, uint8_t address, i2c_inst_t *i2c_instance) |
| initialize display | |
| void | ssd1306_invert (ssd1306_t *p, uint8_t inv) |
| set invert display | |
| void | ssd1306_poweroff (ssd1306_t *p) |
| turn off display | |
| void | ssd1306_poweron (ssd1306_t *p) |
| turn on display | |
| void | ssd1306_show (ssd1306_t *p) |
| display buffer, should be called on change | |
simple driver for ssd1306 displays
Definition in file ssd1306.h.
| void ssd1306_bmp_show_image | ( | ssd1306_t * | p, |
| const uint8_t * | data, | ||
| const long | size ) |
draw monochrome bitmap
| [in] | p | : instance of display |
| [in] | data | : image data (whole file) |
| [in] | size | : size of image data in bytes |
| void ssd1306_bmp_show_image_with_offset | ( | ssd1306_t * | p, |
| const uint8_t * | data, | ||
| const long | size, | ||
| uint32_t | x_offset, | ||
| uint32_t | y_offset ) |
draw monochrome bitmap with offset
| [in] | p | : instance of display |
| [in] | data | : image data (whole file) |
| [in] | size | : size of image data in bytes |
| [in] | x_offset | : offset of horizontal coordinate |
| [in] | y_offset | : offset of vertical coordinate |
| void ssd1306_clear | ( | ssd1306_t * | p | ) |
clear display buffer
| [in] | p | : instance of display |
| void ssd1306_clear_pixel | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y ) |
clear pixel on buffer
| [in] | p | : instance of display |
| [in] | x | : x position |
| [in] | y | : y position |
| void ssd1306_clear_square | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | width, | ||
| uint32_t | height ) |
clear square at given position with given size
| [in] | p | : instance of display |
| [in] | x | : x position of starting point |
| [in] | y | : y position of starting point |
| [in] | width | : width of square |
| [in] | height | : height of square |
| void ssd1306_contrast | ( | ssd1306_t * | p, |
| uint8_t | val ) |
set contrast of display
| [in] | p | : instance of display |
| [in] | val | : contrast |
| void ssd1306_deinit | ( | ssd1306_t * | p | ) |
deinitialize display
| [in] | p | : instance of display |
| void ssd1306_draw_char | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | scale, | ||
| char | c ) |
draw char with builtin font
| [in] | p | : instance of display |
| [in] | x | : x starting position of char |
| [in] | y | : y starting position of char |
| [in] | scale | : scale font to n times of original size (default should be 1) |
| [in] | c | : character to draw |
| void ssd1306_draw_char_with_font | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | scale, | ||
| const uint8_t * | font, | ||
| char | c ) |
draw char with given font
| [in] | p | : instance of display |
| [in] | x | : x starting position of char |
| [in] | y | : y starting position of char |
| [in] | scale | : scale font to n times of original size (default should be 1) |
| [in] | font | : pointer to font |
| [in] | c | : character to draw |
| void ssd1306_draw_empty_square | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | width, | ||
| uint32_t | height ) |
draw empty square at given position with given size
| [in] | p | : instance of display |
| [in] | x | : x position of starting point |
| [in] | y | : y position of starting point |
| [in] | width | : width of square |
| [in] | height | : height of square |
| void ssd1306_draw_line | ( | ssd1306_t * | p, |
| int32_t | x1, | ||
| int32_t | y1, | ||
| int32_t | x2, | ||
| int32_t | y2 ) |
draw line on buffer
| [in] | p | : instance of display |
| [in] | x1 | : x position of starting point |
| [in] | y1 | : y position of starting point |
| [in] | x2 | : x position of end point |
| [in] | y2 | : y position of end point |
| void ssd1306_draw_pixel | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y ) |
draw pixel on buffer
| [in] | p | : instance of display |
| [in] | x | : x position |
| [in] | y | : y position |
| void ssd1306_draw_square | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | width, | ||
| uint32_t | height ) |
draw filled square at given position with given size
| [in] | p | : instance of display |
| [in] | x | : x position of starting point |
| [in] | y | : y position of starting point |
| [in] | width | : width of square |
| [in] | height | : height of square |
| void ssd1306_draw_string | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | scale, | ||
| const char * | s ) |
draw string with builtin font
| [in] | p | : instance of display |
| [in] | x | : x starting position of text |
| [in] | y | : y starting position of text |
| [in] | scale | : scale font to n times of original size (default should be 1) |
| [in] | s | : text to draw |
| void ssd1306_draw_string_with_font | ( | ssd1306_t * | p, |
| uint32_t | x, | ||
| uint32_t | y, | ||
| uint32_t | scale, | ||
| const uint8_t * | font, | ||
| const char * | s ) |
draw string with given font
| [in] | p | : instance of display |
| [in] | x | : x starting position of text |
| [in] | y | : y starting position of text |
| [in] | scale | : scale font to n times of original size (default should be 1) |
| [in] | font | : pointer to font |
| [in] | s | : text to draw |
| bool ssd1306_init | ( | ssd1306_t * | p, |
| uint16_t | width, | ||
| uint16_t | height, | ||
| uint8_t | address, | ||
| i2c_inst_t * | i2c_instance ) |
initialize display
| [in] | p | : pointer to instance of ssd1306_t |
| [in] | width | : width of display |
| [in] | height | : heigth of display |
| [in] | address | : i2c address of display |
| [in] | i2c_instance | : instance of i2c connection |
| true | for Success |
| false | if initialization failed |
| void ssd1306_invert | ( | ssd1306_t * | p, |
| uint8_t | inv ) |
set invert display
| [in] | p | : instance of display |
| [in] | inv | : inv==0: disable inverting, inv!=0: invert |
| void ssd1306_poweroff | ( | ssd1306_t * | p | ) |
turn off display
| [in] | p | : instance of display |
| void ssd1306_poweron | ( | ssd1306_t * | p | ) |
turn on display
| [in] | p | : instance of display |
| void ssd1306_show | ( | ssd1306_t * | p | ) |
display buffer, should be called on change
| [in] | p | : instance of display |