1-phase PV router
Loading...
Searching...
No Matches
utils_oled.h File Reference

Some utility functions for OLED display. More...

#include <Arduino.h>
#include <U8g2lib.h>
#include "type_traits.hpp"
#include "types.h"
Include dependency graph for utils_oled.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  u8x8_fake
 This is a fake class in case there's no OLED display. More...
 

Macros

#define OLED_RESET   -1
 
#define SCREEN_ADDRESS   0x3C
 

Functions

void clearDisplay ()
 Clear the display.
 
uint8_t * get_tile_from_xbm (uint8_t tx, uint8_t ty, uint8_t xbm_byte_width, const unsigned char *xbm)
 Get the tile from xbm object.
 
void setupOLED ()
 Setup the OLED display.
 
conditional< TYPE_OF_DISPLAY==DisplayType::OLED, U8X8_SSD1306_128X64_NONAME_HW_I2C, u8x8_fake >::type u8x8 (U8X8_PIN_NONE)
 
void u8x8_draw_xbm (uint8_t _tx, uint8_t _ty, uint8_t xbm_width, uint8_t xbm_height, const unsigned char *xbm)
 Draw the xbm on the OLED display.
 
void updateOLED (uint16_t value)
 Update the OLED display with the given value.
 
void updateWatchdog ()
 Update the watchdog on the display.
 

Variables

constexpr uint8_t LOGO_HEIGHT { 64 }
 
constexpr uint8_t LOGO_WIDTH { 72 }
 
const unsigned char logo_xbm[] U8X8_PROGMEM
 

Detailed Description

Some utility functions for OLED display.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
0.1
Date
2024-11-10

Definition in file utils_oled.h.

Macro Definition Documentation

◆ OLED_RESET

#define OLED_RESET   -1

Reset pin # (or -1 if sharing Arduino reset pin)

Definition at line 24 of file utils_oled.h.

◆ SCREEN_ADDRESS

#define SCREEN_ADDRESS   0x3C

See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32

Definition at line 25 of file utils_oled.h.

Function Documentation

◆ u8x8()

conditional< TYPE_OF_DISPLAY==DisplayType::OLED, U8X8_SSD1306_128X64_NONAME_HW_I2C, u8x8_fake >::type u8x8 ( U8X8_PIN_NONE )

The OLED display object

Referenced by clearDisplay(), setupOLED(), u8x8_draw_xbm(), updateOLED(), and updateWatchdog().

Here is the caller graph for this function:

Variable Documentation

◆ LOGO_HEIGHT

uint8_t LOGO_HEIGHT { 64 }
inlineconstexpr

The Height of the object, in pixel

Definition at line 69 of file utils_oled.h.

Referenced by setupOLED().

◆ LOGO_WIDTH

uint8_t LOGO_WIDTH { 72 }
inlineconstexpr

The width of the object, in pixel

Definition at line 68 of file utils_oled.h.

Referenced by setupOLED().

◆ U8X8_PROGMEM

const unsigned char logo_xbm [] U8X8_PROGMEM

The xml object

Definition at line 71 of file utils_oled.h.