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
NanoEngine< C, D > Class Template Reference

Base class for NanoEngine. More...

#include <core.h>

Inheritance diagram for NanoEngine< C, D >:
Collaboration diagram for NanoEngine< C, D >:

Public Member Functions

 NanoEngine (D &display)
 Initializes Nano Engine Base object.
 
void display ()
 refreshes content on oled display. More...
 
void begin ()
 Initializes internal timestamps, engine state, and switches oled display to required mode (see ssd1306_setMode()).
 
void notify (const char *str)
 shows notification to a user for 1 seconds Shows notification to a user for 1 seconds More...
 
- Public Member Functions inherited from NanoEngineCore
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...
 
- Public Member Functions inherited from NanoEngineTiler< C, D >
void refresh ()
 Marks all tiles for update. More...
 
void refresh (const NanoRect &rect)
 Mark specified area in pixels for redrawing by NanoEngine. More...
 
void refresh (const NanoPoint &point) __attribute__((noinline))
 Mark specified area in pixels for redrawing by NanoEngine. More...
 
void refresh (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
 Mark specified area in pixels for redrawing by NanoEngine. More...
 
void refreshWorld (const NanoRect &rect)
 Marks for refresh lcd area, which corresponds to specified rectangle in global (World) coordinates. More...
 
void refreshWorld (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
 Marks for refresh lcd area, which corresponds to specified rectangle in global (World) coordinates. More...
 
void refreshWorld (const NanoPoint &point)
 Marks specified pixel area for redrawing by NanoEngine. More...
 
void localCoordinates ()
 Switches engine canvas to local coordinates system. More...
 
void worldCoordinates ()
 Switches engine canvas to global (World) coordinates system. More...
 
void moveTo (const NanoPoint &position)
 Moves engine coordinate to new position (this sets World coordinates offset).
 
void moveToAndRefresh (const NanoPoint &position)
 Moves engine coordinate to new position and mark whole display for refresh (this sets World coordinates offset).
 
const NanoPointgetPosition () const
 Returns current World offset.
 
void drawCallback (TNanoEngineOnDraw callback)
 Sets user-defined draw callback. More...
 
bool collision (const NanoPoint &p, const NanoRect &rect)
 Returns true if point is inside the rectangle area. More...
 
void insert (NanoEngineObject< TilerT > &object) __attribute__((noinline))
 Inserts new NanoEngineObject. More...
 
void remove (NanoEngineObject< TilerT > &object) __attribute__((noinline))
 Removes NanoEngineObject from the list, but doesn't destroy the object. More...
 
void update () __attribute__((noinline))
 Updates all objects. More...
 
C & getCanvas ()
 Returns canvas, used by the NanoEngine.
 
D & getDisplay ()
 Returns reference to display object.
 

Additional Inherited Members

- Public Types inherited from NanoEngineTiler< C, D >
typedef NanoEngineTiler< C, D > TilerT
 This type is template argument for all Nano Objects.
 
- 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...
 
- Protected Member Functions inherited from NanoEngineCore
void beginCore ()
 Initializes internal timestamps.
 
- Protected Member Functions inherited from NanoEngineInputs
 NanoEngineInputs ()
 Initializes Nano Engine Inputs object.
 
- Protected Member Functions inherited from NanoEngineTiler< C, D >
 NanoEngineTiler (D &display)
 Only child classes can initialize the engine.
 
void displayBuffer () __attribute__((noinline))
 refreshes content on oled display. More...
 
void displayPopup (const char *msg)
 prints popup message over display content prints popup message over display content More...
 
- Static Protected Member Functions inherited from NanoEngineInputs
static void resetButtonsCache ()
 resets buttons cache. More...
 
- Protected Attributes inherited from NanoEngineCore
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.
 
- Protected Attributes inherited from NanoEngineTiler< C, D >
D & m_display
 Reference to display object, used by NanoEngine.
 
TNanoEngineOnDraw m_onDraw
 Callback to call if specific tile needs to be updated.
 
uint16_t m_refreshFlags [NE_MAX_TILE_ROWS]
 Contains information on tiles to be updated. 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

template<class C, class D>
class NanoEngine< C, D >

Base class for NanoEngine.

Definition at line 268 of file core.h.

Member Function Documentation

◆ display()

template<class C , class D >
void NanoEngine< C, D >::display ( )

refreshes content on oled display.

Refreshes content on oled display. Call it, if you want to update the screen. Engine will update only those areas, which are marked by refresh() methods.

Definition at line 307 of file core.h.

◆ notify()

template<class C , class D >
void NanoEngine< C, D >::notify ( const char *  str)

shows notification to a user for 1 seconds Shows notification to a user for 1 seconds

Parameters
str- pointer to null-terminated string to show

Definition at line 320 of file core.h.


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