Boboter
Loading...
Searching...
No Matches
Robot Class Reference

Class containing all the components of the robot. More...

#include <robot.h>

Classes

struct  task_config_t
struct  data_struct

Public Types

enum class  rgb_leds_mode_t : uint8_t { OFF = 0 , HEADLIGHTS = 1 , RANDOM_COLORS = 2 , POLICE = 3 }

Public Member Functions

 Robot (const Robot &)=delete
Robotoperator= (const Robot &)=delete
void create_task (const task_config_t &config)
 Creates a FreeRTOS task.
void permanent_sleep ()
 Shuts down all HALs, pulls down a few pins and puts the ESP32 into deep sleep mode.
void set_status_led (bool state) const
 Sets the status LED.
void set_bottom_led (bool state) const
 Sets the bottom LED state.

Static Public Member Functions

static Robotget_instance ()
 Gets the robot instance.

Public Attributes

HAL::GPIO::Controllergpio
HAL::LEDC::Controllerledc
HAL::ADC::Controlleradc
HAL::I2C::Controlleri2c
Device::Battery battery
Device::Leds leds
Device::Display display
Device::Buttons buttons
Device::Buzzer buzzer
protected_struct< data_structdata {}

Detailed Description

Class containing all the components of the robot.

Member Enumeration Documentation

◆ rgb_leds_mode_t

enum class Robot::rgb_leds_mode_t : uint8_t
strong
Enumerator
OFF 
HEADLIGHTS 
RANDOM_COLORS 
POLICE 

Constructor & Destructor Documentation

◆ Robot()

Robot::Robot ( const Robot & )
delete

Member Function Documentation

◆ create_task()

void Robot::create_task ( const task_config_t & config)

Creates a FreeRTOS task.

Parameters
configThe configuration of the task to create

◆ get_instance()

Robot & Robot::get_instance ( )
inlinestatic

Gets the robot instance.

Note
The instance will be created on the first call of this function
Returns
Reference to the robot object

◆ operator=()

Robot & Robot::operator= ( const Robot & )
delete

◆ permanent_sleep()

void Robot::permanent_sleep ( )

Shuts down all HALs, pulls down a few pins and puts the ESP32 into deep sleep mode.

◆ set_bottom_led()

void Robot::set_bottom_led ( bool state) const

Sets the bottom LED state.

Parameters
stateWhether the LED should be turned on (true) or off (false)

◆ set_status_led()

void Robot::set_status_led ( bool state) const

Sets the status LED.

Parameters
stateWhether the LED should be turned on (true) or off (false)

Member Data Documentation

◆ adc

HAL::ADC::Controller& Robot::adc

◆ battery

Device::Battery Robot::battery

◆ buttons

Device::Buttons Robot::buttons

◆ buzzer

Device::Buzzer Robot::buzzer

◆ data

protected_struct<data_struct> Robot::data {}

◆ display

Device::Display Robot::display

◆ gpio

HAL::GPIO::Controller& Robot::gpio

◆ i2c

HAL::I2C::Controller& Robot::i2c

◆ ledc

HAL::LEDC::Controller& Robot::ledc

◆ leds

Device::Leds Robot::leds

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