|
HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
|
Abstract base class for PWM implementations in the HardFOC system. More...
Go to the source code of this file.
Classes | |
| struct | hf_pwm_statistics_t |
| PWM statistics information. More... | |
| struct | hf_pwm_diagnostics_t |
| PWM diagnostics information. More... | |
| class | BasePwm |
| Abstract base class for PWM implementations. More... | |
Macros | |
| #define | HF_PWM_ERR_LIST(X) |
| HardFOC PWM error codes. | |
| #define | X(name, value, description) name = value, |
| #define | X(NAME, VALUE, DESC) |
Typedefs | |
| using | hf_pwm_period_callback_t = void (*)(hf_channel_id_t channel_id, void* user_data) |
| Callback for PWM period complete events. | |
| using | hf_pwm_fault_callback_t |
| Callback for PWM fault/error events. | |
Enumerations | |
| enum class | hf_pwm_err_t : hf_u32_t { X , PWM_SUCCESS = 0 , PWM_ERR_FAILURE = 1 , PWM_ERR_NOT_INITIALIZED = 2 , PWM_ERR_ALREADY_INITIALIZED = 3 , PWM_ERR_INVALID_PARAMETER = 4 , PWM_ERR_NULL_POINTER = 5 , PWM_ERR_OUT_OF_MEMORY = 6 , PWM_ERR_INVALID_CHANNEL = 7 , PWM_ERR_CHANNEL_BUSY = 8 , PWM_ERR_CHANNEL_NOT_AVAILABLE = 9 , PWM_ERR_INSUFFICIENT_CHANNELS = 10 , PWM_ERR_INVALID_FREQUENCY = 11 , PWM_ERR_FREQUENCY_TOO_HIGH = 12 , PWM_ERR_FREQUENCY_TOO_LOW = 13 , PWM_ERR_RESOLUTION_NOT_SUPPORTED = 14 , PWM_ERR_INVALID_DUTY_CYCLE = 15 , PWM_ERR_DUTY_OUT_OF_RANGE = 16 , PWM_ERR_HARDWARE_FAULT = 17 , PWM_ERR_TIMER_CONFLICT = 18 , PWM_ERR_PIN_CONFLICT = 19 , PWM_ERR_COMMUNICATION_TIMEOUT = 20 , PWM_ERR_COMMUNICATION_FAILURE = 21 , PWM_ERR_DEVICE_NOT_RESPONDING = 22 , PWM_ERR_INVALID_DEVICE_ID = 23 , PWM_ERR_UNSUPPORTED_OPERATION = 24 , PWM_ERR_UNKNOWN = 25 , PWM_ERR_COUNT } |
Functions | |
| constexpr std::string_view | HfPwmErrToString (hf_pwm_err_t err) noexcept |
| Convert PWM error code to string view. | |
Abstract base class for PWM implementations in the HardFOC system.
This header-only file defines the abstract base class for PWM generation that provides a consistent API across different PWM implementations. Concrete implementations for various platforms inherit from this class.
| #define X | ( | NAME, | |
| VALUE, | |||
| DESC ) |
| #define X | ( | name, | |
| value, | |||
| description ) name = value, |
| using hf_pwm_fault_callback_t |
Callback for PWM fault/error events.
| channel_id | Channel that encountered fault |
| error | Error that occurred |
| user_data | User-provided data |
| using hf_pwm_period_callback_t = void (*)(hf_channel_id_t channel_id, void* user_data) |
Callback for PWM period complete events.
| channel_id | Channel that completed a period |
| user_data | User-provided data |
|
strong |
|
constexprnoexcept |
Convert PWM error code to string view.
| err | The error code to convert |