LCDGFX LCD display driver  2.0.1
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Public Member Functions | Protected Attributes | List of all members
NanoEngineCore Class Reference

#include <core.h>

Inheritance diagram for NanoEngineCore:
NanoEngineInputs NanoEngine< C, D > NanoEngine< TILE_16x16_MONO_8, D > NanoEngine1_8< D >

Public Member Functions

void begin ()
 
void setFrameRate (uint8_t fps)
 
uint8_t getFrameRate ()
 
uint8_t getCpuLoad ()
 
bool nextFrame ()
 
void loopCallback (TLoopCallback callback)
 

Protected Attributes

uint8_t m_frameDurationMs = 1000/ENGINE_DEFAULT_FPS
 
uint8_t m_fps = ENGINE_DEFAULT_FPS
 
uint8_t m_cpuLoad = 0
 
uint32_t m_lastFrameTs
 
TLoopCallback m_loop = nullptr
 

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 not pressed. 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. Returns true if button or specific combination of buttons is not pressed. More...
 
static uint8_t buttonsState ()
 Returns bits of all pressed buttons. More...
 
static void connectCustomKeys (TNanoEngineGetButtons handler)
 
static void connectZKeypad (uint8_t analogPin)
 Enables engine to use Z-Keypad. Enables engine to use Z-Keypad. Please refer to arkanoid example for schematics. More...
 
static void connectArduboyKeys ()
 Configures NanoEngine8 to use Arduboy keys layout. Configures NanoEngine8 to use Arduboy keys layout.
 
static void connectGpioKeypad (const uint8_t *gpioKeys)
 Enables engine to use GPIO keys. More...
 
- Protected Member Functions inherited from NanoEngineInputs
 NanoEngineInputs ()
 
- Static Protected Attributes inherited from NanoEngineInputs
static TNanoEngineGetButtons m_onButtons
 

Detailed Description

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

Definition at line 174 of file core.h.

Member Function Documentation

◆ begin()

void NanoEngineCore::begin ( )

Initializes internal timestamps.

◆ 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 202 of file core.h.

◆ getFrameRate()

uint8_t NanoEngineCore::getFrameRate ( )
inline

Returns current frame rate

Definition at line 194 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 213 of file core.h.

◆ nextFrame()

bool NanoEngineCore::nextFrame ( )

Returns true if it is time to render next frame

◆ setFrameRate()

void NanoEngineCore::setFrameRate ( uint8_t  fps)

Sets working frame-rate for the engine

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

Member Data Documentation

◆ m_cpuLoad

uint8_t NanoEngineCore::m_cpuLoad = 0
protected

Current cpu load in percents

Definition at line 222 of file core.h.

◆ m_fps

uint8_t NanoEngineCore::m_fps = ENGINE_DEFAULT_FPS
protected

Current fps

Definition at line 220 of file core.h.

◆ m_frameDurationMs

uint8_t NanoEngineCore::m_frameDurationMs = 1000/ENGINE_DEFAULT_FPS
protected

Duration between frames in milliseconds

Definition at line 218 of file core.h.

◆ m_lastFrameTs

uint32_t NanoEngineCore::m_lastFrameTs
protected

Last timestamp in milliseconds the frame was updated on oled display

Definition at line 224 of file core.h.

◆ m_loop

TLoopCallback NanoEngineCore::m_loop = nullptr
protected

Callback to call before starting oled update

Definition at line 226 of file core.h.


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