LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
NanoEngineCore Class Reference

Nano Engine Core class, contains generic frame-rate control functions. More...

#include <core.h>

Inheritance diagram for NanoEngineCore:
Collaboration diagram for NanoEngineCore:

Public Member Functions

void setFrameRate (uint8_t fps)
 Sets working frame-rate for the engine. More...
 
uint8_t getFrameRate ()
 Returns current frame rate.
 
uint8_t getCpuLoad ()
 Returns cpu load in percents [0-255]. More...
 
bool nextFrame ()
 Returns true if it is time to render next frame.
 
void loopCallback (TLoopCallback callback)
 Sets user-defined loop callback. More...
 

Protected Member Functions

void beginCore ()
 Initializes internal timestamps.
 
- Protected Member Functions inherited from NanoEngineInputs
 NanoEngineInputs ()
 Initializes Nano Engine Inputs object.
 

Protected Attributes

uint16_t m_frameDurationMs = 1000 / ENGINE_DEFAULT_FPS
 Duration between frames in milliseconds.
 
uint8_t m_fps = ENGINE_DEFAULT_FPS
 Current fps.
 
uint8_t m_cpuLoad = 0
 Current cpu load in percents.
 
uint32_t m_lastFrameTs = 0
 Last timestamp in milliseconds the frame was updated on oled display.
 
TLoopCallback m_loop = {nullptr}
 Callback to call before starting oled update.
 

Additional Inherited Members

- Static Public Member Functions inherited from NanoEngineInputs
static bool pressed (uint8_t buttons)
 Returns true if button or specific combination of buttons is pressed. More...
 
static bool notPressed (uint8_t buttons)
 Returns true if button or specific combination of buttons is not pressed. More...
 
static bool clicked (uint8_t buttons)
 Returns true if button was clicked and released. More...
 
static uint8_t buttonsState ()
 Returns bits of all pressed buttons. More...
 
static void connectCustomKeys (TNanoEngineGetButtons handler)
 Configures NanoEngine8 to use custom key handler. More...
 
static void connectZKeypad (uint8_t analogPin)
 Enables engine to use Z-Keypad. More...
 
static void connectArduboyKeys ()
 Configures NanoEngine8 to use Arduboy keys layout. More...
 
static void connectKY40encoder (uint8_t pina_clk, uint8_t pinb_dt, int8_t pinc_sw=-1)
 Configures NanoEngine to use KY40 Rotary Encoder. More...
 
static void connectGpioKeypad (const uint8_t *gpioKeys)
 Enables engine to use GPIO keys. More...
 
static void connectWioKeypad ()
 Connects Wio keys to NanoEngine. More...
 
- Static Protected Member Functions inherited from NanoEngineInputs
static void resetButtonsCache ()
 resets buttons cache. More...
 
- Static Protected Attributes inherited from NanoEngineInputs
static TNanoEngineGetButtons m_onButtons
 Callback to call if buttons state needs to be updated.
 
static uint8_t m_lastButtons
 State of last pressed buttons.
 
static uint8_t m_newButtons
 State of last pressed buttons.
 

Detailed Description

Nano Engine Core class, contains generic frame-rate control functions.

Definition at line 201 of file core.h.

Member Function Documentation

◆ getCpuLoad()

uint8_t NanoEngineCore::getCpuLoad ( )
inline

Returns cpu load in percents [0-255].

100 means maximum normal CPU load. 0 means, CPU has nothing to do. >100 means that CPU is not enough to perform all operations

Definition at line 233 of file core.h.

◆ loopCallback()

void NanoEngineCore::loopCallback ( TLoopCallback  callback)
inline

Sets user-defined loop callback.

This callback will be called once every time new frame needs to be refreshed on oled display.

Definition at line 247 of file core.h.

◆ setFrameRate()

void NanoEngineCore::setFrameRate ( uint8_t  fps)

Sets working frame-rate for the engine.

Parameters
fps- frame rate to set between [1-255]

The documentation for this class was generated from the following file: