esp32-ssd1306
ssd1306 interface component for esp-idf
Macros | Functions | Variables
/home/travis/build/wolffshots/esp32-ssd1306/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_space.h"

Macros

#define tag   CONFIG_SSD1306_TAG
 tag for logging library
 

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_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
 

Detailed Description

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

Function Documentation

◆ ssd1306_init()

void ssd1306_init ( SSD1306_t dev)

initialise the screen device

◆ 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:

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ ssd1306_scroll_clear()

void ssd1306_scroll_clear ( SSD1306_t dev)

stop scrolling the screen via software

Parameters
devthe screen device to interact with

◆ 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

◆ 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

◆ 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

◆ ssd1306_rotate()

uint8_t ssd1306_rotate ( uint8_t  ch1)

rotate a buffer of data

Parameters
bufbuffer to rotate
blenthe length of the buffer

◆ ssd1306_fadeout()

void ssd1306_fadeout ( SSD1306_t dev)

fadeout the screen

Parameters
devthe screen device to interact with

◆ ssd1306_dump()

void ssd1306_dump ( SSD1306_t  dev)

dump the screen data

Parameters
devthe screen device to interact with