TLE92466ED Driver 0.1.0-preview
Modern C++23 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
Loading...
Searching...
No Matches
TLE92466ED_Config.hpp
Go to the documentation of this file.
1
13#pragma once
14
15#include <cstdint>
16
18
25struct SPIPins {
26 static constexpr int MISO = 2;
27 static constexpr int MOSI = 7;
28 static constexpr int SCLK = 6;
29 static constexpr int CS = 10;
30};
31
38struct SPIParams {
39 static constexpr int FREQUENCY = 1000000;
40 static constexpr int MODE = 0;
41 static constexpr int QUEUE_SIZE = 1;
42};
43
52 static constexpr uint16_t SINGLE_CHANNEL_MIN = 0;
53 static constexpr uint16_t SINGLE_CHANNEL_MAX = 2000;
54 static constexpr uint16_t PARALLEL_CHANNEL_MAX = 4000;
55 static constexpr uint16_t RESOLUTION = 61;
56};
57
65 static constexpr float VBAT_MIN = 8.0f;
66 static constexpr float VBAT_NOM = 12.0f;
67 static constexpr float VBAT_MAX = 28.0f;
68 static constexpr float VDD_NOM = 3.3f;
69};
70
77 static constexpr int OPERATING_MIN = -40;
78 static constexpr int OPERATING_MAX = 150;
79 static constexpr int JUNCTION_MAX = 150;
80 static constexpr int WARNING_THRESHOLD = 130;
81};
82
88struct Timing {
89 static constexpr uint32_t CS_SETUP_US = 1;
90 static constexpr uint32_t CS_HOLD_US = 1;
91 static constexpr uint32_t INTER_FRAME_US = 10;
92 static constexpr uint32_t POWER_ON_DELAY_MS = 50;
93 static constexpr uint32_t RESET_DELAY_MS = 10;
94};
95
102 static constexpr uint16_t OVERCURRENT_THRESHOLD_MA = 2100;
103 static constexpr uint32_t POLL_INTERVAL_MS = 100;
104 static constexpr uint8_t MAX_RETRY_COUNT = 3;
105};
106
113 static constexpr uint16_t DEFAULT_TEST_CURRENT = 500;
114 static constexpr uint32_t TEST_DURATION_MS = 5000;
115 static constexpr uint16_t RAMP_STEP_MA = 100;
116 static constexpr uint32_t RAMP_STEP_DELAY_MS = 500;
117};
118
126 static constexpr uint8_t PAIR_0_CH_A = 0;
127 static constexpr uint8_t PAIR_0_CH_B = 3;
128
129 static constexpr uint8_t PAIR_1_CH_A = 1;
130 static constexpr uint8_t PAIR_1_CH_B = 2;
131
132 static constexpr uint8_t PAIR_2_CH_A = 4;
133 static constexpr uint8_t PAIR_2_CH_B = 5;
134};
135
141struct AppConfig {
142 // Logging
143 static constexpr bool ENABLE_DEBUG_LOGGING = true;
144 static constexpr bool ENABLE_SPI_LOGGING = false;
145
146 // Performance
147 static constexpr bool ENABLE_PERFORMANCE_MONITORING = true;
148 static constexpr uint32_t STATS_REPORT_INTERVAL_MS = 10000;
149
150 // Error handling
151 static constexpr bool ENABLE_AUTO_RECOVERY = true;
152 static constexpr uint8_t MAX_ERROR_COUNT = 10;
153};
154
155} // namespace TLE92466ED_Config
156
163 "Single channel current exceeds hardware limit of 2000mA");
164
166 "Parallel channel current exceeds hardware limit of 4000mA");
167
168static_assert(TLE92466ED_Config::SPIParams::FREQUENCY <= 8000000,
169 "SPI frequency exceeds TLE92466ED maximum of 8MHz");
170
171static_assert(TLE92466ED_Config::SPIParams::MODE == 0,
172 "TLE92466ED requires SPI Mode 0 (CPOL=0, CPHA=0)");
173
177#define TLE92466ED_VALIDATE_CURRENT(current_ma) \
178 static_assert((current_ma) <= TLE92466ED_Config::CurrentLimits::SINGLE_CHANNEL_MAX, \
179 "Current exceeds maximum limit")
180
184#define TLE92466ED_VALIDATE_GPIO(pin) \
185 static_assert((pin) >= 0 && (pin) < 30, "Invalid GPIO pin number for ESP32-C6")
Definition TLE92466ED_Config.hpp:17
Application-specific Configuration.
Definition TLE92466ED_Config.hpp:141
static constexpr bool ENABLE_DEBUG_LOGGING
Enable detailed debug logs.
Definition TLE92466ED_Config.hpp:143
static constexpr bool ENABLE_AUTO_RECOVERY
Enable automatic error recovery.
Definition TLE92466ED_Config.hpp:151
static constexpr uint8_t MAX_ERROR_COUNT
Maximum errors before failsafe.
Definition TLE92466ED_Config.hpp:152
static constexpr uint32_t STATS_REPORT_INTERVAL_MS
Statistics reporting interval.
Definition TLE92466ED_Config.hpp:148
static constexpr bool ENABLE_PERFORMANCE_MONITORING
Enable performance metrics.
Definition TLE92466ED_Config.hpp:147
static constexpr bool ENABLE_SPI_LOGGING
Enable SPI transaction logs.
Definition TLE92466ED_Config.hpp:144
Channel Pairing for Parallel Mode.
Definition TLE92466ED_Config.hpp:125
static constexpr uint8_t PAIR_1_CH_B
Definition TLE92466ED_Config.hpp:130
static constexpr uint8_t PAIR_2_CH_A
Channel 4 pairs with Channel 5.
Definition TLE92466ED_Config.hpp:132
static constexpr uint8_t PAIR_0_CH_B
Definition TLE92466ED_Config.hpp:127
static constexpr uint8_t PAIR_1_CH_A
Channel 1 pairs with Channel 2.
Definition TLE92466ED_Config.hpp:129
static constexpr uint8_t PAIR_0_CH_A
Channel 0 pairs with Channel 3.
Definition TLE92466ED_Config.hpp:126
static constexpr uint8_t PAIR_2_CH_B
Definition TLE92466ED_Config.hpp:133
Current Control Limits (milliamps)
Definition TLE92466ED_Config.hpp:51
static constexpr uint16_t PARALLEL_CHANNEL_MAX
Maximum parallel channel current (mA)
Definition TLE92466ED_Config.hpp:54
static constexpr uint16_t RESOLUTION
Current resolution (μA per LSB)
Definition TLE92466ED_Config.hpp:55
static constexpr uint16_t SINGLE_CHANNEL_MIN
Minimum current (mA)
Definition TLE92466ED_Config.hpp:52
static constexpr uint16_t SINGLE_CHANNEL_MAX
Maximum single channel current (mA)
Definition TLE92466ED_Config.hpp:53
Diagnostic Thresholds.
Definition TLE92466ED_Config.hpp:101
static constexpr uint32_t POLL_INTERVAL_MS
Diagnostic polling interval (ms)
Definition TLE92466ED_Config.hpp:103
static constexpr uint16_t OVERCURRENT_THRESHOLD_MA
Overcurrent fault threshold (mA)
Definition TLE92466ED_Config.hpp:102
static constexpr uint8_t MAX_RETRY_COUNT
Maximum communication retries.
Definition TLE92466ED_Config.hpp:104
SPI Communication Parameters.
Definition TLE92466ED_Config.hpp:38
static constexpr int MODE
SPI Mode 0 (CPOL=0, CPHA=0)
Definition TLE92466ED_Config.hpp:40
static constexpr int QUEUE_SIZE
Transaction queue size.
Definition TLE92466ED_Config.hpp:41
static constexpr int FREQUENCY
1MHz SPI frequency
Definition TLE92466ED_Config.hpp:39
SPI Configuration for ESP32-C6.
Definition TLE92466ED_Config.hpp:25
static constexpr int MISO
GPIO2 - SPI MISO (Master In Slave Out)
Definition TLE92466ED_Config.hpp:26
static constexpr int SCLK
GPIO6 - SPI Clock.
Definition TLE92466ED_Config.hpp:28
static constexpr int MOSI
GPIO7 - SPI MOSI (Master Out Slave In)
Definition TLE92466ED_Config.hpp:27
static constexpr int CS
GPIO10 - Chip Select (active low)
Definition TLE92466ED_Config.hpp:29
Supply Voltage Specifications (volts)
Definition TLE92466ED_Config.hpp:64
static constexpr float VBAT_MAX
Maximum VBAT voltage (V)
Definition TLE92466ED_Config.hpp:67
static constexpr float VBAT_MIN
Minimum VBAT voltage (V)
Definition TLE92466ED_Config.hpp:65
static constexpr float VDD_NOM
Logic supply voltage (V)
Definition TLE92466ED_Config.hpp:68
static constexpr float VBAT_NOM
Nominal VBAT voltage (V)
Definition TLE92466ED_Config.hpp:66
Temperature Specifications (celsius)
Definition TLE92466ED_Config.hpp:76
static constexpr int JUNCTION_MAX
Maximum junction temperature (°C)
Definition TLE92466ED_Config.hpp:79
static constexpr int OPERATING_MAX
Maximum operating temperature (°C)
Definition TLE92466ED_Config.hpp:78
static constexpr int OPERATING_MIN
Minimum operating temperature (°C)
Definition TLE92466ED_Config.hpp:77
static constexpr int WARNING_THRESHOLD
Temperature warning threshold (°C)
Definition TLE92466ED_Config.hpp:80
Test Configuration.
Definition TLE92466ED_Config.hpp:112
static constexpr uint32_t RAMP_STEP_DELAY_MS
Delay between ramp steps (ms)
Definition TLE92466ED_Config.hpp:116
static constexpr uint16_t RAMP_STEP_MA
Current ramp step size (mA)
Definition TLE92466ED_Config.hpp:115
static constexpr uint32_t TEST_DURATION_MS
Test duration (ms)
Definition TLE92466ED_Config.hpp:114
static constexpr uint16_t DEFAULT_TEST_CURRENT
Default test current (mA)
Definition TLE92466ED_Config.hpp:113
Timing Parameters (microseconds)
Definition TLE92466ED_Config.hpp:88
static constexpr uint32_t RESET_DELAY_MS
Reset pulse duration (ms)
Definition TLE92466ED_Config.hpp:93
static constexpr uint32_t POWER_ON_DELAY_MS
Power-on initialization delay (ms)
Definition TLE92466ED_Config.hpp:92
static constexpr uint32_t INTER_FRAME_US
Minimum time between frames (μs)
Definition TLE92466ED_Config.hpp:91
static constexpr uint32_t CS_SETUP_US
CS setup time before SCLK (μs)
Definition TLE92466ED_Config.hpp:89
static constexpr uint32_t CS_HOLD_US
CS hold time after SCLK (μs)
Definition TLE92466ED_Config.hpp:90