TLE92466ED Driver 0.1.0-dev
Modern C++20 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
Loading...
Searching...
No Matches
driver_integration_test.cpp File Reference

Comprehensive Integration Test Suite for TLE92466ED Driver. More...

#include <stdio.h>
#include <memory>
#include <array>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "esp_system.h"
#include "tle92466ed.hpp"
#include "esp32_tle92466ed_bus.hpp"
#include "TestFramework.h"
Include dependency graph for driver_integration_test.cpp:

Macros

#define ENABLE_INITIALIZATION_TESTS   1
 
#define ENABLE_MODE_CONTROL_TESTS   1
 
#define ENABLE_GLOBAL_CONFIG_TESTS   1
 
#define ENABLE_CHANNEL_CONTROL_TESTS   1
 
#define ENABLE_CURRENT_CONTROL_TESTS   1
 
#define ENABLE_PWM_CONFIG_TESTS   1
 
#define ENABLE_DITHER_CONFIG_TESTS   1
 
#define ENABLE_DIAGNOSTICS_TESTS   1
 
#define ENABLE_FAULT_MANAGEMENT_TESTS   1
 
#define ENABLE_WATCHDOG_TESTS   1
 
#define ENABLE_GPIO_CONTROL_TESTS   1
 
#define ENABLE_MULTI_CHANNEL_TESTS   1
 
#define ENABLE_PARALLEL_OPERATION_TESTS   1
 
#define ENABLE_ERROR_CONDITION_TESTS   1
 

Functions

static bool ensure_config_mode () noexcept
 Ensure device is in Config Mode.
 
static bool ensure_mission_mode () noexcept
 Ensure device is in Mission Mode.
 
static void print_device_status (const DeviceStatus &status) noexcept
 Print device status.
 
static void print_channel_diagnostics (Channel channel, const ChannelDiagnostics &diag) noexcept
 Print channel diagnostics.
 
static bool test_hal_initialization () noexcept
 Test HAL initialization.
 
static bool test_driver_initialization () noexcept
 Test TLE92466ED driver initialization.
 
static bool test_chip_id () noexcept
 Test chip ID reading.
 
static bool test_ic_version () noexcept
 Test IC version reading.
 
static bool test_device_verification () noexcept
 Test device verification.
 
static bool test_enter_mission_mode () noexcept
 Test entering Mission Mode.
 
static bool test_enter_config_mode () noexcept
 Test entering Config Mode.
 
static bool test_mode_transitions () noexcept
 Test mode transitions.
 
static bool test_crc_control () noexcept
 Test CRC enable/disable.
 
static bool test_vbat_thresholds () noexcept
 Test VBAT threshold configuration.
 
static bool test_global_configuration () noexcept
 Test global configuration.
 
static bool test_single_channel_control () noexcept
 Test single channel enable/disable.
 
static bool test_all_channels_control () noexcept
 Test all channels enable/disable.
 
static bool test_channel_mask_control () noexcept
 Test channel mask control.
 
static bool test_channel_mode_configuration () noexcept
 Test channel mode configuration.
 
static bool test_current_setpoint () noexcept
 Test current setpoint setting.
 
static bool test_current_ramping () noexcept
 Test current ramping.
 
static bool test_pwm_period_configuration () noexcept
 Test PWM period configuration (high-level API)
 
static bool test_pwm_period_raw () noexcept
 Test PWM period configuration (raw API)
 
static bool test_dither_configuration () noexcept
 Test dither configuration (high-level API)
 
static bool test_dither_raw () noexcept
 Test dither configuration (raw API)
 
static bool test_device_status () noexcept
 Test device status reading.
 
static bool test_channel_diagnostics () noexcept
 Test channel diagnostics reading.
 
static bool test_voltage_reading () noexcept
 Test voltage reading.
 
static bool test_current_reading () noexcept
 Test current and duty cycle reading.
 
static bool test_all_channels_telemetry () noexcept
 Test comprehensive telemetry for all channels.
 
static bool test_device_telemetry () noexcept
 Test comprehensive device telemetry.
 
static bool test_telemetry_with_active_channel () noexcept
 Test telemetry with channel enabled and current set.
 
static bool test_fault_reporting () noexcept
 Test comprehensive fault reporting.
 
static bool test_fault_clearing () noexcept
 Test fault clearing.
 
