RBCX
Library for the RB3204-RBCX board with the ESP32 by RoboticsBrno.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
rb::Buttons Class Reference

#include <RBCXButtons.h>

Public Types

typedef std::function< bool(ButtonId, bool)> callback_t
 

Public Member Functions

bool byId (ButtonId id) const
 
bool up () const
 Returns true if the button ButtonId is pressed. More...
 
bool down () const
 Returns true if the down button is pressed. More...
 
bool left () const
 Returns true if the left button is pressed. More...
 
bool right () const
 Returns true if the right button is pressed. More...
 
bool on () const
 Returns true if the on button is pressed. More...
 
bool off () const
 Returns true if the off button is pressed. More...
 
void onChange (callback_t callback)
 Register a callback that will be called when any button changes state. The callback will be called with the button ID and the new state. More...
 

Static Public Attributes

static constexpr uint32_t Count = 6
 

Friends

class Manager
 

Member Typedef Documentation

◆ callback_t

typedef std::function<bool(ButtonId, bool)> rb::Buttons::callback_t

Member Function Documentation

◆ byId()

bool rb::Buttons::byId ( ButtonId  id) const
inline

◆ down()

bool rb::Buttons::down ( ) const
inline

Returns true if the down button is pressed.

◆ left()

bool rb::Buttons::left ( ) const
inline

Returns true if the left button is pressed.

◆ off()

bool rb::Buttons::off ( ) const
inline

Returns true if the off button is pressed.

◆ on()

bool rb::Buttons::on ( ) const
inline

Returns true if the on button is pressed.

◆ onChange()

void rb::Buttons::onChange ( callback_t  callback)

Register a callback that will be called when any button changes state. The callback will be called with the button ID and the new state.

Parameters
callback

◆ right()

bool rb::Buttons::right ( ) const
inline

Returns true if the right button is pressed.

◆ up()

bool rb::Buttons::up ( ) const
inline

Returns true if the button ButtonId is pressed.

Returns true if the up button is pressed.

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

Member Data Documentation

◆ Count

constexpr uint32_t rb::Buttons::Count = 6
staticconstexpr

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