Code Monkey home page Code Monkey logo

m5stickc-idf's Introduction

M5StickC-IDF

ESP-IDF component to work with M5StickC. Works without including the Arduino framework.


Current features:

  • Initializes power management IC AXP192
    • Provides easy function calls to read/write its registers
  • Initializes display ST7735
  • Initializes push buttons
    • "Click" & "hold" events available
  • Set display backlight level
    • Option to turn it completely off
  • Display API thanks to Loboris ESP32_TFT_library
    • Added support for custom fonts without modifying its code

Usage

Check out the example project.

Clone repository in your components folder in your project and include m5stickc.h in your source code.

Call m5_init() to initialize your M5StickC. This initializes the AXP192 power manager chip, the display and the push buttons.

This component creates a custom event loop called m5_event_loop for device events. User program can subscribe to it and listen to events such as "button click" and "button hold". More actions coming. Check out .h files for specific module events.

Use m5display_set_backlight_level(uint8_t backlight_level) to set the backlight level on the display. Backlight range between 0 and 7. To turn on or off the backlight, use m5display_on() and m5display_off().

Display driver based on Loboris ESP32_TFT_library

Includes a modified version of ESP32_TFT_library by Boris Lovosevic. Check his GitHub for help on how to use the display.

One of the modifications enables support for custom embedded fonts. After converting the font file to an embedded array using the tools provided by Loboris, use:

TFT_setFont(CUSTOM_EMBEDDED_FONT, (char *) opensans_semibold_12); // opensans_semibold_12 is my custom embedded font.

Contributing

If you find a bug, improve documentation, add a feature, or anything else, I encourage you to open an issue and/or make a pull request.

When contributing, please follow Espressif IoT Development Framework Style Guide and their Documenting Code Guide

Licensed under the MIT License.

m5stickc-idf's People

Contributors

pablobacho avatar teuteuguy 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.