PROFET™+2 12V Shield
-
class Bts700xShield : public hss::HssShield
Profet +2 (12V) shield with BTS700x-1EPP API.
Subclassed by hss::Bts700xShieldIno
Public Functions
-
Bts700xShield(GPIOPAL *led1, GPIOPAL *led2, GPIOPAL *led3, GPIOPAL *led4, Hss *hsw1, Hss *hsw2, Hss *hsw3, Hss *hsw4, TimerPAL *timer, GPIOPAL *oloff, GPIOPAL *pushButtonDigital, ADCPAL *pushButtonAnalog, ADCPAL *vBat, BtxVariants_t *btxVariant)
High-Side-Switch-Board constructor.
Initialize all protected class pointers with a null pointer
- Parameters:
led1 – [in] LED 1 instance
led2 – [in] LED 2 instance
led2 – [in] LED 3 instance
hsw1 – [in] High-side switch 1 instance
hsw2 – [in] High-side switch 2 instance
hsw3 – [in] High-side switch 3 instance
hsw4 – [in] High-side switch 4 instance
timer – [in] Timer instance
oloff – [in] Oloff instance
pushButtonDigital – [in] Push button GPIO instance
pushButtonAnalog – [in] Push button ADC instance
vBat – [in] Battery voltage
btxVariant – [in] Shield variant type
-
~Bts700xShield()
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:
High-side switch error code
-
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)
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)
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
-
Error_t switchesHxOn(bool h1 = false, bool h2 = false, bool h3 = false, bool h4 = false)
Turn on the selected High-Side-Switches.
This function is used to enable multiple switches at once.
- Parameters:
h1 – [in] Enable the first switch if h1 == true
h2 – [in] Enable the second switch if h2 == true
h3 – [in] Enable the third switch if h3 == true
h4 – [in] Enable the fourth switch if h4 == true
- Returns:
High-side switch error code
-
Error_t switchesHxOff(bool h1 = false, bool h2 = false, bool h3 = false, bool h4 = false)
Turn off the selected High-Side-Switches.
This function is used to disable multiple switches at once.
- Parameters:
h1 – [in] Disable the first switch if h1 == true
h2 – [in] Disable the second switch if h2 == true
h3 – [in] Disable the third switch if h3 == true
h4 – [in] Disable the fourth switch if h4 == true
- Returns:
High-side switch error code
-
virtual DiagStatus_t readDiagx(uint8_t x)
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-4)
- Return values:
0 – Everything works correctly
2 – Short to ground
4 – Short to battery
5 – Open load
- Returns:
DiagStatus_t
-
virtual float readIsx(uint8_t x)
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-4)
- 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 digitalReadButton()
Read the button state.
- Return values:
true – If button is pressed
false – If button is not pressed
- Returns:
bool
-
bool analogReadButton()
Read the button state (analog)
- Return values:
true – If button is pressed
false – If button is not pressed
-
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]
-
Bts700xShield(GPIOPAL *led1, GPIOPAL *led2, GPIOPAL *led3, GPIOPAL *led4, Hss *hsw1, Hss *hsw2, Hss *hsw3, Hss *hsw4, TimerPAL *timer, GPIOPAL *oloff, GPIOPAL *pushButtonDigital, ADCPAL *pushButtonAnalog, ADCPAL *vBat, BtxVariants_t *btxVariant)