static bool test_software_reset () noexcept
 Test software reset.
 
static bool test_spi_watchdog () noexcept
 Test SPI watchdog reload.
 
static bool test_gpio_control () noexcept
 Test GPIO control (Reset, Enable, Fault)
 
static bool test_all_channels_individually () noexcept
 Test all channels individually.
 
static bool test_parallel_operation () noexcept
 Test parallel operation configuration.
 
static bool test_error_conditions () noexcept
 Test error conditions (wrong mode operations)
 
void app_main ()
 

Variables

static const char * TAG = "TLE92466ED_Test"
 
static TestResults g_test_results
 
static std::unique_ptr< Esp32Tle92466edSpiBusg_hal
 
static tle92466ed::Driver< Esp32Tle92466edSpiBus > * g_driver = nullptr
 

Detailed Description

Comprehensive Integration Test Suite for TLE92466ED Driver.

This is a complete integration test suite that tests all functionality of the TLE92466ED driver with actual hardware.

Test Categories:

  • Initialization Tests
  • Mode Control Tests
  • Global Configuration Tests
  • Channel Control Tests
  • Current Control Tests
  • PWM Configuration Tests
  • Dither Configuration Tests
  • Diagnostics & Monitoring Tests
  • Fault Management Tests
  • Watchdog Tests
  • GPIO Control Tests
  • Multi-Channel Tests
  • Parallel Operation Tests
  • Error Condition Tests
Author
N3b3x
Date
2025-10-21
Version
2.0.0

Macro Definition Documentation

◆ ENABLE_CHANNEL_CONTROL_TESTS

#define ENABLE_CHANNEL_CONTROL_TESTS   1

◆ ENABLE_CURRENT_CONTROL_TESTS

#define ENABLE_CURRENT_CONTROL_TESTS   1

◆ ENABLE_DIAGNOSTICS_TESTS

#define ENABLE_DIAGNOSTICS_TESTS   1

◆ ENABLE_DITHER_CONFIG_TESTS

#define ENABLE_DITHER_CONFIG_TESTS   1

◆ ENABLE_ERROR_CONDITION_TESTS

#define ENABLE_ERROR_CONDITION_TESTS   1

◆ ENABLE_FAULT_MANAGEMENT_TESTS

#define ENABLE_FAULT_MANAGEMENT_TESTS   1

◆ ENABLE_GLOBAL_CONFIG_TESTS

#define ENABLE_GLOBAL_CONFIG_TESTS   1

◆ ENABLE_GPIO_CONTROL_TESTS

#define ENABLE_GPIO_CONTROL_TESTS   1

◆ ENABLE_INITIALIZATION_TESTS

#define ENABLE_INITIALIZATION_TESTS   1

◆ ENABLE_MODE_CONTROL_TESTS

#define ENABLE_MODE_CONTROL_TESTS   1

◆ ENABLE_MULTI_CHANNEL_TESTS

#define ENABLE_MULTI_CHANNEL_TESTS   1

◆ ENABLE_PARALLEL_OPERATION_TESTS

#define ENABLE_PARALLEL_OPERATION_TESTS   1

◆ ENABLE_PWM_CONFIG_TESTS

#define ENABLE_PWM_CONFIG_TESTS   1

◆ ENABLE_WATCHDOG_TESTS

#define ENABLE_WATCHDOG_TESTS   1

Function Documentation

◆ app_main()

void app_main ( )

◆ ensure_config_mode()

static bool ensure_config_mode ( )
staticnoexcept

Ensure device is in Config Mode.

◆ ensure_mission_mode()

static bool ensure_mission_mode ( )
staticnoexcept

Ensure device is in Mission Mode.

◆ print_channel_diagnostics()

static void print_channel_diagnostics ( Channel channel,
const ChannelDiagnostics & diag )
staticnoexcept

Print channel diagnostics.

◆ print_device_status()

static void print_device_status ( const DeviceStatus & status)
staticnoexcept

Print device status.

◆ test_all_channels_control()

static bool test_all_channels_control ( )
staticnoexcept

Test all channels enable/disable.

◆ test_all_channels_individually()

static bool test_all_channels_individually ( )
staticnoexcept

Test all channels individually.

◆ test_all_channels_telemetry()

static bool test_all_channels_telemetry ( )
staticnoexcept

Test comprehensive telemetry for all channels.

◆ test_channel_diagnostics()

