Class Bth500xxShield
Defined in File hss-shield-bth500xx.hpp
Inheritance Relationships
Base Type
public hss::HssShield
(Class HssShield)
Derived Type
public hss::Bth500xxShieldIno
(Class Bth500xxShieldIno)
Class Documentation
-
class Bth500xxShield : public hss::HssShield
Power PROFET™ + 24V /48V BTH50015-1LUA API.
Subclassed by hss::Bth500xxShieldIno
Public Functions
-
Bth500xxShield(Hss *sw1, Hss *sw2, ADCPAL *vs, ADCPAL *vOut, ADCPAL *temp, BtxVariants_t *btxVariant1, BtxVariants_t *btxVariant2)
Power PROFET™ + 24V /48V BTH50015-1LUA Smart High-Side Power Switch Shield constructor.
- Parameters:
sw1 – [in] High-Side-Switch instance 1
sw2 – [in] High-Side-Switch instance 2
vs – [in] ADC instance to measure the supply voltage
vOut – [in] ADC instance to measure the output voltage of the first switch
temp – [in] ADC instance to measure the temperature
btxVariant1 – [in] Structure with sensor specific parameters of switch 1
btxVariant2 – [in] Structure with sensor specific parameters of switch 2
-
~Bth500xxShield()
Power PROFET™ + 24V /48V BTH50015-1LUA Smart High-Side Power Switch Shield destructor.
-
virtual Error_t init()
Initialize all necessary objects of the High-Side-Switch-Board.
This function initializes all necessary objects of the High-Side-Switch-Board. It returns an error code to see if everything was initialized correctly.
- Returns:
Error_t
-
virtual Error_t deinit()
Deinitialize all necessary objects of the High-Side-Switch-Board.
This function de-initializes all necessary objects of the High-Side-Switch-Board. It returns an error code to see if everything was de-initialized correctly.
- Returns:
Error_t
-
virtual Error_t switchHxOn(uint8_t x)
Switch on the selected High-Side-Switch.
This function turns on the desired High-Side-Switch.
- Parameters:
x – [in] Number of the Switch the should be turned on (1-2). Can be either SWITCH1 or SWITCH2.
- Returns:
Error_t
-
virtual Error_t switchHxOff(uint8_t x)
Turns off the specified shield switch output number.
- Parameters:
x – [in] Switch output number
- Returns:
High-side switch error code
-
virtual DiagStatus_t readDiagx(uint8_t x)
Read the diagnosis ouput of the chosen switch.
This function uses the current signal of the chosen switch to diagnose the switch. It returns the different states depending on the switch’s condition.
- Parameters:
x – [in] Desired Switch for the diagnosis (1-2) Can be either SWITCH1 or SWITCH2.
- Return values:
-1 – Diagnosis read error (chosen channel not valid)
0 – Switch is working fine
2 – Short circuit to ground
4 – Short circuit to Vs
5 – Open load detected
- Returns:
DiagStatus_t
-
virtual float readIsx(uint8_t x)
Read the desired current value of the chosen switch.
This function reads the IS pin of the chosen High-Side-Switch and calculates the current which is flowing through the switch with the acquired ADC value.
- Parameters:
x – [in] Number of the desired switch (1-2)
- Return values:
-1.2345 – Invalid channel was chosen
- Returns:
The value of the current in [A]
-
Error_t switchesHxOn(bool h1 = false, bool h2 = false)
Switches on High-Side-Switches.
This function can switch on several High-Side-Switches at once. But is also possible two only switch on the first or second one.
- Parameters:
h1 – [in] Bool value for the first switch.*true* means turn on, false means keep it as is.
h2 – [in] Bool value for the second switch.*true* means turn on, false means keep it as is.
- Returns:
Error_t
-
Error_t switchesHxOff(bool h1 = false, bool h2 = false)
Switches off High-Side-Switches.
This function can switch off several High-Side-Switches at once. But is also possible two only switch off the first or second one.
- Parameters:
h1 – [in] Bool value for the first switch.*true* means turn off, false means keep it as is.
h2 – [in] Bool value for the second switch.*true* means turn off, false means keep it as is.
- Returns:
Error_t
-
float readVs()
Read the supply voltage.
This function is reading the supply voltage of the High-Side-Switch-Board.
- Returns:
Value of the supply voltage in [V]
-
float readVOut()
Read the output voltage.
This function is reading the output voltage of High-Side-Switch one
- Returns:
Value of the output voltage in [V]
-
float readTemperature()
Read the PCB temperature.
This function is reading the temperature of the High-Side-Switch-Board PCB. If the functions is returning -35.43 °C the NTC is not populated on the PCB and the temp-object was not passed to the constructor.
- Returns:
Value of the temperature in [°C]
Protected Attributes
-
BtxVariants_t *btxVariant1
Variant of High-Side-Switch 1
-
BtxVariants_t *btxVariant2
Variant of High-Side-Switch 2
-
ExponentialFilter *filterVs
Filter for the supply voltage
-
ExponentialFilter *filterVOut
Filter for the output voltage for switch 1
-
ExponentialFilter *filterTemp
Filter for the temperature
Protected Static Attributes
-
static constexpr uint8_t hssNum = 2
Number of High-Side-Switches
-
Bth500xxShield(Hss *sw1, Hss *sw2, ADCPAL *vs, ADCPAL *vOut, ADCPAL *temp, BtxVariants_t *btxVariant1, BtxVariants_t *btxVariant2)