GithubHelp home page GithubHelp logo

ssd1306-lib's Introduction

SSD1306 64x128 on I2C C library for ESP-IDF apps

WiP

This repo contains code to run the ssd1306 oled display on I2C for ESP32. I am targeting this at the Heltec ESP32.

To use it, clone the repository in the component directory of your project.

Alt Text

API

The API is super simple:

/* Initialize the sd1306 and return a new frame buffer */
ssd1306_framebuffer_t *ssd1306_new();

/* Free the framebuffer */
void ssd1306_free(ssd1306_framebuffer_t *screen);

/* Set display contrast
 * @param contrast Amount of contrast 0x00-0xFF 
 */
void ssd1306_display_contrast(uint8_t contrast);

/* Add a bitmap to the virtual screen, starting at the specified location 
 * @param framebuffer The device framebuffer
 * @param x Starting column
 * @param y Starting row
 * @param bitmap Bitmap to add
 * @param rows Bitmap width
 * @param cols Bitmap height 
 */
void ssd1306_add_bitmap(ssd1306_framebuffer_t *framebuffer, int32_t x, int32_t y, uint8_t *const bitmap, uint16_t rows, uint16_t cols);

/* Add a null terminated string to the virtual screen, starting at the specified location.
   Works with multiline as well 
 * @param framebuffer The device framebuffer
 * @param x Starting column
 * @param y Starting row
 * @param text Text to write into the framebuffer
 */
void ssd1306_add_text(ssd1306_framebuffer_t *framebuffer, int32_t x, int32_t y, char *const text);

/* Clear the vistual screen 
 * @param framebuffer The device framebuffer
 */
void ssd1306_clear(ssd1306_framebuffer_t *framebuffer);

/* Draw the virtual screen on the ssd1306
 * @param framebuffer The device framebuffer
 */
void ssd1306_draw(ssd1306_framebuffer_t *const framebuffer);

ssd1306-lib's People

Contributors

dguerri avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.