Simple demo example of X-NUCLEO-IPS02A1 24V Intelligent Power Switch Library usage.

Dependencies:   X_NUCLEO_IPS02A1 mbed

Fork of HelloWorld_IPS02A1 by ST Expansion SW Team

HelloWorld_IPS02A1, demo example for IPS02A1 expansion board

Introduction

This example application provides a basic code to show how to use the X-NUCLEO-IPS02A1 Intelligent Power Switch Expansion Board. The example performs current measurements on output Channel 1 (Ch1) and Channel 2 (Ch2), continuously, in the following conditions:

  • 1) Ch1 OFF, Ch2 OFF
  • 2) Ch1 ON, Ch2 OFF
  • 3) Ch1 OFF, Ch2 ON
  • 4) Ch1 ON, Ch2 ON

for each configuration the Current for each channel is displayed over an opened console (use Hyperterminal or whatever, set 9600 as bauds, 8-bit data, no parity)

Demo Code

The basic operation done by the demo code, which can be used in the customer application are :

1) In order to use get the singleton instance of the X_NUCLEO_IPS02A1 by calling class method `Instance()`:

// IPS expansion board singleton instance
static X_NUCLEO_IPS02A1 *ips_expansion_board = X_NUCLEO_IPS02A1::Instance();

2) Switch-on or Switch-off loads output (Channel 1 or Channel 2) by setting or clearing associated digital input :

            ips_expansion_board.vps2535h.In_1 = 1; // switch-on Channel 1
            ips_expansion_board.vps2535h.In_2 = 0; // switch-off Channel 2 

3) Read Current circulating on Channel 1 or Channel 2 and print on the Terminal

            Multisense_Signal= ips_expansion_board.GetCurrent(CHANNEL_1);
            printf("Current Ch1 = %2.3fA \n\r", Multisense_Signal);
            Multisense_Signal= ips_expansion_board.GetCurrent(CHANNEL_2);
            printf("Current Ch2 = %2.3fA \n\r", Multisense_Signal);

History

Aligning to ARM mbed coding style. default tip

2017-07-13, by Davidroid [Thu, 13 Jul 2017 16:12:22 +0000] rev 10

Aligning to ARM mbed coding style.


Aligned to ARM mbed coding style.

2017-05-09, by Davidroid [Tue, 09 May 2017 09:37:26 +0000] rev 9

Aligned to ARM mbed coding style.


Updated libraries.

2016-09-01, by nikapov [Thu, 01 Sep 2016 14:20:10 +0000] rev 8

Updated libraries.


update ST copyright to 2016

2016-07-28, by grussian [Thu, 28 Jul 2016 16:44:20 +0000] rev 7

update ST copyright to 2016


changed device name into the main from vps235h2 to vps2535h. Imported new version of the X_NUCLEO_IPS02_A1

2016-07-28, by grussian [Thu, 28 Jul 2016 16:12:44 +0000] rev 6

changed device name into the main from vps235h2 to vps2535h. Imported new version of the X_NUCLEO_IPS02_A1


Updated IPS02A1 library

2016-06-13, by grussian [Mon, 13 Jun 2016 14:15:09 +0000] rev 5

Updated IPS02A1 library


Updated IPS02A1 library

2016-06-13, by grussian [Mon, 13 Jun 2016 14:02:40 +0000] rev 4

Updated IPS02A1 library


Updated the new X_NUCLEO_IPS02A1 Library which fixed compiler error

2016-05-26, by grussian [Thu, 26 May 2016 10:19:07 +0000] rev 3

Updated the new X_NUCLEO_IPS02A1 Library which fixed compiler error


added component-class and readid

2016-04-07, by grussian [Thu, 07 Apr 2016 15:40:09 +0000] rev 2

added component-class and readid


added main.cpp

2016-04-07, by grussian [Thu, 07 Apr 2016 14:11:52 +0000] rev 1

added main.cpp