Aruna
|
#include <Pwm.h>
Public Member Functions | |
err_t | set_frequency (uint32_t frequency_hz) |
Set frequency of PWM in hertz. More... | |
uint32_t | get_frequency () const |
Get the frequency used in hertz. More... | |
err_t | set_duty (float duty_percentage) |
Set the duty cycle on time in percentage. More... | |
err_t | set_duty (uint16_t duty) |
Set the duty cycle on time (16bit). More... | |
float | get_duty_per () const |
Get the duty cycle on time in percentage. More... | |
uint16_t | get_duty () const |
Get the duty cycle on time (16bit) More... | |
![]() | |
Actuator (axis_mask_t axis=axis_mask_t::NONE) | |
Actuator object, used by the movement module for vehicle movement. More... | |
virtual | ~Actuator () |
err_t | set_axis (axis_mask_t new_axis) |
Set the axis that this Actuator is capable in moving in. More... | |
axis_mask_t | get_axis () |
get the movement modes that this driver supports. More... | |
err_t | set (axis_mask_t axisMask, int16_t speed) |
Set the speed of the motors directly. More... | |
uint16_t | get_speed () |
Get the current speed of Actuator. More... | |
Private Member Functions | |
virtual err_t | _set_frequency (uint32_t frequency_hz)=0 |
virtual err_t | _set_duty (uint16_t duty)=0 |
err_t | _set (movement::axis_mask_t axisMask, int16_t speed) override |
Implementation of axis movement, this function is called from set(...) . More... | |
Private Attributes | |
uint32_t | frequency_hz |
uint16_t | duty |
Additional Inherited Members | |
![]() | |
err_t | startup_error = err_t::NOT_STARTED |
error when constructing gets put here, read before usage. More... | |
![]() | |
static double | convert_range (uint16_t input, float range_max=100.f, float range_min=0.f) |
Convert uint16 to a new range. More... | |
|
overrideprivatevirtual |
Implementation of axis movement, this function is called from set(...)
.
Only gets called when axisMask match axis of Actuator.
axisMask | axis (can be multiple) to set speed to. |
speed | desired speed. |
Implements aruna::movement::Actuator.
Definition at line 44 of file Pwm.cpp.
|
privatepure virtual |
Implemented in aruna::driver::PCA9685, and aruna::driver::ESP32_MCPwm.
|
privatepure virtual |
Implemented in aruna::driver::PCA9685, and aruna::driver::ESP32_MCPwm.
uint16_t Pwm::get_duty | ( | ) | const |
Get the duty cycle on time (16bit)
float Pwm::get_duty_per | ( | ) | const |
Get the duty cycle on time in percentage.
uint32_t Pwm::get_frequency | ( | ) | const |
err_t Pwm::set_duty | ( | float | duty_percentage | ) |
Set the duty cycle on time in percentage.
duty_percentage | value from 0 to 100 |
Definition at line 23 of file Pwm.cpp.
err_t Pwm::set_duty | ( | uint16_t | duty | ) |
err_t Pwm::set_frequency | ( | uint32_t | frequency_hz | ) |