ST / X_NUCLEO_IPS02A1

Dependents:   HelloWorld_IPS02A1

Fork of X_NUCLEO_IPS02A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

VPS2535H Class Reference

Class representing a VPS2535H power switch component. More...

#include <VPS2535H.h>

Inherits PowerSwitch.

Public Member Functions

 VPS2535H (PinName in1, PinName in2, PinName frStdby, PinName sense1, PinName sense2, float vref, float rsense, float rd1, float rd2)
 Constructor.
virtual ~VPS2535H ()
 Destructor.
virtual int init (void *init_struct)
 Set VPS2535H Initialization.
virtual int close (void)
 Close VPS2535H.
virtual int read_id (uint8_t *id)
 Getting the ID of the component.
virtual float get_current (int Ch)
 GetCurrent function gets the I-sense switch output pin.
IPS_StatusTypeDef VPS2535H_get_secure_current_sense (IPS_HandleTypeDef *hips)
 GetSecureCurrentSense function gets the I-sense switch output pin upon ADC conversion.

Protected Member Functions

IPS_StatusTypeDef VPS2535H_close (void)
 Close (Deinitialize) the VPS2535H device and used peripheral.
IPS_StatusTypeDef VPS2535H_init (void)
 Initializes the VPS2535H device.
IPS_StatusTypeDef VPS2535H_get_sense_channel_diagnostic (IPS_HandleTypeDef *)
 GetSense function gets the value of the Sense power switch output pin (for either Ch1 or Ch2) upon IO conversion.

Detailed Description

Class representing a VPS2535H power switch component.

Definition at line 62 of file VPS2535H.h.


Constructor & Destructor Documentation

VPS2535H ( PinName  in1,
PinName  in2,
PinName  frStdby,
PinName  sense1,
PinName  sense2,
float  vref,
float  rsense,
float  rd1,
float  rd2 
)

Constructor.

Parameters:
[in]inputPin for the power switch
[out]sense1and sense2, outputs from Ch1 and Ch2
[in]vref,referencevoltage
[in]rsense,senseresistor ouside of chip
[in]rd1,upperpartitor resistor (=R6 in schematic) to protect ADC
[in]rd1,lowerpartitor resistor (=R7 in schematic) to protect ADC

Definition at line 75 of file VPS2535H.h.

virtual ~VPS2535H (  ) [virtual]

Destructor.

Definition at line 93 of file VPS2535H.h.


Member Function Documentation

int close ( void   ) [virtual]

Close VPS2535H.

Parameters:
none
Return values:
IPS_SUCCESS

Definition at line 60 of file VPS2535H.cpp.

float get_current ( int  Ch ) [virtual]

GetCurrent function gets the I-sense switch output pin.

Parameters:
Ch,:Channel number. Possible value are CHANNEL_1 or CHANNEL_2
Return values:
CurrentValue

Implements PowerSwitch.

Definition at line 144 of file VPS2535H.cpp.

int init ( void *  init_struct ) [virtual]

Set VPS2535H Initialization.

Parameters:
VPS2535Hhandel structure
Return values:
IPS_SUCCESS

Implements Component.

Definition at line 50 of file VPS2535H.cpp.

virtual int read_id ( uint8_t *  id ) [virtual]

Getting the ID of the component.

Parameters:
[out]idpointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.

Implements Component.

Definition at line 100 of file VPS2535H.h.

IPS_StatusTypeDef VPS2535H_close ( void   ) [protected]

Close (Deinitialize) the VPS2535H device and used peripheral.

Parameters:
None
Return values:
VPS2535Hstatus

Definition at line 81 of file VPS2535H.cpp.

IPS_StatusTypeDef VPS2535H_get_secure_current_sense ( IPS_HandleTypeDef hips )

GetSecureCurrentSense function gets the I-sense switch output pin upon ADC conversion.

Parameters:
hips,:pointer to a IPS_HandleTypeDef structure that contains the configuration information for the specified VPS2535H module. Value got from V-sense output is stored in hips->SenseValue field. Status of the operation is stored in hips->Status fields
Return values:
IPSstatus

Definition at line 123 of file VPS2535H.cpp.

IPS_StatusTypeDef VPS2535H_get_sense_channel_diagnostic ( IPS_HandleTypeDef hips ) [protected]

GetSense function gets the value of the Sense power switch output pin (for either Ch1 or Ch2) upon IO conversion.

It just reads from sense pin

Parameters:
hips,:pointer to a VPS2535H_HandleTypeDef structure that contains the configuration information for the specified VPS2535H module. Value got from V-sense output is stored in hips->SenseValue field. Status of the operation is stored in hips->Status and hips->Status fields
Return values:
IPS_StatusTypeDefstatus

Definition at line 96 of file VPS2535H.cpp.

IPS_StatusTypeDef VPS2535H_init ( void   ) [protected]

Initializes the VPS2535H device.

Parameters:
none
Return values:
VPS2535Hstatus

Definition at line 71 of file VPS2535H.cpp.