26 static constexpr const char* TAG =
"Robot";
28 static constexpr gpio_num_t STATUS_LED_PIN = GPIO_NUM_5;
29 static constexpr gpio_num_t BOTTOM_LED_PIN = GPIO_NUM_13;
85 static Robot _instance;
The ADC hardware abstraction layer's control class.
Definition adc.h:30
The GPIO hardware abstraction layer's control class.
Definition gpio.h:36
The I2C hardware abstraction layer's control class.
Definition i2c.h:34
The LEDC hardware abstraction layer's control class.
Definition ledc.h:35
Device::Display display
Definition robot.h:61
Robot & operator=(const Robot &)=delete
Device::Leds leds
Definition robot.h:60
Robot(const Robot &)=delete
protected_struct< data_struct > data
Definition robot.h:72
void create_task(const task_config_t &config)
Creates a FreeRTOS task.
Definition robot.cpp:43
void set_bottom_led(bool state) const
Sets the bottom LED state.
Definition robot.cpp:91
HAL::GPIO::Controller & gpio
Definition robot.h:54
Device::Buttons buttons
Definition robot.h:62
void permanent_sleep()
Shuts down all HALs, pulls down a few pins and puts the ESP32 into deep sleep mode.
Definition robot.cpp:55
HAL::I2C::Controller & i2c
Definition robot.h:57
void set_status_led(bool state) const
Sets the status LED.
Definition robot.cpp:81
Device::Buzzer buzzer
Definition robot.h:63
Device::Battery battery
Definition robot.h:59
rgb_leds_mode_t
Definition robot.h:46
@ HEADLIGHTS
Definition robot.h:48
@ RANDOM_COLORS
Definition robot.h:49
@ OFF
Definition robot.h:47
@ POLICE
Definition robot.h:50
HAL::ADC::Controller & adc
Definition robot.h:56
static Robot & get_instance()
Gets the robot instance.
Definition robot.h:84
HAL::LEDC::Controller & ledc
Definition robot.h:55
A RAII type used to make structs thread-safe for FreeRTOS via mutexes.
Definition protected_struct.h:65
rgb_leds_mode_t rgb_leds_mode
Definition robot.h:69
bool bottom_led_active
Definition robot.h:68
bool status_led_active
Definition robot.h:67
const uint32_t stack_depth
Definition robot.h:39
TaskFunction_t task_function
Definition robot.h:37
UBaseType_t priority
Definition robot.h:41
void *const params_for_task
Definition robot.h:40
TaskHandle_t *const created_task_handle
Definition robot.h:42
const char * task_name
Definition robot.h:38
const BaseType_t core_id
Definition robot.h:43