Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: HelloWorld_IPS02A1
Fork of X_NUCLEO_IPS02A1 by
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 XNucleoIPS02A1 & | instance (PinName in1, PinName in2, PinName frstdby, PinName sense1, PinName sense2, float vref, float rsense, float rd1, float rd2) |
| Get singleton instance. | |
Data Fields | |
| VPS2535H & | vps2535h |
| 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:
- 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,input1 Pin for the power switch [in] in2,input1 Pin for the power switch [in] frstdby,stand-by Pin [in] sense1 and sense2, outputs from Ch1 and Ch2 [in] vref,reference voltage [in] rsense,sense resistor ouside of chip [in] rd1,upper partitor resistor (=R6 in schematic) to protect ADC [in] rd1,lower partitor 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:
-
*hips contain 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:
-
true if initialization successful, false otherwise
Definition at line 104 of file XNucleoIPS02A1.h.
| bool init_VPS2535H | ( | void | ) | [protected] |
Initialize the singleton's power switch.
- Return values:
-
true if initialization successful, false otherwise
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.
Generated on Sat Jul 16 2022 04:19:39 by
1.7.2

X-NUCLEO-IPS02A1 - 24V Intelligent power switch expansion board