17#ifndef PERIPHERALCONTROLLER_HPP
18#define PERIPHERALCONTROLLER_HPP
25#include <linux/i2c-dev.h>
48 void set_servo_pwm(
int channel,
int on_value,
int off_value)
override;
Definition of the IPeripheralController interface.
Interface for the peripheral controller.
void init_motors() override
Initializes the motor controllers.
void init_servo() override
Initializes the servo controller.
~PeripheralController() override
Destructor for the PeripheralController class.
void set_servo_pwm(int channel, int on_value, int off_value) override
Sets the PWM of a servo motor.
int i2c_smbus_read_byte_data(int file, uint8_t command) override
Reads a byte of data from a specific register.
void set_motor_pwm(int channel, int value) override
Sets the PWM value for a motor.
virtual void write_byte_data(int fd, int reg, int value) override
Writes a byte of data to a specific register.
virtual int read_byte_data(int fd, int reg) override
Reads a byte of data from a specific register.
PeripheralController(int servo_addr, int motor_addr)
Constructor for the PeripheralController class.
int i2c_smbus_write_byte_data(int file, uint8_t command, uint8_t value) override
Writes a byte of data to a specific register.