8#ifndef INC_MOTOR_TASK_H_
9#define INC_MOTOR_TASK_H_
30extern TIM_HandleTypeDef
htim1;
32extern TIM_HandleTypeDef
htim3;
34extern TIM_HandleTypeDef
htim4;
36extern TIM_HandleTypeDef
htim5;
42extern COMMAND_PARSER
parser;
Declaration of the BALANCE class for managing robot balance using a FSM.
Bluetooth command handler for robot control.
Finite State Machine class for robot balance control.
Definition balance.h:35
Finite State Machine for Bluetooth-based control input.
Definition bluetooth.h:31
Finite State Machine for heading control based on IMU data.
Definition heading.h:39
void run(void)
Executes one iteration of the motor control task.
Definition motor_task.cpp:41
state
Definition motor_task.h:67
@ S2_RUN
Active motor control loop.
Definition motor_task.h:70
@ S1_IDLE
Idle (standby) state.
Definition motor_task.h:69
@ S0_INIT
Initialization state.
Definition motor_task.h:68
MOTOR_TASK()
Constructor for the MOTOR_TASK class.
Definition motor_task.cpp:14
Header for UART command parsing module.
Quadrature encoder interface for STM32 timers.
FSM class for heading-based robot control using IMU input.
COMMAND_PARSER parser
External reference to the command parser.
Definition main.cpp:97
Low-level motor control interface for STM32 using PWM.
TIM_HandleTypeDef htim1
Timer handle for PWM generation on motor 1.
Definition main.cpp:74
TIM_HandleTypeDef htim4
Timer handle for encoder 2 (e.g., right wheel).
Definition main.cpp:77
BLUETOOTH bluetooth
Global reference to Bluetooth control FSM.
Definition main.cpp:90
TIM_HandleTypeDef htim3
Timer handle for encoder 1 (e.g., left wheel).
Definition main.cpp:76
int32_t AR
Global auto-reload value for timers.
Definition main.cpp:111
HEADING heading
Global reference to heading control task.
Definition main.cpp:87
TIM_HandleTypeDef htim5
Timer handle for motor 2 PWM generation.
Definition main.cpp:78
BALANCE balance
Global reference to balance control task.
Definition main.cpp:88
Structure for tracking encoder state and motion data.
Definition encoder.h:31
Struct representing a DC motor controlled by two PWM channels.
Definition motor_driver.h:31
Utility functions for microsecond-level timing.