added BlinkIconDemo

This commit is contained in:
nopnop2002 2024-04-25 07:23:11 +09:00
parent 654efe83b4
commit 92847e64d1
6 changed files with 285 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS ../components/ssd1306)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ssd1306)

23
BlinkIconDemo/README.md Normal file
View File

@ -0,0 +1,23 @@
# BlinkIconDemo for SSD1306
![BlinkIconDemo-1](https://github.com/nopnop2002/esp-idf-ssd1306/assets/6020549/ce0becb9-43d2-43a6-8c53-eceda48f0524)
![BlinkIconDemo-2](https://github.com/nopnop2002/esp-idf-ssd1306/assets/6020549/fc3b5d11-4c58-471d-b73e-e59616abc3b6)
I borrowed the BIT MAP data from here.
https://thenounproject.com/icon/receive-data-3177814/
https://thenounproject.com/icon/receive-data-3177850/
https://thenounproject.com/icon/data-send-3753756/
https://thenounproject.com/icon/data-send-3753855/
# How to make your original BIT MAP data
- Prepare your image file.
- Convert image file to JPEG format.
- Resize image file to 128x64.
I used this.
```convert input.jpg -resize x64 output.jpg```
- Convert image file to BMP data using [this](https://www.mischianti.org/2021/07/14/ssd1306-oled-display-draw-images-splash-and-animations-2/) page.
- Paste the BMP data into your code.

View File

@ -0,0 +1,4 @@
set(COMPONENT_SRCS "main.c")
set(COMPONENT_ADD_INCLUDEDIRS "")
register_component()

View File

@ -0,0 +1,8 @@
#
# Main component makefile.
#
# This Makefile can be left empty. By default, it will take the sources in the
# src/ directory, compile them and link them into lib(subdirectory_name).a
# in the build directory. This behaviour is entirely configurable,
# please read the ESP-IDF documents if you need to do this.
#

224
BlinkIconDemo/main/main.c Normal file
View File

@ -0,0 +1,224 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "ssd1306.h"
/*
You have to set this config value with menuconfig
CONFIG_INTERFACE
for i2c
CONFIG_MODEL
CONFIG_SDA_GPIO
CONFIG_SCL_GPIO
CONFIG_RESET_GPIO
for SPI
CONFIG_CS_GPIO
CONFIG_DC_GPIO
CONFIG_RESET_GPIO
*/
#define TAG "SSD1306"
// https://thenounproject.com/icon/receive-data-3177814/
uint8_t receive_white[] = {
// 'receive-data-white', 64x64px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xfc, 0x00, 0x3f, 0xe0, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0xff, 0x9f, 0xe7, 0x9f, 0xff, 0xff,
0xff, 0xf9, 0xff, 0x9f, 0xef, 0x9f, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xcf, 0xef, 0x9f, 0xff, 0xff,
0xff, 0xf3, 0xff, 0xe7, 0xcf, 0x9f, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x7f,
0xff, 0xf0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x7f, 0xff, 0xf3, 0xff, 0xff, 0xef, 0x9f, 0xfe, 0x7f,
0xff, 0xf3, 0xff, 0xff, 0xef, 0x9f, 0xfe, 0x7f, 0xff, 0xf3, 0xff, 0xff, 0xef, 0x9f, 0xfe, 0x7f,
0xff, 0xf3, 0xff, 0xff, 0xef, 0x9f, 0xfe, 0x7f, 0xff, 0xf3, 0xff, 0xff, 0xcf, 0x9f, 0xfe, 0x7f,
0xfe, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xcf, 0x8f, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xef, 0x9f, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xfc, 0x0f, 0x81, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xfe, 0x0f, 0x83, 0x3e, 0x7f, 0xfe, 0x70, 0xc0, 0x0f, 0x1f, 0xe7, 0x3e, 0x7f,
0xfe, 0x79, 0xc0, 0x1f, 0x8f, 0xcf, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xc7, 0x9f, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xe3, 0x3f, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xf0, 0x7f, 0x3e, 0x7f,
0xfe, 0x70, 0xc0, 0x00, 0x78, 0xff, 0x3e, 0x7f, 0xfe, 0x79, 0xc0, 0x00, 0xfd, 0xff, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f, 0xfe, 0x78, 0xc0, 0x00, 0x00, 0x07, 0x3e, 0x7f,
0xfe, 0x78, 0xc0, 0x00, 0x00, 0x07, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f,
0xfe, 0x79, 0xc0, 0x00, 0x00, 0x0f, 0x3e, 0x7f, 0xfe, 0x70, 0xc0, 0x00, 0x00, 0x07, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x7f,
0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x9e, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// https://thenounproject.com/icon/receive-data-3177850/
uint8_t receive_black[] = {
// 'receive-data-black', 64x64px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xf8, 0x7f, 0xff, 0xff,
0xff, 0xfe, 0x00, 0x7f, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x3f, 0xf0, 0x7f, 0xff, 0xff,
0xff, 0xfc, 0x00, 0x1f, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x10, 0x60, 0x01, 0xff,
0xff, 0xfc, 0x00, 0x00, 0x10, 0x60, 0x01, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x10, 0x60, 0x01, 0xff,
0xff, 0xfc, 0x00, 0x00, 0x10, 0x60, 0x01, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x30, 0x60, 0x01, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x30, 0x70, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x10, 0x60, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x03, 0xf0, 0x7e, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x01, 0xf0, 0x3c, 0xc1, 0xff, 0xff, 0x8f, 0x3f, 0xf0, 0xe0, 0x18, 0xc1, 0xff,
0xff, 0x86, 0x3f, 0xe0, 0x70, 0x30, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x38, 0x60, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x1c, 0xc0, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x0f, 0x80, 0xc1, 0xff,
0xff, 0x8f, 0x3f, 0xff, 0x87, 0x00, 0xc1, 0xff, 0xff, 0x86, 0x3f, 0xff, 0x02, 0x00, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff, 0xff, 0x86, 0x3f, 0xff, 0xff, 0xf8, 0xc1, 0xff,
0xff, 0x86, 0x3f, 0xff, 0xff, 0xf8, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff,
0xff, 0x86, 0x3f, 0xff, 0xff, 0xf0, 0xc1, 0xff, 0xff, 0x8f, 0x3f, 0xff, 0xff, 0xf8, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// https://thenounproject.com/icon/data-send-3753756/
uint8_t send_white[] = {
// 'data-send-white', 64x64px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x1f, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x1f, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0x80, 0x00, 0x00, 0x1f, 0xff,
0xff, 0x1f, 0xff, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x1f, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xff,
0xff, 0x1f, 0xff, 0xff, 0xff, 0x8c, 0x3f, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x00, 0x0e, 0x1f, 0xff,
0xff, 0x1f, 0xff, 0xff, 0x00, 0x0f, 0x0f, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0x87, 0xff,
0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xc1, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xf0, 0xff,
0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xf0, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xe1, 0xff,
0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xc3, 0xff, 0xff, 0x00, 0x00, 0x1f, 0x00, 0x0f, 0x07, 0xff,
0xff, 0x80, 0x00, 0x0f, 0x00, 0x0e, 0x1f, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x0c, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// https://thenounproject.com/icon/data-send-3753855/
uint8_t send_black[] = {
// 'data-send-black', 64x64px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x80, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x30, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x78, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x7c, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x7e, 0x0f, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x77, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x73, 0xcf, 0xff,
0xff, 0x80, 0x00, 0x00, 0x00, 0x71, 0xef, 0xff, 0xff, 0x80, 0x00, 0x03, 0xff, 0xf0, 0x7f, 0xff,
0xff, 0x80, 0x00, 0x07, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x1f, 0xff,
0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x07, 0xff,
0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x01, 0xff,
0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x07, 0x00, 0x00, 0x07, 0xff,
0xff, 0xc0, 0x00, 0x07, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
void app_main(void)
{
SSD1306_t dev;
#if CONFIG_I2C_INTERFACE
ESP_LOGI(TAG, "INTERFACE is i2c");
ESP_LOGI(TAG, "CONFIG_SDA_GPIO=%d",CONFIG_SDA_GPIO);
ESP_LOGI(TAG, "CONFIG_SCL_GPIO=%d",CONFIG_SCL_GPIO);
ESP_LOGI(TAG, "CONFIG_RESET_GPIO=%d",CONFIG_RESET_GPIO);
i2c_master_init(&dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);
#endif // CONFIG_I2C_INTERFACE
#if CONFIG_SPI_INTERFACE
ESP_LOGI(TAG, "INTERFACE is SPI");
ESP_LOGI(TAG, "CONFIG_MOSI_GPIO=%d",CONFIG_MOSI_GPIO);
ESP_LOGI(TAG, "CONFIG_SCLK_GPIO=%d",CONFIG_SCLK_GPIO);
ESP_LOGI(TAG, "CONFIG_CS_GPIO=%d",CONFIG_CS_GPIO);
ESP_LOGI(TAG, "CONFIG_DC_GPIO=%d",CONFIG_DC_GPIO);
ESP_LOGI(TAG, "CONFIG_RESET_GPIO=%d",CONFIG_RESET_GPIO);
spi_master_init(&dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);
#endif // CONFIG_SPI_INTERFACE
#if CONFIG_FLIP
dev._flip = true;
ESP_LOGW(TAG, "Flip upside down");
#endif
#if CONFIG_SSD1306_128x64
ESP_LOGI(TAG, "Panel is 128x64");
ssd1306_init(&dev, 128, 64);
#endif // CONFIG_SSD1306_128x64
#if CONFIG_SSD1306_128x32
ESP_LOGE(TAG, "Panel is 128x32. This demo cannot be run.");
while(1) { vTaskDelay(1); }
#endif // CONFIG_SSD1306_128x32
ssd1306_contrast(&dev, 0xff);
ssd1306_clear_screen(&dev, true);
while(1) {
ssd1306_bitmaps(&dev, 31, 0, receive_white, 64, 64, false);
vTaskDelay(50);
ssd1306_bitmaps(&dev, 31, 0, receive_black, 64, 64, false);
vTaskDelay(50);
ssd1306_bitmaps(&dev, 31, 0, send_white, 64, 64, false);
vTaskDelay(50);
ssd1306_bitmaps(&dev, 31, 0, send_black, 64, 64, false);
vTaskDelay(50);
}
}

View File

@ -0,0 +1,18 @@
#
# ESP32-specific
#
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
#
# ESP32S2-specific
#
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=240
#
# ESP32S3-specific
#
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240