RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
rb::Manager Class Reference

The main library class for working with the RBControl board. Call the install() method at the start of your program. More...

#include <RBControl_manager.hpp>

Public Member Functions

 Manager (Manager const &)=delete
 
void operator= (Manager const &)=delete
 

Static Public Member Functions

static Manager & get ()
 Get manager instance. More...
 

Friends

class MotorChangeBuilder
 
class Encoder
 
class PcntInterruptHandler
 
void install (ManagerInstallFlags flags=MAN_NONE)
 Initialize the manager - must be called once at the start of the program. More...
 
SmartServoBus & initSmartServoBus (uint8_t servo_count, gpio_num_t pin=GPIO_NUM_32, uart_port_t uart=UART_NUM_1)
 Initialize the UART servo bus for intelligent servos LX-16. More...
 
SmartServoBus & servoBus ()
 Get the SmartServoBus for working with intelligent servos LX-16.. More...
 
Adafruit_MCP23017 & expander ()
 Get the expander Adafruit_MCP23017. LEDs and buttons are connected to it. More...
 
Piezo & piezo ()
 Get the Piezo controller. More...
 
Battery & battery ()
 Get the Battery interface. More...
 
Leds & leds ()
 Get the Leds helper. More...
 
Motor & motor (MotorId id)
 
MotorChangeBuilder setMotors ()
 Get a motor instance. More...
 
Nvs & config ()
 
void schedule (uint32_t period_ms, std::function< bool()> callback)
 Schedule callback to fire after period (in millisecond). More...
 
Timers & timers ()
 
void monitorTask (TaskHandle_t task)
 

Detailed Description

The main library class for working with the RBControl board. Call the install() method at the start of your program.

Constructor & Destructor Documentation

◆ Manager()

rb::Manager::Manager ( Manager const &  )
delete

Member Function Documentation

◆ battery()

Battery& rb::Manager::battery ( )
inline

Get the Battery interface.

◆ config()

Nvs& rb::Manager::config ( )
inline

◆ expander()

Adafruit_MCP23017& rb::Manager::expander ( )
inline

Get the expander Adafruit_MCP23017. LEDs and buttons are connected to it.

◆ get()

static Manager& rb::Manager::get ( )
inlinestatic

Get manager instance.

Always returns the same instance and is thread-safe. Don't forget to call install() to initialize the manager at the start of your program, when you first get the instance.

◆ initSmartServoBus()

rb::SmartServoBus & rb::Manager::initSmartServoBus ( uint8_t  servo_count,
gpio_num_t  pin = GPIO_NUM_32,
uart_port_t  uart = UART_NUM_1 
)

Initialize the UART servo bus for intelligent servos LX-16.

Returns
Instance of the class SmartServoBus which manage the intelligent servos.

◆ install()

void rb::Manager::install ( ManagerInstallFlags  flags = MAN_NONE)

Initialize the manager - must be called once at the start of the program.

Parameters
flagsmodify the manager's behavior or toggle some features. SeeManagerInstallFlags} enum.

◆ leds()

Leds& rb::Manager::leds ( )
inline

Get the Leds helper.

◆ monitorTask()

void rb::Manager::monitorTask ( TaskHandle_t  task)

◆ motor()

Motor& rb::Manager::motor ( MotorId  id)
inline

◆ operator=()

void rb::Manager::operator= ( Manager const &  )
delete

◆ piezo()

Piezo& rb::Manager::piezo ( )
inline

Get the Piezo controller.

◆ schedule()

void rb::Manager::schedule ( uint32_t  period_ms,
std::function< bool()>  callback 
)
inline

Schedule callback to fire after period (in millisecond).

Return true from the callback to schedule periodically, false to not (singleshot timer).

Parameters
period_msis period in which will be the schedule callback fired
callbackis a function which will be schedule with the set period.

◆ servoBus()

SmartServoBus& rb::Manager::servoBus ( )
inline

Get the SmartServoBus for working with intelligent servos LX-16..

Returns
Instance of the class SmartServoBus which manage the intelligent servos.

◆ setMotors()

MotorChangeBuilder rb::Manager::setMotors ( )

Get a motor instance.

Create motor power change builder: MotorChangeBuilder.

◆ timers()

Timers& rb::Manager::timers ( )
inline

Friends And Related Function Documentation

◆ Encoder

friend class Encoder
friend

◆ MotorChangeBuilder

friend class MotorChangeBuilder
friend

◆ PcntInterruptHandler

friend class PcntInterruptHandler
friend

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