mirror of
https://github.com/nopnop2002/esp-idf-ssd1306.git
synced 2024-10-03 18:18:47 -04:00
Delete main.c.old
This commit is contained in:
parent
03adf52c07
commit
0523d734a7
@ -1,348 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.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://iitestudent.blogspot.com/2013/01/displaying-bitmap-on-graphic-lcd.html
|
||||
uint8_t fleischer[] = {
|
||||
// 'fleischer', 420x64px
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xfe, 0x3f, 0xfe, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff,
|
||||
0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,
|
||||
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfe, 0xe0, 0x3f, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xf7, 0xdf, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f, 0xf0, 0x3f, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b,
|
||||
0xef, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfc, 0xff, 0xfe, 0x0f, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0x7d, 0xef, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xc7, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xef, 0xdf, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xe1, 0xff, 0xef,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff,
|
||||
0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3,
|
||||
0xff, 0xff, 0xf8, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfe, 0xfe, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xfc, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xef, 0xbf, 0x3f, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xfe, 0xff, 0x9f, 0xff,
|
||||
0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0xdf, 0x7e,
|
||||
0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff,
|
||||
0xff, 0xff, 0xdf, 0x3f, 0xfe, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0x7e, 0xdf, 0x7d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xcf, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0x80, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0x1f, 0xfb, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9d, 0xff, 0xff, 0xbf, 0xb0, 0xff, 0x9e, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0x77, 0xf7,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
|
||||
0xbf, 0x9b, 0xf8, 0x3f, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xdf, 0xff, 0x6f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfe, 0x77, 0xff, 0xff, 0x3f, 0x9b, 0xe3, 0x9f, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0x9f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x77, 0xff, 0xff, 0x7f, 0x9d, 0xc7, 0xdf, 0xff, 0xf8,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0xdf, 0xff, 0xff, 0xdf, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0x7c,
|
||||
0x1d, 0xcf, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff,
|
||||
0x7f, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x7f, 0xfd, 0xff, 0x7b, 0x1d, 0x9f, 0xff, 0xff, 0xfe, 0x7f, 0xf0, 0x00, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0xfe, 0xff, 0x19, 0x9f, 0xff, 0xff, 0xff, 0x3f,
|
||||
0xc0, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x3f, 0xfc, 0xff, 0xff, 0xfe, 0xff, 0x08,
|
||||
0xbf, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff,
|
||||
0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0e, 0x03, 0xfd,
|
||||
0xdf, 0xff, 0xe6, 0xff, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x3e, 0x7e, 0x00, 0x07, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xe1, 0xff, 0xf8, 0x7b, 0xdf, 0xf7, 0x7e, 0xff, 0x20, 0x3f, 0xff, 0xff, 0xff, 0x7c, 0xff,
|
||||
0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x21, 0xff, 0xff, 0xfb, 0x1f, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcd, 0xff, 0xff, 0x17, 0xff, 0xf3, 0x7c, 0x7e, 0x61, 0x9f,
|
||||
0xff, 0xff, 0xfe, 0x7b, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0xff,
|
||||
0xfd, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3c, 0xff, 0xff, 0xc7, 0xff,
|
||||
0xf9, 0xbf, 0xee, 0xe7, 0x9f, 0xff, 0xff, 0xfe, 0x71, 0xff, 0xf0, 0x01, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xfe, 0x00,
|
||||
0x3e, 0x7f, 0xff, 0xef, 0xef, 0xfd, 0xbf, 0xec, 0xe7, 0x9f, 0xff, 0xff, 0xfc, 0xf1, 0xff, 0xf8,
|
||||
0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0x8f, 0x00, 0x00, 0x1e, 0x7f, 0xfe, 0x1f, 0xdf, 0xfc, 0xdf, 0xfd, 0xe7, 0xe7, 0xff,
|
||||
0xff, 0xfc, 0xe6, 0xff, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x00, 0x00, 0x0f, 0x3f, 0xf0, 0x3f, 0xdf, 0xfe,
|
||||
0x75, 0xfb, 0x07, 0x67, 0xff, 0xff, 0xfd, 0xef, 0xff, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x07,
|
||||
0x9f, 0xe7, 0x7f, 0xdf, 0xff, 0x3d, 0xe0, 0x73, 0x7b, 0xff, 0xff, 0xf9, 0xeb, 0xff, 0xfc, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xe0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x7f, 0x00, 0x00, 0x07, 0x8f, 0xdf, 0xff, 0x9f, 0xff, 0x9f, 0xe7, 0x0c, 0xf9, 0xff, 0xff,
|
||||
0xf9, 0xe3, 0xff, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xde, 0x3f,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x7f, 0x00, 0x00, 0x03, 0xc7, 0xbf, 0xff, 0x1f, 0xff, 0xff,
|
||||
0xf1, 0xff, 0xf8, 0xff, 0xff, 0xf3, 0xc3, 0xff, 0xf0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0x3f, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0x00, 0x00, 0x01, 0xe3,
|
||||
0x7f, 0xff, 0x9f, 0xff, 0xff, 0xf9, 0xc3, 0xfc, 0x7f, 0xff, 0xf3, 0xc3, 0xff, 0xe0, 0x00, 0xf8,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x1f,
|
||||
0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x9f, 0xff, 0xf7, 0xfc, 0x99, 0xfe, 0xff, 0xff, 0xf3,
|
||||
0xd3, 0xff, 0xc0, 0x00, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7e, 0xfe, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xf8, 0x7f, 0xff, 0x80, 0x00, 0x00, 0x79, 0xff, 0xff, 0x1f, 0xff, 0xf7, 0xfb,
|
||||
0x3c, 0xfc, 0xff, 0xff, 0xf3, 0xc3, 0xff, 0x80, 0x00, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x7f, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xc0, 0xf0, 0x00, 0x19, 0xff,
|
||||
0xff, 0x1f, 0xff, 0xfb, 0xfb, 0x7c, 0xfd, 0xff, 0xff, 0xf3, 0xd7, 0xff, 0x80, 0x00, 0xf0, 0x7f,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xdf,
|
||||
0xcf, 0xe0, 0x00, 0x0b, 0xff, 0xfc, 0x9f, 0xff, 0xfd, 0xff, 0x3c, 0xf9, 0xff, 0xff, 0xf3, 0xcf,
|
||||
0xff, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x9f, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xe0, 0x3f, 0xff, 0xcf, 0x9f, 0xc0, 0x00, 0x01, 0xff, 0xf7, 0xcf, 0xff, 0xfe, 0x1f, 0xbd,
|
||||
0xfb, 0xff, 0xff, 0xf3, 0xcf, 0xff, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7c,
|
||||
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x07, 0x1f, 0xc0, 0x00, 0x60, 0xe0, 0xff,
|
||||
0xcf, 0xff, 0xff, 0xff, 0xb9, 0xf3, 0xff, 0xff, 0xf3, 0xef, 0xff, 0x00, 0x00, 0x01, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xfe, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8d, 0xff, 0xfc, 0x30, 0x3f,
|
||||
0x80, 0x00, 0xe0, 0x78, 0x7f, 0xe7, 0xff, 0xff, 0xff, 0xbb, 0xf7, 0xff, 0xff, 0xf3, 0xe7, 0xff,
|
||||
0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x9f, 0xff, 0xf1, 0xfe, 0xff, 0x80, 0x00, 0xe0, 0x1f, 0x07, 0xe7, 0xff, 0xff, 0xff, 0xb3, 0xf7,
|
||||
0xff, 0xff, 0xf3, 0xf7, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xfe, 0x7f,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xc7, 0xff, 0xff, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x23,
|
||||
0xff, 0xff, 0xff, 0x3b, 0xe7, 0xff, 0xff, 0xf3, 0x87, 0xff, 0xe0, 0x18, 0x07, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfb, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0x1f, 0xff, 0xfe, 0x00,
|
||||
0x00, 0x00, 0x01, 0xfc, 0x01, 0xff, 0xff, 0xff, 0x78, 0xef, 0xff, 0xff, 0xf3, 0x3e, 0xff, 0xf8,
|
||||
0x7c, 0x70, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
|
||||
0xfe, 0x3f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0xff, 0xff, 0xfe, 0x70, 0x6f, 0xff,
|
||||
0xff, 0xe3, 0x7f, 0x7c, 0xff, 0xfe, 0x38, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfd, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0x9f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x7f,
|
||||
0xfe, 0xfc, 0xef, 0x0f, 0xff, 0xff, 0xe7, 0x3e, 0x18, 0xff, 0x3f, 0x1b, 0x83, 0xff, 0xff, 0xff,
|
||||
0xff, 0xcf, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xc7, 0xff, 0xfc, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x06, 0x1f, 0xf0, 0x00, 0x9f, 0x9f, 0xff, 0xff, 0xe7, 0x80, 0x81, 0xf8, 0x1f,
|
||||
0xdb, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff,
|
||||
0xe1, 0xff, 0xf8, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0xd8, 0x3f, 0x9f, 0xff, 0xff,
|
||||
0xe7, 0xe3, 0xe0, 0x01, 0xcf, 0xdb, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0x9f, 0xf7, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xdf, 0xff, 0xf8, 0xff, 0xf8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d,
|
||||
0xdb, 0xff, 0x9f, 0xff, 0xff, 0xc7, 0xff, 0xfe, 0x07, 0xc7, 0xdb, 0xff, 0x07, 0xff, 0xfd, 0xff,
|
||||
0x3f, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xfc, 0x7f, 0xf0, 0x00, 0x30, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1d, 0xc7, 0xff, 0x9f, 0xff, 0xc3, 0xcf, 0xff, 0xff, 0xff, 0x93, 0xbb,
|
||||
0xff, 0xe0, 0xff, 0x00, 0x0e, 0x7f, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xfe,
|
||||
0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xf7, 0xff, 0x9f, 0xff, 0xbf, 0xcf,
|
||||
0xff, 0xff, 0xff, 0xb1, 0xbb, 0xff, 0xfc, 0x1c, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0x9f, 0xff, 0xff, 0x1f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73,
|
||||
0xf3, 0x9f, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xb0, 0x9b, 0xff, 0xff, 0x80, 0x00, 0x01, 0xff,
|
||||
0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x8f, 0xe0, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x02, 0x19, 0xe3, 0xbf, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x93, 0xdd, 0xff,
|
||||
0xff, 0xf0, 0x00, 0x03, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xcf,
|
||||
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x19, 0xbf, 0xff, 0xff, 0x1f, 0xff,
|
||||
0xff, 0xff, 0x9b, 0xdd, 0xdf, 0xff, 0xfe, 0x00, 0x07, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0x9f, 0xff, 0xff, 0xe7, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x1f, 0xc2, 0x3d,
|
||||
0xbf, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x9b, 0xed, 0xf3, 0xff, 0xff, 0x80, 0x1f, 0xfc, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xef, 0xf7, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0xf0, 0x3f, 0xc6, 0x79, 0xbf, 0xff, 0x9e, 0x3f, 0xff, 0xff, 0xff, 0x3b, 0xcd, 0xfc, 0x7f,
|
||||
0xff, 0xf8, 0x7f, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xe7, 0xf3, 0xc0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x7f, 0x1f, 0xf9, 0xbf, 0xff, 0x9e, 0x7f, 0xff, 0xff,
|
||||
0xff, 0x7f, 0xdb, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x9f, 0xff, 0xe3, 0xf9, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfe, 0x7e, 0x7f, 0xfb, 0xbf,
|
||||
0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfe, 0x5b, 0xdb, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xf9, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
|
||||
0xfe, 0x7c, 0xff, 0xfb, 0xbf, 0xff, 0x7c, 0xff, 0xff, 0xff, 0xfc, 0xdb, 0xb7, 0xff, 0xf8, 0xff,
|
||||
0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xfd, 0xfd, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x7d, 0xff, 0xf3, 0x9f, 0xfe, 0x79, 0xff, 0xff, 0xff, 0xf9,
|
||||
0xdc, 0x37, 0xff, 0xff, 0x1f, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f,
|
||||
0xff, 0xff, 0xfc, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xff, 0xf3, 0x9f, 0xff,
|
||||
0xf1, 0xff, 0xff, 0xff, 0xf9, 0xdf, 0xf7, 0xff, 0xff, 0xe1, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xfe, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x3b, 0xff, 0xf9, 0x9f, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xf3, 0xdf, 0xf7, 0xff, 0xff, 0xf0, 0x3f,
|
||||
0x80, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0
|
||||
};
|
||||
|
||||
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 0
|
||||
#if CONFIG_FLIP
|
||||
dev._flip = true;
|
||||
ESP_LOGW(TAG, "Flip upside down");
|
||||
#endif
|
||||
#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
|
||||
|
||||
size_t image_width = 420;
|
||||
// Calculate width of image data in bytes
|
||||
size_t width_bytes = (image_width+7)/8;
|
||||
ESP_LOGI(TAG, "image_width=%d --> width_bytes=%d", image_width, width_bytes);
|
||||
// Calculate the number of frames to display all images
|
||||
size_t frames = width_bytes - 16 + 1;
|
||||
ESP_LOGI(TAG, "frames=%d", frames);
|
||||
|
||||
// Allocates memory for one frame
|
||||
uint8_t *bitmap = (uint8_t *)malloc(1024);
|
||||
if (bitmap == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
// Allocate memory for all frame
|
||||
uint8_t *buffer = (uint8_t *)malloc(1024*frames);
|
||||
if (buffer == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
ssd1306_contrast(&dev, 0xff);
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
|
||||
// Convert from segmentDisplay to segmentImage
|
||||
for (int frame_offset=0;frame_offset<frames;frame_offset++) {
|
||||
ESP_LOGI(TAG, "Convert %dth pixel to %dth pixel to frame[%d]", frame_offset*8, frame_offset*8+127, frame_offset);
|
||||
if (frame_offset*8+127 > image_width) {
|
||||
ESP_LOGW(TAG, "The right edge of the last frame is invalid data");
|
||||
}
|
||||
for (int i=0;i<64;i++) {
|
||||
for (int j=0;j<16;j++) {
|
||||
int src_index = (i*width_bytes)+j+frame_offset;
|
||||
int dst_index = (i*16)+j;
|
||||
bitmap[dst_index] = fleischer[src_index];
|
||||
}
|
||||
}
|
||||
|
||||
ssd1306_bitmaps(&dev, 0, 0, bitmap, 128, 64, false);
|
||||
|
||||
// Get from internal buffer to local buffer
|
||||
// buffer is [8][128] 8 page 128 pixel
|
||||
int buffer_index = frame_offset * 1024;
|
||||
ssd1306_get_buffer(&dev, &buffer[buffer_index]);
|
||||
}
|
||||
|
||||
// I don't use this anymore
|
||||
free(bitmap);
|
||||
|
||||
while(1) {
|
||||
for (int offset=0;offset<frames;offset++) {
|
||||
int buffer_index = offset * 1024;
|
||||
ssd1306_set_buffer(&dev, &buffer[buffer_index]);
|
||||
ssd1306_show_buffer(&dev);
|
||||
}
|
||||
vTaskDelay(100);
|
||||
for (int offset=frames;offset>0;offset--) {
|
||||
int buffer_index = (offset-1) * 1024;
|
||||
ssd1306_set_buffer(&dev, &buffer[buffer_index]);
|
||||
ssd1306_show_buffer(&dev);
|
||||
}
|
||||
vTaskDelay(100);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user