HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
EspPwm.cpp File Reference

Implementation of ESP32 family LEDC (PWM) controller for the HardFOC system. More...

#include "EspPwm.h"
#include <algorithm>
#include <cstring>
#include <vector>
Include dependency graph for EspPwm.cpp:

Variables

static const char * TAG = "EspPwm"
 

Detailed Description

Implementation of ESP32 family LEDC (PWM) controller for the HardFOC system.

This file provides the complete implementation for PWM generation using the ESP32 family's built-in LEDC (LED Controller) peripheral. The implementation is designed to work across all ESP32 variants with automatic adaptation to variant-specific capabilities and constraints.

Key Implementation Features:

  • Variant-Agnostic Design: Automatic adaptation to ESP32 variant capabilities
  • LEDC Peripheral Integration: Full utilization of hardware fade, timer sharing, and interrupts
  • Smart Resource Management: Automatic timer allocation with conflict resolution and eviction policies
  • Thread-Safe Operations: Complete PlatformMutex protection for concurrent access
  • Comprehensive Validation: Hardware constraint validation with detailed error reporting
  • Performance Optimization: Efficient timer sharing and minimal overhead design
  • Motor Control Features: Complementary outputs, deadtime, and synchronized operations

LEDC Hardware Abstraction:

All platform-specific types and ESP-IDF dependencies are isolated through EspTypes_PWM.h, providing a clean abstraction layer that can be easily ported or tested.

Author
Nebiyu Tadesse
Date
2025
See also
EspPwm.h for comprehensive API documentation
EspTypes_PWM.h for type definitions and LEDC peripheral details

Variable Documentation

◆ TAG

const char* TAG = "EspPwm"
static