esp32-warm-water
esp32 based project for the control of a heating element based on temperature
Macros | Functions | Variables
ssd1306.c File Reference

implementations of functions for setting up, interacting with and sending commands to an ssd1306 driven screen via spi or i2c More...

#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "ssd1306.h"
#include "font8x8_basic.h"
#include "font8x8_readable.h"
#include "font8x8_readable_thin.h"
#include "font8x8_space.h"
Include dependency graph for ssd1306.c:

Go to the source code of this file.

Macros

#define tag   CONFIG_SSD1306_TAG
 tag for logging library More...
 

Functions

void ssd1306_init (SSD1306_t *dev)
 
void ssd1306_deinit (SSD1306_t *dev)
 
void ssd1306_display_text (SSD1306_t *dev, int page, char *text, int text_len, bool invert)
 
void ssd1306_wrapped_display_text (SSD1306_t *dev, int line, char *text)
 
void ssd1306_display_image (SSD1306_t *dev, int page, int seg, uint8_t *images, int width)
 
void ssd1306_clear_screen (SSD1306_t *dev, bool invert)
 
void ssd1306_clear_line (SSD1306_t *dev, int page, bool invert)
 
void ssd1306_contrast (SSD1306_t *dev, int contrast)
 
void ssd1306_software_scroll (SSD1306_t *dev, int start, int end)
 
void ssd1306_scroll_text (SSD1306_t *dev, char *text, int text_len, bool invert)
 
void ssd1306_scroll_clear (SSD1306_t *dev)
 
void ssd1306_hardware_scroll (SSD1306_t *dev, ssd1306_scroll_type_t scroll)
 
void ssd1306_hardware_scroll_line (SSD1306_t *dev, int page, ssd1306_scroll_type_t scroll)
 
void ssd1306_invert (uint8_t *buf, size_t blen)
 
void ssd1306_flip (uint8_t *buf, size_t blen)
 
uint8_t ssd1306_rotate (uint8_t ch1)
 
void ssd1306_fadeout (SSD1306_t *dev)
 
void ssd1306_dump (SSD1306_t dev)
 

Variables

int center
 
int top
 
int bottom
 positions for oled More...
 

Detailed Description

implementations of functions for setting up, interacting with and sending commands to an ssd1306 driven screen via spi or i2c

Definition in file ssd1306.c.

Macro Definition Documentation

◆ tag

#define tag   CONFIG_SSD1306_TAG

tag for logging library

Definition at line 46 of file ssd1306.c.

Function Documentation

◆ ssd1306_clear_line()

void ssd1306_clear_line ( SSD1306_t dev,
int  page,
bool  invert 
)

clear a specific line (fills the line with spaces)

Parameters
devthe screen device to interact with
pagethe line to clear
invertwhether or not the cleared line should be inverted

Definition at line 190 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_clear_screen()

void ssd1306_clear_screen ( SSD1306_t dev,
bool  invert 
)

clear the screen (fills the screen with spaces)

Parameters
devthe screen device to interact with
invertwhether or not the cleared screen should be inverted

Definition at line 175 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_contrast()

void ssd1306_contrast ( SSD1306_t dev,
int  contrast 
)

set the contrast of the screen

Parameters
devthe screen device to interact with
contrastthe level of contrast

Definition at line 201 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_deinit()

void ssd1306_deinit ( SSD1306_t dev)

de-initialise the screen device and free resources

Todo:
make sure to free more resources and de-init the actual spi/i2c session
Todo:

Definition at line 100 of file ssd1306.c.

Here is the caller graph for this function:

◆ ssd1306_display_image()

void ssd1306_display_image ( SSD1306_t dev,
int  page,
int  seg,
uint8_t *  images,
int  width 
)

display an image on the screen

Parameters
devthe screen device to interact with
pagethe line to display the image on
segthe segment of the image
imagesthe image data to display
widththe width of the image

