HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
pca9685_handler_comprehensive_test.cpp File Reference

Comprehensive test suite for Pca9685Handler. More...

#include "TestFramework.h"
#include "esp32_bus_setup.hpp"
#include "esp32_test_config.hpp"
#include "handlers/pca9685/Pca9685Handler.h"
#include <memory>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Include dependency graph for pca9685_handler_comprehensive_test.cpp:

Functions

static bool create_handler () noexcept
 
static bool test_initialize () noexcept
 
static bool test_set_duty_cycle () noexcept
 
static bool test_set_duty_raw () noexcept
 
static bool test_frequency () noexcept
 
static bool test_sleep_wake () noexcept
 
static bool test_gpio_pin_wrapper () noexcept
 
static bool test_error_invalid_channel () noexcept
 
void app_main (void)
 

Variables

static const char * TAG = "PCA9685_Handler_Test"
 
static TestResults g_test_results
 
static constexpr bool ENABLE_INITIALIZATION_TESTS = true
 
static constexpr bool ENABLE_PWM_DUTY_TESTS = true
 
static constexpr bool ENABLE_FREQUENCY_TESTS = true
 
static constexpr bool ENABLE_SLEEP_WAKE_TESTS = true
 
static constexpr bool ENABLE_PWM_ADAPTER_TESTS = true
 
static constexpr bool ENABLE_GPIO_PIN_TESTS = true
 
static constexpr bool ENABLE_PHASE_OFFSET_TESTS = true
 
static constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
 
static std::unique_ptr< Pca9685Handlerg_handler
 
static std::shared_ptr< BasePwm > g_pwm
 

Detailed Description

Comprehensive test suite for Pca9685Handler.

Tests the PCA9685 16-channel PWM controller handler: I2C comm adapter, EnsureInitialized delegation, PWM duty cycle control, frequency setting, sleep/wake, PwmAdapter, GpioPin wrapper, and error handling.

Author
HardFOC Team
Date
2025-2026

Function Documentation

◆ app_main()

void app_main ( void )
Here is the call graph for this function:

◆ create_handler()

static bool create_handler ( )
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_error_invalid_channel()

static bool test_error_invalid_channel ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_frequency()

static bool test_frequency ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_gpio_pin_wrapper()

static bool test_gpio_pin_wrapper ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_initialize()

static bool test_initialize ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_set_duty_cycle()

static bool test_set_duty_cycle ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_set_duty_raw()

static bool test_set_duty_raw ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_sleep_wake()

static bool test_sleep_wake ( )
staticnoexcept
Here is the caller graph for this function:

Variable Documentation

◆ ENABLE_ERROR_HANDLING_TESTS

constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
staticconstexpr

◆ ENABLE_FREQUENCY_TESTS

constexpr bool ENABLE_FREQUENCY_TESTS = true
staticconstexpr

◆ ENABLE_GPIO_PIN_TESTS

constexpr bool ENABLE_GPIO_PIN_TESTS = true
staticconstexpr

◆ ENABLE_INITIALIZATION_TESTS

constexpr bool ENABLE_INITIALIZATION_TESTS = true
staticconstexpr

◆ ENABLE_PHASE_OFFSET_TESTS

constexpr bool ENABLE_PHASE_OFFSET_TESTS = true
staticconstexpr

◆ ENABLE_PWM_ADAPTER_TESTS

constexpr bool ENABLE_PWM_ADAPTER_TESTS = true
staticconstexpr

◆ ENABLE_PWM_DUTY_TESTS

constexpr bool ENABLE_PWM_DUTY_TESTS = true
staticconstexpr

◆ ENABLE_SLEEP_WAKE_TESTS

constexpr bool ENABLE_SLEEP_WAKE_TESTS = true
staticconstexpr

◆ g_handler

std::unique_ptr<Pca9685Handler> g_handler
static

◆ g_pwm

std::shared_ptr<BasePwm> g_pwm
static

◆ g_test_results

TestResults g_test_results
static

◆ TAG

const char* TAG = "PCA9685_Handler_Test"
static