static bool test_channel_diagnostics ( )
staticnoexcept

Test channel diagnostics reading.

◆ test_channel_mask_control()

static bool test_channel_mask_control ( )
staticnoexcept

Test channel mask control.

◆ test_channel_mode_configuration()

static bool test_channel_mode_configuration ( )
staticnoexcept

Test channel mode configuration.

◆ test_chip_id()

static bool test_chip_id ( )
staticnoexcept

Test chip ID reading.

◆ test_crc_control()

static bool test_crc_control ( )
staticnoexcept

Test CRC enable/disable.

◆ test_current_ramping()

static bool test_current_ramping ( )
staticnoexcept

Test current ramping.

◆ test_current_reading()

static bool test_current_reading ( )
staticnoexcept

Test current and duty cycle reading.

◆ test_current_setpoint()

static bool test_current_setpoint ( )
staticnoexcept

Test current setpoint setting.

◆ test_device_status()

static bool test_device_status ( )
staticnoexcept

Test device status reading.

◆ test_device_telemetry()

static bool test_device_telemetry ( )
staticnoexcept

Test comprehensive device telemetry.

◆ test_device_verification()

static bool test_device_verification ( )
staticnoexcept

Test device verification.

◆ test_dither_configuration()

static bool test_dither_configuration ( )
staticnoexcept

Test dither configuration (high-level API)

◆ test_dither_raw()

static bool test_dither_raw ( )
staticnoexcept

Test dither configuration (raw API)

◆ test_driver_initialization()

static bool test_driver_initialization ( )
staticnoexcept

Test TLE92466ED driver initialization.

◆ test_enter_config_mode()

static bool test_enter_config_mode ( )
staticnoexcept

Test entering Config Mode.

◆ test_enter_mission_mode()

static bool test_enter_mission_mode ( )
staticnoexcept

Test entering Mission Mode.

◆ test_error_conditions()

static bool test_error_conditions ( )
staticnoexcept

Test error conditions (wrong mode operations)

◆ test_fault_clearing()

static bool test_fault_clearing ( )
staticnoexcept

Test fault clearing.

◆ test_fault_reporting()

static bool test_fault_reporting ( )
staticnoexcept

Test comprehensive fault reporting.

◆ test_global_configuration()

static bool test_global_configuration ( )
staticnoexcept

Test global configuration.

◆ test_gpio_control()

static bool test_gpio_control ( )
staticnoexcept

Test GPIO control (Reset, Enable, Fault)

◆ test_hal_initialization()

static bool test_hal_initialization ( )
staticnoexcept

Test HAL initialization.

◆ test_ic_version()

static bool test_ic_version ( )
staticnoexcept

Test IC version reading.

◆ test_mode_transitions()

static bool test_mode_transitions ( )
staticnoexcept

Test mode transitions.

◆ test_parallel_operation()

static bool test_parallel_operation ( )
staticnoexcept

Test parallel operation configuration.

◆ test_pwm_period_configuration()

static bool test_pwm_period_configuration ( )
staticnoexcept

Test PWM period configuration (high-level API)

◆ test_pwm_period_raw()

static bool test_pwm_period_raw ( )
staticnoexcept

Test PWM period configuration (raw API)

◆ test_single_channel_control()

static bool test_single_channel_control ( )
staticnoexcept

Test single channel enable/disable.

◆ test_software_reset()

static bool test_software_reset ( )
staticnoexcept

Test software reset.

◆ test_spi_watchdog()

static bool test_spi_watchdog ( )
staticnoexcept

Test SPI watchdog reload.

◆ test_telemetry_with_active_channel()

static bool test_telemetry_with_active_channel ( )
staticnoexcept

Test telemetry with channel enabled and current set.

◆ test_vbat_thresholds()

static bool test_vbat_thresholds ( )
staticnoexcept

Test VBAT threshold configuration.

◆ test_voltage_reading()

static bool test_voltage_reading ( )
staticnoexcept

Test voltage reading.

Variable Documentation

◆ g_driver

tle92466ed::Driver<Esp32Tle92466edSpiBus>* g_driver = nullptr
static

◆ g_hal

std::unique_ptr<Esp32Tle92466edSpiBus> g_hal
static

◆ g_test_results

TestResults g_test_results
static

◆ TAG

const char* TAG = "TLE92466ED_Test"
static