Power PROFET™ Shield - 1LUA

class Bts500xxShield : public hss::HssShield

Power PROFET +12V Shield with BTS500xx-1LUA API.

Subclassed by hss::Bts500xxShieldIno

Public Functions

Bts500xxShield(Hss *sw1, Hss *sw2, ADCPAL *vs, ADCPAL *vOut, ADCPAL *temp, BtxVariants_t *btxVariant1, BtxVariants_t *btxVariant2)

Power PROFET +12V BTS500xx 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 High-Side-Switch 1

  • temp[in] ADC instance to measure the temperature of the PCB

~Bts500xxShield()

Destructor of the PROFET +12V BTS500xx Shield.

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 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:

hss::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:

hss::Error_t

virtual Error_t switchHxOff(uint8_t x)

Switch off the selected High-Side-Switch.

This function turns off the desired High-Side-Switch.

Parameters:

x[in] Number of the Switch the should be turned off (1-2) Can be either SWITCH1 or SWITCH2.

Returns:

hss::Error_t

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:

hss::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:

hss::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.

Returns:

Value of the temperature in [°C]