|
SSD1306 Library
1.0.0
Library for SSD1306 OLed Driver based on libohiboard
|
Data Structures | |
| struct | _SSD1306_Config_t |
| struct | _SSD1306_Device_t |
Typedefs | |
| typedef struct _SSD1306_Config_t | SSD1306_Config_t |
| typedef struct _SSD1306_Device_t | SSD1306_Device_t |
| typedef struct _SSD1306_Device_t * | SSD1306_DeviceHandle_t |
Functions | |
| void | SSD1306_init (SSD1306_DeviceHandle_t dev, SSD1306_Config_t *config) |
| GDL_Errors_t | SSD1306_drawPixel (SSD1306_DeviceHandle_t dev, uint8_t xPos, uint8_t yPos, SSD1306_Color_t color) |
| void | SSD1306_drawLine (SSD1306_DeviceHandle_t dev, uint8_t xStart, uint8_t yStart, uint8_t xStop, uint8_t yStop, SSD1306_Color_t color) |
| void | SSD1306_drawHLine (SSD1306_DeviceHandle_t dev, uint8_t xStart, uint8_t yStart, uint8_t width, SSD1306_Color_t color) |
| void | SSD1306_drawVLine (SSD1306_DeviceHandle_t dev, uint8_t xStart, uint8_t yStart, uint8_t height, SSD1306_Color_t color) |
| void | SSD1306_drawRectangle (SSD1306_DeviceHandle_t dev, uint16_t xStart, uint16_t yStart, uint16_t width, uint16_t height, uint8_t color, bool isFill) |
| GDL_Errors_t | SSD1306_drawChar (SSD1306_DeviceHandle_t dev, uint16_t xPos, uint16_t yPos, uint8_t c, uint8_t color, uint8_t size) |
| GDL_Errors_t | SSD1306_drawString (SSD1306_DeviceHandle_t dev, uint16_t xPos, uint16_t yPos, const char *text, uint8_t color, uint8_t size) |
| GDL_Errors_t | SSD1306_drawPicture (SSD1306_DeviceHandle_t dev, uint16_t xPos, uint16_t yPos, uint16_t width, uint16_t height, const uint8_t *picture) |
| void | SSD1306_inverseDisplay (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_normalDisplay (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_scroll (SSD1306_DeviceHandle_t dev, bool scroll) |
| void | SSD1306_clear (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_flush (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_on (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_off (SSD1306_DeviceHandle_t dev) |
| void | SSD1306_setContrast (SSD1306_DeviceHandle_t dev, uint8_t value) |
| typedef struct _SSD1306_Config_t SSD1306_Config_t |
SSD1306 configuration struct. An object of this class must be used to save all module configurations.
| typedef struct _SSD1306_Device_t SSD1306_Device_t |
SSD1306 device class.
| typedef struct _SSD1306_Device_t * SSD1306_DeviceHandle_t |
| void SSD1306_clear | ( | SSD1306_DeviceHandle_t | dev | ) |
This function clear the display content. At the same time, the function clear the local buffer content.
| [in] | dev | The handle of the device. |
| GDL_Errors_t SSD1306_drawChar | ( | SSD1306_DeviceHandle_t | dev, |
| uint16_t | xPos, | ||
| uint16_t | yPos, | ||
| uint8_t | c, | ||
| uint8_t | color, | ||
| uint8_t | size | ||
| ) |
The function print a char in the selected position with the selected color and size. The starting point is the top-left corner of the char.
| [in] | dev | The handle of the device |
| [in] | xPos | The x position |
| [in] | yPos | The y position |
| [in] | c | The char to be draw |
| [in] | color | The foreground color of the char |
| [in] | size | The size for the char, if 0 use default dimension |
| void SSD1306_drawHLine | ( | SSD1306_DeviceHandle_t | dev, |
| uint8_t | xStart, | ||
| uint8_t | yStart, | ||
| uint8_t | width, | ||
| SSD1306_Color_t | color | ||
| ) |
The function print a horizontal line from the selected position with the selected width and color.
| [in] | dev | The handle of the device |
| [in] | xStart | The starting x position |
| [in] | yStart | The starting y position |
| [in] | width | The width of the line |
| [in] | color | The color of the line |
| void SSD1306_drawLine | ( | SSD1306_DeviceHandle_t | dev, |
| uint8_t | xStart, | ||
| uint8_t | yStart, | ||
| uint8_t | xStop, | ||
| uint8_t | yStop, | ||
| SSD1306_Color_t | color | ||
| ) |
The function print a line in the selected position with the selected color.
| [in] | dev | The handle of the device |
| [in] | xStart | The starting x position |
| [in] | yStart | The starting y position |
| [in] | xStop | The ending x position |
| [in] | yStop | The ending y position |
| [in] | color | The color of the line |
| GDL_Errors_t SSD1306_drawPicture | ( | SSD1306_DeviceHandle_t | dev, |
| uint16_t | xPos, | ||
| uint16_t | yPos, | ||
| uint16_t | width, | ||
| uint16_t | height, | ||
| const uint8_t * | picture | ||
| ) |
The function print a picture in the selected position with the selected color and size. The starting point is the top-left corner of the char.
| [in] | dev | The handle of the device |
| [in] | xPos | The x position |
| [in] | yPos | The y position |
| [in] | width | The width of picture |
| [in] | height | The height of picture |
| [in] | picture | The array of the picture. Pay attention: every byte of the array represent 8 pixel in the same row. |
| GDL_Errors_t SSD1306_drawPixel | ( | SSD1306_DeviceHandle_t | dev, |
| uint8_t | xPos, | ||
| uint8_t | yPos, | ||
| SSD1306_Color_t | color | ||
| ) |
This function draw a single pixel into internal buffer.
| [in] | dev | The handle of the device |
| [in] | xPos | The x position |
| [in] | yPos | The y position |
| [in] | color | The color of the pixel |
| void SSD1306_drawRectangle | ( | SSD1306_DeviceHandle_t | dev, |
| uint16_t | xStart, | ||
| uint16_t | yStart, | ||
| uint16_t | width, | ||
| uint16_t | height, | ||
| uint8_t | color, | ||
| bool | isFill | ||
| ) |
The function draw a rectangle. It can be fill or not.
| [in] | dev | The handle of the device |
| [in] | xStart | The starting x position |
| [in] | yStart | The starting y position |
| [in] | width | The ending x position |
| [in] | height | The ending y position |
| [in] | color | The color of the rectangle |
| [in] | isFill | If TRUE the rectangle will be fill |
| GDL_Errors_t SSD1306_drawString | ( | SSD1306_DeviceHandle_t | dev, |
| uint16_t | xPos, | ||
| uint16_t | yPos, | ||
| const char * | text, | ||
| uint8_t | color, | ||
| uint8_t | size | ||
| ) |
The function print a string in the selected position with the selected color and size. The starting point is the top-left corner of the char.
| [in] | dev | The handle of the device |
| [in] | xPos | The x position |
| [in] | yPos | The y position |
| [in] | text | The string to be draw |
| [in] | color | The foreground color of the char |
| [in] | size | The size for the char, if 0 use default dimension |
| void SSD1306_drawVLine | ( | SSD1306_DeviceHandle_t | dev, |
| uint8_t | xStart, | ||
| uint8_t | yStart, | ||
| uint8_t | height, | ||
| SSD1306_Color_t | color | ||
| ) |
The function print a vertical line from the selected position with the selected height and color.
| [in] | dev | The handle of the device |
| [in] | xStart | The starting x position |
| [in] | yStart | The starting y position |
| [in] | height | The height of the line |
| [in] | color | The color of the line |
| void SSD1306_flush | ( | SSD1306_DeviceHandle_t | dev | ) |
This function writes all the buffer content to the display. The function wrties all pixel.
| [in] | dev | The handle of the device. |
| void SSD1306_init | ( | SSD1306_DeviceHandle_t | dev, |
| SSD1306_Config_t * | config | ||
| ) |
The function initialize and configure the display.
| [in] | dev | The handle of the device. |
| [in] | config | A structure with all configuration parameters. |
| void SSD1306_inverseDisplay | ( | SSD1306_DeviceHandle_t | dev | ) |
The function shows black pixels on white background.
| [in] | dev | The handle of the device |
| void SSD1306_normalDisplay | ( | SSD1306_DeviceHandle_t | dev | ) |
The function shows white pixels on black background.
| [in] | dev | The handle of the device |
| void SSD1306_off | ( | SSD1306_DeviceHandle_t | dev | ) |
This function turn the OLED panel display OFF.
| [in] | dev | The handle of the device |
| void SSD1306_on | ( | SSD1306_DeviceHandle_t | dev | ) |
This function turn the OLED panel display ON.
| [in] | dev | The handle of the device |
| void SSD1306_scroll | ( | SSD1306_DeviceHandle_t | dev, |
| bool | scroll | ||
| ) |
The function starts or stop the motion of scrolling. The start scrolling should only be issued after the scroll setup parameters have been defined by the scrolling setup function.
| [in] | dev | The handle of the device. |
| [in] | scroll | TRUE for enable the scrolling, FALSE otherwise. |
| void SSD1306_setContrast | ( | SSD1306_DeviceHandle_t | dev, |
| uint8_t | value | ||
| ) |
This function sets the contrast setting of the display. The display has 256 contrast steps: from 00h to FFh.
| [in] | dev | The handle of the device |
| [in] | value | The contrast value. |