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

Comprehensive test suite for Max22200Handler. More...

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

Functions

static bool create_handler () noexcept
 
static bool test_construction () noexcept
 
static bool test_initialize () noexcept
 
static bool test_is_initialized () noexcept
 
static bool test_enable_channel () noexcept
 
static bool test_disable_channel () noexcept
 
static bool test_enable_all_channels () noexcept
 
static bool test_disable_all_channels () noexcept
 
static bool test_is_channel_enabled () noexcept
 
static bool test_set_channels_mask () noexcept
 
static bool test_channel_range_guard () noexcept
 
static bool test_setup_cdr_channel () noexcept
 
static bool test_setup_vdr_channel () noexcept
 
static bool test_get_status () noexcept
 
static bool test_get_channel_faults () noexcept
 
static bool test_has_fault () noexcept
 
static bool test_clear_faults () noexcept
 
static bool test_read_fault_register () noexcept
 
static bool test_get_driver_access () noexcept
 
static bool test_enable_disable_device () noexcept
 
static bool test_dump_diagnostics () noexcept
 
static bool test_operations_before_init () noexcept
 
static bool test_deinitialize () noexcept
 
void app_main (void)
 

Variables

static const char * TAG = "MAX22200_Handler_Test"
 
static TestResults g_test_results
 
static constexpr bool ENABLE_CONSTRUCTION_TESTS = true
 
static constexpr bool ENABLE_INITIALIZATION_TESTS = true
 
static constexpr bool ENABLE_CHANNEL_CONTROL_TESTS = true
 
static constexpr bool ENABLE_CHANNEL_SETUP_TESTS = true
 
static constexpr bool ENABLE_STATUS_TESTS = true
 
static constexpr bool ENABLE_DEVICE_CONTROL_TESTS = true
 
static constexpr bool ENABLE_DIAGNOSTICS_TESTS = true
 
static constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
 
static std::unique_ptr< EspGpio > g_enable_gpio
 
static std::unique_ptr< EspGpio > g_cmd_gpio
 
static std::unique_ptr< EspGpio > g_fault_gpio
 
static BaseSpi * g_spi_device = nullptr
 
static std::unique_ptr< Max22200Handlerg_handler
 
static bool g_hw_present = false
 

Detailed Description

Comprehensive test suite for Max22200Handler.

Tests: CRTP SPI adapter with CMD-pin two-phase protocol, initialization (default + BoardConfig), 8-channel enable/disable/mask, CDR/VDR channel setup, channel faults, device status, device ID, soft reset, GetDriver() direct access, diagnostics dump, and pre-init error handling.

Note
This test requires a MAX22200 evaluation board connected via SPI. Without hardware, initialization will fail gracefully and remaining tests will be skipped.
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_channel_range_guard()

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

◆ test_clear_faults()

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

◆ test_construction()

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

◆ test_deinitialize()

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

◆ test_disable_all_channels()

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

◆ test_disable_channel()

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

◆ test_dump_diagnostics()

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

◆ test_enable_all_channels()

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

◆ test_enable_channel()

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

◆ test_enable_disable_device()

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

◆ test_get_channel_faults()

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

◆ test_get_driver_access()

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

◆ test_get_status()

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

◆ test_has_fault()

static bool test_has_fault ( )
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_is_channel_enabled()

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

◆ test_is_initialized()

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

◆ test_operations_before_init()

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

◆ test_read_fault_register()

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

◆ test_set_channels_mask()

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

◆ test_setup_cdr_channel()

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

◆ test_setup_vdr_channel()

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

Variable Documentation

◆ ENABLE_CHANNEL_CONTROL_TESTS

constexpr bool ENABLE_CHANNEL_CONTROL_TESTS = true
staticconstexpr

◆ ENABLE_CHANNEL_SETUP_TESTS

constexpr bool ENABLE_CHANNEL_SETUP_TESTS = true
staticconstexpr

◆ ENABLE_CONSTRUCTION_TESTS

constexpr bool ENABLE_CONSTRUCTION_TESTS = true
staticconstexpr

◆ ENABLE_DEVICE_CONTROL_TESTS

constexpr bool ENABLE_DEVICE_CONTROL_TESTS = true
staticconstexpr

◆ ENABLE_DIAGNOSTICS_TESTS

constexpr bool ENABLE_DIAGNOSTICS_TESTS = true
staticconstexpr

◆ ENABLE_ERROR_HANDLING_TESTS

constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
staticconstexpr

◆ ENABLE_INITIALIZATION_TESTS

constexpr bool ENABLE_INITIALIZATION_TESTS = true
staticconstexpr

◆ ENABLE_STATUS_TESTS

constexpr bool ENABLE_STATUS_TESTS = true
staticconstexpr

◆ g_cmd_gpio

std::unique_ptr<EspGpio> g_cmd_gpio
static

◆ g_enable_gpio

std::unique_ptr<EspGpio> g_enable_gpio
static

◆ g_fault_gpio

std::unique_ptr<EspGpio> g_fault_gpio
static

◆ g_handler

std::unique_ptr<Max22200Handler> g_handler
static

◆ g_hw_present

bool g_hw_present = false
static

◆ g_spi_device

BaseSpi* g_spi_device = nullptr
static

◆ g_test_results

TestResults g_test_results
static

◆ TAG

const char* TAG = "MAX22200_Handler_Test"
static