TB2026-YDS Firmware
Loading...
Searching...
No Matches
display_oled.c File Reference
#include "display_oled.h"
#include "board_pins.h"
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <string.h>

Macros

#define DISP_W   176
#define DISP_H   176
#define CMD_COMMAND_LOCK   0xFD
#define CMD_DISPLAY_OFF   0xAE
#define CMD_DISPLAY_ON   0xAF
#define CMD_REMAP_FORMAT   0xA0
#define CMD_START_LINE   0xA1
#define CMD_DISPLAY_OFFSET   0xA2
#define CMD_DISPLAY_NORMAL   0xA6
#define CMD_PHASE_LENGTH   0xB1
#define CMD_DISPLAY_CLOCK   0xB3
#define CMD_PRECHARGE_PER   0xB6
#define CMD_GAMMA   0xB8
#define CMD_PRECHARGE_VOLT   0xBB
#define CMD_VCOMH   0xBE
#define CMD_CONTRAST_COLOR   0xC1
#define CMD_MASTER_CURRENT   0xC7
#define CMD_MUX_RATIO   0xCA
#define CMD_SET_COLUMN   0x15
#define CMD_SET_ROW   0x75
#define CMD_WRITE_RAM   0x5C

Functions

esp_err_t display_oled_init (spi_device_handle_t spi)
 Reset the panel and run the SSD1333 init sequence (gamma, contrast, display on).
esp_err_t display_oled_draw (const uint8_t *buf, size_t len)
 Blit a full framebuffer to the panel.
esp_err_t display_oled_set_brightness (uint8_t level)
 Set the global panel brightness (SSD1333 Master Current, cmd 0xC7).
esp_err_t display_oled_sleep (void)
 Put the panel to sleep (SSD1333 Display OFF, cmd 0xAE).
esp_err_t display_oled_wake (void)
 Wake the panel from sleep (SSD1333 Display ON, cmd 0xAF).
esp_err_t display_oled_clear (void)
 Clear the panel to black directly, without a framebuffer.

Detailed Description

Note
Développé avec l'assistance de Claude Opus 4.8 (Anthropic), sous la direction de Y. Dos Santos : spécification, revue et validation sur cible par l'auteur.

Macro Definition Documentation

◆ CMD_COMMAND_LOCK

#define CMD_COMMAND_LOCK   0xFD

◆ CMD_CONTRAST_COLOR

#define CMD_CONTRAST_COLOR   0xC1

◆ CMD_DISPLAY_CLOCK

#define CMD_DISPLAY_CLOCK   0xB3

◆ CMD_DISPLAY_NORMAL

#define CMD_DISPLAY_NORMAL   0xA6

◆ CMD_DISPLAY_OFF

#define CMD_DISPLAY_OFF   0xAE

◆ CMD_DISPLAY_OFFSET

#define CMD_DISPLAY_OFFSET   0xA2

◆ CMD_DISPLAY_ON

#define CMD_DISPLAY_ON   0xAF

◆ CMD_GAMMA

#define CMD_GAMMA   0xB8

◆ CMD_MASTER_CURRENT

#define CMD_MASTER_CURRENT   0xC7

◆ CMD_MUX_RATIO

#define CMD_MUX_RATIO   0xCA

◆ CMD_PHASE_LENGTH

#define CMD_PHASE_LENGTH   0xB1

◆ CMD_PRECHARGE_PER

#define CMD_PRECHARGE_PER   0xB6

◆ CMD_PRECHARGE_VOLT

#define CMD_PRECHARGE_VOLT   0xBB

◆ CMD_REMAP_FORMAT

#define CMD_REMAP_FORMAT   0xA0

◆ CMD_SET_COLUMN

#define CMD_SET_COLUMN   0x15

◆ CMD_SET_ROW

#define CMD_SET_ROW   0x75

◆ CMD_START_LINE

#define CMD_START_LINE   0xA1

◆ CMD_VCOMH

#define CMD_VCOMH   0xBE

◆ CMD_WRITE_RAM

#define CMD_WRITE_RAM   0x5C

◆ DISP_H

#define DISP_H   176

◆ DISP_W

#define DISP_W   176