|
HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
|
Unified handler for TLE92466ED six-channel solenoid driver. More...
#include <Tle92466edHandler.h>
Classes | |
| struct | is_driver_result |
| Type trait to detect tle92466ed::DriverResult<T> types. More... | |
| struct | is_driver_result< tle92466ed::DriverResult< T > > |
Public Types | |
| using | DriverType = tle92466ed::Driver<HalSpiTle92466edComm> |
| Driver type alias. | |
Public Member Functions | |
| Tle92466edHandler (BaseSpi &spi, BaseGpio &resn, BaseGpio &en, BaseGpio *faultn=nullptr) noexcept | |
| Construct TLE92466ED handler. | |
| ~Tle92466edHandler () noexcept | |
| Tle92466edHandler (const Tle92466edHandler &)=delete | |
| Tle92466edHandler & | operator= (const Tle92466edHandler &)=delete |
| Tle92466edHandler (Tle92466edHandler &&)=delete | |
| Tle92466edHandler & | operator= (Tle92466edHandler &&)=delete |
| tle92466ed::DriverResult< void > | Initialize () noexcept |
| Initialize driver (hardware reset + SPI init + enter config mode). | |
| bool | EnsureInitialized () noexcept |
| Ensure driver is initialized (lazy init entrypoint). | |
| tle92466ed::DriverResult< void > | Initialize (const tle92466ed::GlobalConfig &config) noexcept |
| Initialize with global configuration. | |
| tle92466ed::DriverResult< void > | Deinitialize () noexcept |
| Deinitialize — disable channels and shut down. | |
| bool | IsInitialized () const noexcept |
| Check if initialized. | |
| tle92466ed::DriverResult< void > | ConfigureChannel (uint8_t channel, const tle92466ed::ChannelConfig &config) noexcept |
| Configure a channel. | |
| tle92466ed::DriverResult< void > | EnableChannel (uint8_t channel) noexcept |
| Enable a channel. | |
| tle92466ed::DriverResult< void > | DisableChannel (uint8_t channel) noexcept |
| Disable a channel. | |
| tle92466ed::DriverResult< void > | EnableAllChannels () noexcept |
| Enable all channels. | |
| tle92466ed::DriverResult< void > | DisableAllChannels () noexcept |
| Disable all channels. | |
| tle92466ed::DriverResult< void > | SetChannelCurrent (uint8_t channel, uint16_t current_ma) noexcept |
| Set channel current setpoint. | |
| tle92466ed::DriverResult< void > | ConfigurePwmRaw (uint8_t channel, uint8_t mantissa, uint8_t exponent, bool low_freq_range=false) noexcept |
| Configure raw PWM period for a channel. | |
| tle92466ed::DriverResult< void > | EnterMissionMode () noexcept |
| Enter mission mode (enable outputs after configuration). | |
| tle92466ed::DriverResult< void > | EnterConfigMode () noexcept |
| Enter config mode (for register writes). | |
| bool | IsMissionMode () noexcept |
| Check if in mission mode. | |
| tle92466ed::DriverResult< void > | GetStatus (tle92466ed::DeviceStatus &status) noexcept |
| Get device status. | |
| tle92466ed::DriverResult< void > | GetChannelDiagnostics (uint8_t channel, tle92466ed::ChannelDiagnostics &diag) noexcept |
| Get channel diagnostics. | |
| tle92466ed::DriverResult< void > | GetFaultReport (tle92466ed::FaultReport &report) noexcept |
| Get comprehensive fault report. | |
| tle92466ed::DriverResult< void > | ClearFaults () noexcept |
| Clear all fault flags. | |
| bool | HasFault () noexcept |
| Check if any fault is present. | |
| tle92466ed::DriverResult< void > | KickWatchdog (uint16_t reload_value=1000) noexcept |
| Reload the SPI watchdog. | |
| uint32_t | GetChipId () noexcept |
| Get chip ID (returns 0 on error). | |
| uint32_t | GetIcVersion () noexcept |
| Get IC version (returns 0 on error). | |
| DriverType * | GetDriver () noexcept |
| Get the underlying driver for advanced operations. | |
| const DriverType * | GetDriver () const noexcept |
| void | DumpDiagnostics () noexcept |
| Dump diagnostics to logger. | |
Static Public Attributes | |
| static constexpr uint8_t | kNumChannels = 6 |
Private Member Functions | |
| bool | EnsureInitializedLocked () noexcept |
| template<typename Fn > | |
| auto | withDriver (Fn &&fn) noexcept |
| Execute a lambda with a locked, initialized driver. | |
Private Attributes | |
| bool | initialized_ {false} |
| RtosMutex | mutex_ |
| std::unique_ptr< HalSpiTle92466edComm > | comm_ |
| std::unique_ptr< DriverType > | driver_ |
Unified handler for TLE92466ED six-channel solenoid driver.
Provides thread-safe access to all TLE92466ED driver features:
| using Tle92466edHandler::DriverType = tle92466ed::Driver<HalSpiTle92466edComm> |
Driver type alias.
|
noexcept |
Construct TLE92466ED handler.
| spi | Reference to pre-configured BaseSpi. |
| resn | BaseGpio for RESN pin (active LOW reset). |
| en | BaseGpio for EN pin (active HIGH enable). |
| faultn | Optional BaseGpio for FAULTN (active LOW fault indicator). |
|
noexcept |
|
delete |
|
delete |
|
noexcept |
Clear all fault flags.
|
noexcept |
Configure a channel.
| channel | Channel number (0-5). |
| config | Channel configuration. |
|
noexcept |
Configure raw PWM period for a channel.
| channel | Channel number (0-5). |
| mantissa | PWM period mantissa. |
| exponent | PWM period exponent. |
| low_freq_range | Use low frequency range. |
|
noexcept |
Deinitialize — disable channels and shut down.
|
noexcept |
Disable all channels.
|
noexcept |
Disable a channel.
|
noexcept |
Dump diagnostics to logger.
|
noexcept |
Enable all channels.
|
noexcept |
Enable a channel.
|
noexcept |
Ensure driver is initialized (lazy init entrypoint).
|
privatenoexcept |
|
noexcept |
Enter config mode (for register writes).
|
noexcept |
Enter mission mode (enable outputs after configuration).
|
noexcept |
Get channel diagnostics.
| channel | Channel number (0-5). | |
| [out] | diag | Diagnostics structure to fill. |
|
noexcept |
Get chip ID (returns 0 on error).
|
noexcept |
|
noexcept |
Get the underlying driver for advanced operations.
|
noexcept |
Get comprehensive fault report.
| [out] | report | Fault report structure to fill. |
|
noexcept |
Get IC version (returns 0 on error).
|
noexcept |
Get device status.
| [out] | status | Device status structure to fill. |
|
noexcept |
Check if any fault is present.
|
noexcept |
Initialize driver (hardware reset + SPI init + enter config mode).
|
noexcept |
Initialize with global configuration.
| config | Global device configuration. |
|
inlinenoexcept |
Check if initialized.
|
noexcept |
Check if in mission mode.
|
noexcept |
Reload the SPI watchdog.
| reload_value | Watchdog reload value (default 1000). |
|
delete |
|
delete |
|
noexcept |
Set channel current setpoint.
| channel | Channel number (0-5). |
| current_ma | Current in milliamps. |
|
inlineprivatenoexcept |
Execute a lambda with a locked, initialized driver.
Acquires the mutex, ensures initialization, and invokes fn(*driver_). Returns a default-constructed R on failure, or for DriverResult types, returns an error indicating the driver is not initialized.
|
private |
|
private |
|
private |
|
staticconstexpr |
|
mutableprivate |