Power PROFET™ Shield
-
class Bts5001xShield : public hss::HssShield
Power Profet (12V) shield with BTS500xx API.
Subclassed by hss::Bts5001xShieldIno
Public Functions
-
Bts5001xShield(Hss *hsw1, GPIOPAL *led2, GPIOPAL *led3, ADCPAL *pushButton, ADCPAL *vBat)
High-Side-Switch-Board constructor.
Initialize all protected class pointers with a null pointer.
- Parameters:
hsw1 – [in] High-side switch 1 instance
led2 – [in] LED 2 instance
led3 – [in] LED 3 instance
pushButton – [in] Push button ADC instance
vBat – [in] Battery voltage ADC instance
-
~Bts5001xShield()
Destructor of the High-Side-Switch-Board.
-
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:
hss::Error_t
-
virtual Error_t deinit()
Deinitialize all necessary objects of the High-Side-Switch-Board.
This function deinitializes all necessary objects of the High-Side-Switch-Board. It returns an error code to see if everything was deinitialized correctly.
- Returns:
High-side switch error code
-
virtual Error_t switchHxOn(uint8_t x = 0)
Switch on the selected High-Side-Switch.
This function turns on the desired High-Side-Switch. It also turns on the corresponding LED of the switch.
- Parameters:
x – [in] Number of the Switch the should be turned on (1-4)
- Returns:
High-side switch error code
-
virtual Error_t switchHxOff(uint8_t x = 0)
Switch off the selected High-Side-Switch.
This function turns off the desired High-Side-Switch. It also turns off the corresponding LED of the switch.
- Parameters:
x – [in] Number of the Switch the should be turned off (1-4)
- Returns:
High-side switch error code
-
virtual DiagStatus_t readDiagx(uint8_t x = 0)
Read the diagnosis of the chosen channel.
This function uses the current signal of the channel to diagnose the channel. It returns the different states depending on the channels condition.
- Parameters:
x – [in] Desired channel for the diagnosis (1)
- Return values:
-2 – Not enabled
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 = 1)
Read the desired current value of the chosen channel.
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 channel (1)
- Returns:
The value of the current in [A]
-
float readVss()
Reads the batter voltage.
This functions is reading the attached voltage at the Profet-Board.
- Returns:
Value of the battery voltage in [V]
-
bool analogReadButton()
Read the button state (analog)
- Return values:
true – If button is pressed
false – If button is not pressed
- Returns:
bool
-
void setVoltageOffset(float offset)
Set battery voltage offset.
This function can be used to change the value of the internal variable of the battery voltage offset
- Parameters:
offset – [in] Desired value of the offset in [V]
-
Bts5001xShield(Hss *hsw1, GPIOPAL *led2, GPIOPAL *led3, ADCPAL *pushButton, ADCPAL *vBat)