SSD1306 OLED display driver  1.6.99
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
NanoEngineTiler< C, W, H, B > Class Template Reference

#include <tiler.h>

Inheritance diagram for NanoEngineTiler< C, W, H, B >:
NanoEngine< C, W, H, B >

Static Public Member Functions

static void refresh ()
 
static void refresh (const NanoRect &rect)
 
static void refresh (const NanoPoint &point)
 
static void refresh (lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
 
static void drawCallback (TNanoEngineOnDraw callback)
 
static bool collision (NanoPoint &p, NanoRect &rect)
 Returns true if point is inside the rectangle area. Returns true if point is inside the rectangle area. More...
 

Static Public Attributes

static const uint8_t NE_TILE_SIZE_BITS = B
 
static const uint8_t NE_TILE_WIDTH = W
 
static const uint8_t NE_TILE_HEIGHT = H
 
static const uint8_t NE_MAX_TILES_NUM = 16 >> (B - 3)
 
static C canvas
 

Protected Member Functions

 NanoEngineTiler ()
 

Static Protected Member Functions

static void displayBuffer ()
 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.
 
static void displayPopup (const char *msg)
 prints popup message over display content prints popup message over display content More...
 

Static Protected Attributes

static uint16_t m_refreshFlags [NE_MAX_TILES_NUM]
 
static TNanoEngineOnDraw m_onDraw = nullptr
 

Detailed Description

template<class C, uint8_t W, uint8_t H, uint8_t B>
class NanoEngineTiler< C, W, H, B >

This class template is responsible for holding and updating data about areas to be refreshed on LCD display. It accepts canvas class, tile width in pixels, tile height in pixels and number of bits in tile width as arguments for the template. For example, for 8x8 8-bit RGB tiles the reference should be NanoEngineTiler<NanoCanvas8,8,8,3>, and 3 bits means 3^2 = 8. If you need to have single big buffer, holding the whole content for monochrome display, you can specify something like this NanoEngineTiler<NanoCanvas1,128,64,7>.

Definition at line 66 of file tiler.h.

Constructor & Destructor Documentation

template<class C, uint8_t W, uint8_t H, uint8_t B>
NanoEngineTiler< C, W, H, B >::NanoEngineTiler ( )
inlineprotected

Only child classes can initialize the engine

Definition at line 70 of file tiler.h.

Member Function Documentation

template<class C, uint8_t W, uint8_t H, uint8_t B>
static bool NanoEngineTiler< C, W, H, B >::collision ( NanoPoint p,
NanoRect rect 
)
inlinestatic

Returns true if point is inside the rectangle area. Returns true if point is inside the rectangle area.

Parameters
p- point to check
rect- rectangle, describing the region to check with the point
Returns
true if point is inside the rectangle area.

Definition at line 151 of file tiler.h.

template<class C , uint8_t W, uint8_t H, uint8_t B>
void NanoEngineTiler< C, W, H, B >::displayPopup ( const char *  msg)
staticprotected

prints popup message over display content prints popup message over display content

Parameters
msg- message to display

Definition at line 219 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
static void NanoEngineTiler< C, W, H, B >::drawCallback ( TNanoEngineOnDraw  callback)
inlinestatic

Sets user-defined draw callback. This callback will be called everytime, engine needs to update display content. If callback returns false, engine will not update those area. You always have a way to find out, which area is being updated by engine via NanoEngine8::canvas::getOffset() and NE_TILE_SIZE.

Parameters
callback- user-defined draw callback.
Note
you can change draw callback anytime you need.

Definition at line 142 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
static void NanoEngineTiler< C, W, H, B >::refresh ( )
inlinestatic

Marks all tiles for update. Actual update will take place in display() method.

Definition at line 91 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
static void NanoEngineTiler< C, W, H, B >::refresh ( const NanoRect rect)
inlinestatic

Mark specified area in pixels for redrawing by NanoEngine. Actual update will take place in display() method.

Definition at line 100 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
static void NanoEngineTiler< C, W, H, B >::refresh ( const NanoPoint point)
inlinestatic

Mark specified area in pixels for redrawing by NanoEngine. Actual update will take place in display() method.

Definition at line 109 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
static void NanoEngineTiler< C, W, H, B >::refresh ( lcdint_t  x1,
lcdint_t  y1,
lcdint_t  x2,
lcdint_t  y2 
)
inlinestatic

Mark specified area in pixels for redrawing by NanoEngine. Actual update will take place in display() method.

Definition at line 119 of file tiler.h.

Member Data Documentation

template<class C, uint8_t W, uint8_t H, uint8_t B>
C NanoEngineTiler< C, W, H, B >::canvas
static

object, representing canvas. Use it in your draw handler

Definition at line 86 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
TNanoEngineOnDraw NanoEngineTiler< C, W, H, B >::m_onDraw = nullptr
staticprotected

Callback to call if specific tile needs to be updated

Definition at line 161 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
uint16_t NanoEngineTiler< C, W, H, B >::m_refreshFlags
staticprotected

Contains information on tiles to be updated. Elements of array are rows and bits are columns.

Definition at line 158 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
const uint8_t NanoEngineTiler< C, W, H, B >::NE_MAX_TILES_NUM = 16 >> (B - 3)
static

Max tiles supported in X

Definition at line 83 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
const uint8_t NanoEngineTiler< C, W, H, B >::NE_TILE_HEIGHT = H
static

Height of tile in pixels

Definition at line 81 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
const uint8_t NanoEngineTiler< C, W, H, B >::NE_TILE_SIZE_BITS = B
static

Number of bits in tile size. 5 corresponds to 1<<5 = 32 tile size

Definition at line 77 of file tiler.h.

template<class C, uint8_t W, uint8_t H, uint8_t B>
const uint8_t NanoEngineTiler< C, W, H, B >::NE_TILE_WIDTH = W
static

Width of tile in pixels

Definition at line 79 of file tiler.h.


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