Definition at line 159 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_display_text()

void ssd1306_display_text ( SSD1306_t dev,
int  page,
char *  text,
int  text_len,
bool  invert 
)

display some text on the screen

Parameters
devthe screen device to interact with
pagethe line to display the text on
textthe text data
text_lenthe text length
invertwhether or not to invert the text and background colours

Definition at line 112 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_dump()

void ssd1306_dump ( SSD1306_t  dev)

dump the screen data

Parameters
devthe screen device to interact with

Definition at line 449 of file ssd1306.c.

◆ ssd1306_fadeout()

void ssd1306_fadeout ( SSD1306_t dev)

fadeout the screen

Parameters
devthe screen device to interact with

Definition at line 412 of file ssd1306.c.

Here is the call graph for this function:

◆ ssd1306_flip()

void ssd1306_flip ( uint8_t *  buf,
size_t  blen 
)

flip a buffer of data

Parameters
bufbuffer to flip
blenthe length of the buffer

Definition at line 383 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_hardware_scroll()

void ssd1306_hardware_scroll ( SSD1306_t dev,
ssd1306_scroll_type_t  scroll 
)

start scrolling the screen via hardware

Parameters
devthe screen device to interact with
scrollthe direction of the scroll

Definition at line 334 of file ssd1306.c.

Here is the call graph for this function:

◆ ssd1306_hardware_scroll_line()

void ssd1306_hardware_scroll_line ( SSD1306_t dev,
int  page,
ssd1306_scroll_type_t  scroll 
)

start scrolling the screen via hardware

Parameters
devthe screen device to interact with
pagethe specific page to scroll
scrollthe direction of the scroll

Definition at line 351 of file ssd1306.c.

Here is the call graph for this function:

◆ ssd1306_init()

void ssd1306_init ( SSD1306_t dev)

initialise the screen device

Definition at line 53 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssd1306_invert()

void ssd1306_invert ( uint8_t *  buf,
size_t  blen 
)

invert a buffer of data

Parameters
bufbuffer to invert
blenthe length of the buffer

Definition at line 367 of file ssd1306.c.

Here is the caller graph for this function:

◆ ssd1306_rotate()

uint8_t ssd1306_rotate ( uint8_t  ch1)

rotate a buffer of data

Parameters
bufbuffer to rotate
blenthe length of the buffer

Definition at line 398 of file ssd1306.c.

Here is the caller graph for this function:

◆ ssd1306_scroll_clear()

void ssd1306_scroll_clear ( SSD1306_t dev)

stop scrolling the screen via software

Parameters
devthe screen device to interact with

Definition at line 311 of file ssd1306.c.

Here is the call graph for this function:

◆ ssd1306_scroll_text()

void ssd1306_scroll_text ( SSD1306_t dev,
char *  text,
int  text_len,
bool  invert 
)

display some scrolling text on the screen

Parameters
devthe screen device to interact with
textthe text data
text_lenthe text length
invertwhether or not the scrolling text should be inverted

Definition at line 251 of file ssd1306.c.

Here is the call graph for this function:

◆ ssd1306_software_scroll()

void ssd1306_software_scroll ( SSD1306_t dev,
int  start,
int  end 
)

start scrolling the screen via software

Parameters
devthe screen device to interact with
startthe start of the scroll
endthe end of the scroll

Definition at line 218 of file ssd1306.c.

◆ ssd1306_wrapped_display_text()

void ssd1306_wrapped_display_text ( SSD1306_t dev,
int  line,
char *  text 
)

display some text on the screen

Parameters
devthe screen device to interact with
linethe line to display the text on
textthe text data

Definition at line 146 of file ssd1306.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ bottom

int bottom

positions for oled

Definition at line 48 of file ssd1306.c.

◆ center

int center

Definition at line 48 of file ssd1306.c.

◆ top

int top

Definition at line 48 of file ssd1306.c.