|
TLE92466ED Driver 0.1.0-dev
Modern C++20 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
|
Real Hardware Solenoid Control Test with ADC-Based Current Control. More...
#include <stdio.h>#include <memory>#include <cmath>#include "freertos/FreeRTOS.h"#include "freertos/task.h"#include "esp_log.h"#include "esp_system.h"#include "esp_adc/adc_oneshot.h"#include "esp_adc/adc_cali.h"#include "esp_adc/adc_cali_scheme.h"#include "tle92466ed.hpp"#include "esp32_tle92466ed_bus.hpp"#include "esp32_tle92466ed_test_config.hpp"Classes | |
| struct | ADCConfig |
| ADC Configuration. More... | |
| struct | Solenoid1Config |
| Solenoid 1 Configuration (Single Channel) More... | |
| struct | Solenoid2Config |
| Solenoid 2 Configuration (Parallel Pair) More... | |
Functions | |
| static bool | initialize_adc () noexcept |
| Initialize ADC for voltage reading. | |
| static float | read_adc_voltage_mv () noexcept |
| Read ADC voltage in millivolts. | |
| static float | read_adc_percentage () noexcept |
| Read ADC percentage (0.0 to 100.0) | |
| template<typename SolenoidConfig > | |
| static uint16_t | calculate_current_from_percentage (float percentage) noexcept |
| Calculate current from percentage for a solenoid. | |
| static bool | initialize_solenoids () noexcept |
| Initialize solenoids. | |
| static void | print_solenoid_telemetry (const char *name, Channel channel, bool parallel_mode) noexcept |
| Print comprehensive telemetry for a solenoid. | |
| static void | print_device_telemetry () noexcept |
| Print device-level telemetry. | |
| static void | update_solenoid_currents () noexcept |
| Update solenoid currents based on ADC reading. | |
| static void | set_solenoids_enabled (bool enabled) noexcept |
| Enable/disable solenoids. | |
| void | app_main () |
Variables | |
| static const char * | TAG = "SolenoidControl" |
| static std::unique_ptr< Esp32Tle92466edSpiBus > | g_hal |
| static tle92466ed::Driver< Esp32Tle92466edSpiBus > * | g_driver = nullptr |
| static adc_oneshot_unit_handle_t | g_adc_handle = nullptr |
| static adc_cali_handle_t | g_adc_cali_handle = nullptr |
Real Hardware Solenoid Control Test with ADC-Based Current Control.
This test demonstrates real-world solenoid control using actual hardware:
Hardware Requirements:
| void app_main | ( | ) |
|
staticnoexcept |
Calculate current from percentage for a solenoid.
|
staticnoexcept |
Initialize ADC for voltage reading.
|
staticnoexcept |
Initialize solenoids.
|
staticnoexcept |
Print device-level telemetry.
|
staticnoexcept |
Print comprehensive telemetry for a solenoid.
|
staticnoexcept |
Read ADC percentage (0.0 to 100.0)
|
staticnoexcept |
Read ADC voltage in millivolts.
|
staticnoexcept |
Enable/disable solenoids.
|
staticnoexcept |
Update solenoid currents based on ADC reading.
|
static |
|
static |
|
static |
|
static |
|
static |