LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
NanoEngineInputs Class Reference

#include <core.h>

Inheritance diagram for NanoEngineInputs:

Static Public Member Functions

static bool pressed (uint8_t buttons)
 Returns true if button or specific combination of buttons is 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 bool clicked (uint8_t buttons)
 Returns true if button was clicked and released. 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)
 
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 connectKY40encoder (uint8_t pina_clk, uint8_t pinb_dt, int8_t pinc_sw=-1)
 Configures NanoEngine to use KY40 Rotary Encoder. 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

 NanoEngineInputs ()
 

Static Protected Member Functions

static void resetButtonsCache ()
 

Static Protected Attributes

static TNanoEngineGetButtons m_onButtons
 
static uint8_t m_lastButtons
 
static uint8_t m_newButtons
 

Detailed Description

Class for keys processing functionality

Definition at line 69 of file core.h.

Constructor & Destructor Documentation

◆ NanoEngineInputs()

NanoEngineInputs::NanoEngineInputs ( )
inlineprotected

Initializes Nano Engine Inputs object.

Definition at line 75 of file core.h.

Member Function Documentation

◆ buttonsState()

static uint8_t NanoEngineInputs::buttonsState ( )
inlinestatic

Returns bits of all pressed buttons.

Returns bits of all pressed buttons. For example, to check if Down button is pressed you need to write if (result & BUTTON_DOWN) {}. Available constants are: BUTTON_DOWN, BUTTON_LEFT, BUTTON_RIGHT, BUTTON_UP, BUTTON_A, BUTTON_B.

Definition at line 110 of file core.h.

◆ clicked()

static bool NanoEngineInputs::clicked ( uint8_t  buttons)
static

Returns true if button was clicked and released. Returns true if button was clicked and released.

Parameters
buttons- buttons to check
Returns
true or false

◆ connectCustomKeys()

static void NanoEngineInputs::connectCustomKeys ( TNanoEngineGetButtons  handler)
static

Configures NanoEngine8 to use custom key handler. You can implement in your handler any keyboard layout, you use in your schematics.

◆ connectGpioKeypad()

static void NanoEngineInputs::connectGpioKeypad ( const uint8_t *  gpioKeys)
static

Enables engine to use GPIO keys.

Enables engine to use gpio-keys. You need to pass globally defined array, containing GPIO pin numbers for the 6 buttons in the following order: Down, Left, Right, Up, A, B. If you don't want to use some specific button, then just set not used button to 0. Once you call this function, you can read buttons state via buttonsState().

Parameters
gpioKeyspointer to 6-button pins array.
See also
buttonsState()

◆ connectKY40encoder()

static void NanoEngineInputs::connectKY40encoder ( uint8_t  pina_clk,
uint8_t  pinb_dt,
int8_t  pinc_sw = -1 
)
static

Configures NanoEngine to use KY40 Rotary Encoder. Configures NanoEngine to use KY40 Rotary Encoder.

Parameters
pina_clkpin number to use as clk (see KY40 docs).
pinb_dtpin number to use as direction pin (see KY40 docs).
pinc_swoptional pin number ot use as push button.
Warning
do not use, not tested

◆ connectWioKeypad()

static void NanoEngineInputs::connectWioKeypad ( )
static

Connects Wio keys to NanoEngine.

Enable engine to use Wio keys

◆ connectZKeypad()

static void NanoEngineInputs::connectZKeypad ( uint8_t  analogPin)
static

Enables engine to use Z-Keypad. Enables engine to use Z-Keypad. Please refer to arkanoid example for schematics.

Parameters
analogPin- pin, which Z-Keypad is connected to.

◆ notPressed()

static bool NanoEngineInputs::notPressed ( uint8_t  buttons)
static

Returns true if button or specific combination of buttons is not pressed. Returns true if button or specific combination of buttons is not pressed.

Parameters
buttons- buttons to check
Returns
true of false

◆ pressed()

static bool NanoEngineInputs::pressed ( uint8_t  buttons)
static

Returns true if button or specific combination of buttons is pressed. Returns true if button or specific combination of buttons is pressed.

Parameters
buttons- buttons to check
Returns
true or false

◆ resetButtonsCache()

static void NanoEngineInputs::resetButtonsCache ( )
staticprotected

resets buttons cache. It is called by display method()

Member Data Documentation

◆ m_lastButtons

uint8_t NanoEngineInputs::m_lastButtons
staticprotected

State of last pressed buttons

Definition at line 171 of file core.h.

◆ m_newButtons

uint8_t NanoEngineInputs::m_newButtons
staticprotected

State of last pressed buttons

Definition at line 174 of file core.h.

◆ m_onButtons

TNanoEngineGetButtons NanoEngineInputs::m_onButtons
staticprotected

Callback to call if buttons state needs to be updated

Definition at line 168 of file core.h.


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