Firmware to manage X-Nucleo-IPS02A1 (24V) Intelligent Power Switch.

Dependents:   HelloWorld_IPS02A1

Fork of X_NUCLEO_IPS02A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

XNucleoIPS02A1 Class Reference

Class X_NUCLEO_IPS02A1 is intended to represent the intelligent power switch Nucleo Expansion Board with the same name. More...

#include <XNucleoIPS02A1.h>

Public Member Functions

float get_current (int ch)
 get current measurement from singleton's power switch

Static Public Member Functions

static XNucleoIPS02A1instance (PinName in1, PinName in2, PinName frstdby, PinName sense1, PinName sense2, float vref, float rsense, float rd1, float rd2)
 Get singleton instance.

Data Fields

VPS2535Hvps2535h
 Power switch.

Protected Member Functions

 XNucleoIPS02A1 (PinName in1, PinName in2, PinName frstdby, PinName sense1, PinName sense2, float vref, float rsense, float rd1, float rd2)
 Constructor.
bool init (void)
 Initialize the singleton's power switch to default settings.
bool init_VPS2535H (void)
 Initialize the singleton's power switch.

Detailed Description

Class X_NUCLEO_IPS02A1 is intended to represent the intelligent power switch Nucleo Expansion Board with the same name.

The expansion board is featuring basically of:

  1. a VPS2535H power switch

It is intentionally implemented as a singleton because only one XNucleoIPS02A1 at a time might be deployed in a HW component stack.
In order to get the singleton instance you have to call class method `Instance()`, e.g.:

 // Intelligent Power Switch expansion board singleton instance
 static XNucleoIPS02A1 *<TODO>_expansion_board = XNucleoIPS02A1::instance();

Definition at line 68 of file XNucleoIPS02A1.h.


Constructor & Destructor Documentation

XNucleoIPS02A1 ( PinName  in1,
PinName  in2,
PinName  frstdby,
PinName  sense1,
PinName  sense2,
float  vref,
float  rsense,
float  rd1,
float  rd2 
) [protected]

Constructor.

Returns:
a pointer to the initialized singleton instance of class X_NUCLEO_IPS02A1
Parameters:
[in]in1,input1Pin for the power switch
[in]in2,input1Pin for the power switch
[in]frstdby,stand-byPin
[in]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 64 of file XNucleoIPS02A1.cpp.


Member Function Documentation

float get_current ( int  ch )

get current measurement from singleton's power switch

Return values:
*hipscontain status of the operation param[in] Channel number: CHANNEL_1 or CHANNEL_2

Definition at line 107 of file XNucleoIPS02A1.cpp.

bool init ( void   ) [protected]

Initialize the singleton's power switch to default settings.

Return values:
trueif initialization successful,
falseotherwise

Definition at line 104 of file XNucleoIPS02A1.h.

bool init_VPS2535H ( void   ) [protected]

Initialize the singleton's power switch.

Return values:
trueif initialization successful,
falseotherwise

Definition at line 96 of file XNucleoIPS02A1.cpp.

XNucleoIPS02A1 & instance ( PinName  in1,
PinName  in2,
PinName  frstdby,
PinName  sense1,
PinName  sense2,
float  vref,
float  rsense,
float  rd1,
float  rd2 
) [static]

Get singleton instance.

Returns:
a pointer to the initialized singleton instance of class X_NUCLEO_IPS02A1
Parameters:
[in]none
Returns:
a pointer to the initialized singleton instance of class XNucleoIPS02A1
Parameters:
[in]none

Definition at line 75 of file XNucleoIPS02A1.cpp.


Field Documentation

Power switch.

Definition at line 89 of file XNucleoIPS02A1.h.