PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

Embed: (wiki syntax)

« Back to documentation index

Core Class Reference

Core class. More...

#include <PokittoCore.h>

Public Member Functions

 Core ()
 Create a Core runtime instance.

Static Public Member Functions

static void begin ()
 Initialize runtime (use this one)
static void init ()
 Initialize runtime (deprecated, avoid)
static void init (uint8_t)
 Initialize runtime with options (deprecated, avoid)
static bool isRunning ()
 Return run state (1 = running, 0 = shutting down)
static void quit ()
 Stop running.
static void initDisplay ()
 Initialize display.
static void initRandom ()
 Initialize random generator.
static void initGPIO ()
 Initialize GPIO.
static void initLCD ()
 Initialize LCD.
static void initAudio ()
 Initialize Audio.
static void initBacklight ()
 Initialize backlight.
static void initClock ()
 Initialize runtime clock.
static uint32_t getTime ()
 Get value of time elapsed during program in milliseconds.
static void wait (uint16_t)
 Wait for n milliseconds.
static void showLogo ()
 Display Pokitto logo.
static bool update (bool useDirectMode=false, uint8_t updRectX=0, uint8_t updRectY=0, uint8_t updRectW=LCDWIDTH, uint8_t updRectH=LCDHEIGHT)
 Update all the subsystems, like graphics, audio, events, etc.

Static Public Attributes

static Backlight backlight
 Backlight component of the Core runtime.
static Buttons buttons
 Buttons component of the Core runtime.
static Battery battery
 Battery component of the Core runtime.
static Sound sound
 Sound component of the Core runtime.
static Display display
 Display component of the Core runtime.
static bool run_state
 run_state is true as long as program is running
static uint32_t fps_counter
 FPS.

Detailed Description

Core class.

The Core class is a class consisting of static data and methods. It handles the lowlevel hardware functions of the Pokitto. It is declared as static to prevent several instances running at same time. Example:

 // A simple "Hello World!" program with Pokitto

 #include "Pokitto.h "

 Pokitto::Core myApp;

 int main() {
     myApp.begin(); // This starts up the console (the display, buttons etc.)
     while(myApp.isRunning()) {
         if(myApp.Update()) {
             myApp.display.print("Hello World!");
         }
     }
 }

Definition at line 100 of file PokittoCore.h.


Constructor & Destructor Documentation

Core (  )

Create a Core runtime instance.

Definition at line 172 of file PokittoCore.cpp.


Member Function Documentation

void begin (  ) [static]

Initialize runtime (use this one)

Definition at line 603 of file PokittoCore.cpp.

uint32_t getTime (  ) [static]

Get value of time elapsed during program in milliseconds.

Definition at line 78 of file PokittoClock.cpp.

void init ( uint8_t  switches ) [static]

Initialize runtime with options (deprecated, avoid)

Definition at line 728 of file PokittoCore.cpp.

void init (  ) [static]

Initialize runtime (deprecated, avoid)

Definition at line 716 of file PokittoCore.cpp.

static void initAudio (  ) [static]

Initialize Audio.

static void initBacklight (  ) [static]

Initialize backlight.

void initClock (  ) [static]

Initialize runtime clock.

Definition at line 61 of file PokittoClock.cpp.

void initDisplay (  ) [static]

Initialize display.

Definition at line 753 of file PokittoCore.cpp.

void initGPIO (  ) [static]

Initialize GPIO.

control lines

data lines

Definition at line 56 of file PokittoHW.cpp.

static void initLCD (  ) [static]

Initialize LCD.

void initRandom (  ) [static]

Initialize random generator.

Definition at line 49 of file PokittoHW.cpp.

bool isRunning (  ) [static]

Return run state (1 = running, 0 = shutting down)

Definition at line 746 of file PokittoCore.cpp.

void quit (  ) [static]

Stop running.

Definition at line 45 of file PokittoHW.cpp.

void showLogo (  ) [static]

Display Pokitto logo.

POKITTO CLEAN

POKITTO FADE IN

POKITTO WAIT

Definition at line 762 of file PokittoCore.cpp.

bool update ( bool  useDirectMode = false,
uint8_t  updRectX = 0,
uint8_t  updRectY = 0,
uint8_t  updRectW = LCDWIDTH,
uint8_t  updRectH = LCDHEIGHT 
) [static]

Update all the subsystems, like graphics, audio, events, etc.

Note: the update rect is used for drawing only part of the screen buffer to LCD. Because of speed optimizations, the x, y, and width of the update rect must be dividable by 4 pixels, and the height must be dividable by 8 pixels. The update rect is currently used for 220x176, 4 colors, screen mode only.

Parameters:
useDirectModeTrue, if only direct screen drawing is used. False, if the screen buffer is drawn. Note: If sprites are enabled, they are drawn in both modes.
updRectXThe update rect.
updRectYThe update rect.
updRectWThe update rect.
updRectHThe update rect.

Definition at line 905 of file PokittoCore.cpp.

void wait ( uint16_t  ms ) [static]

Wait for n milliseconds.

Definition at line 82 of file PokittoClock.cpp.


Field Documentation

Backlight backlight [static]

Backlight component of the Core runtime.

Components.

Definition at line 108 of file PokittoCore.h.

Battery battery [static]

Battery component of the Core runtime.

Definition at line 112 of file PokittoCore.h.

Buttons buttons [static]

Buttons component of the Core runtime.

Definition at line 110 of file PokittoCore.h.

Display display [static]

Display component of the Core runtime.

Definition at line 116 of file PokittoCore.h.

uint32_t fps_counter [static]

FPS.

Definition at line 168 of file PokittoCore.h.

bool run_state [static]

run_state is true as long as program is running

Definition at line 132 of file PokittoCore.h.

Sound sound [static]

Sound component of the Core runtime.

Definition at line 114 of file PokittoCore.h.