HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
Loading...
Searching...
No Matches
max22200_solenoid_valve_test.cpp File Reference

Dedicated solenoid/valve test for MAX22200 driver on ESP32. More...

#include <cinttypes>
#include <cmath>
#include <memory>
#include "esp32_max22200_bus.hpp"
#include "esp32_max22200_test_config.hpp"
#include "max22200.hpp"
#include "max22200_registers.hpp"
#include "max22200_types.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
Include dependency graph for max22200_solenoid_valve_test.cpp:

Functions

void app_main (void)
 

Detailed Description

Dedicated solenoid/valve test for MAX22200 driver on ESP32.

Full driver check on valves: configures all 8 channels for the same valve profile (C21-style: 100 ms hit, 50% hold, low-side CDR or VDR per C21ValveConfig). Runs synchronized patterns (sequential follow-up clicking, parallel clicking) and logs comprehensive diagnostics: STATUS, FAULT, last fault byte, nFAULT pin, per-channel config readback, board config, and driver statistics.

  • Board: BoardTestConfig (RREF_KOHM, HFS). Channel profile: C21ValveConfig (USE_CDR, HIT_TIME_MS, hit/hold currents or percent). All channels get the same configuration.
  • Pattern timings: SolenoidValvePatternConfig (SEQUENTIAL_HIT_MS, SEQUENTIAL_GAP_MS, PARALLEL_HOLD_MS, PATTERN_PAUSE_MS, LOOP_COUNT). (1) Sequential: ch0 → ch1 → … → ch7 with delay between each. (2) Parallel: all channels on together, then off. LOOP_COUNT: 1 = one-shot, N = N times, 0 = infinite.
  • Diagnostics: ReadStatus, ReadFaultRegister, GetLastFaultByte, GetFaultPinState, GetChannelConfig per channel, GetBoardConfig, GetStatistics; formatted logging with section headers and tables for easy interpretation.
Build
From examples/esp32: ./scripts/build_app.sh max22200_solenoid_valve_test Debug
Author
HardFOC Development Team
Date
2025

Function Documentation

◆ app_main()

void app_main ( void )