ch1 test1

Dependencies:   MAX14690

Files at this revision

API Documentation at this revision

Comitter:
switches
Date:
Tue Dec 13 21:28:57 2016 +0000
Parent:
2:7a1d7d6d520e
Child:
4:d524f21d1d10
Child:
5:8e424775234a
Commit message:
Moved hdrVio parameter to init function so that it is more clear when this setting gets applied.

Changed in this revision

max32630fthr.cpp Show annotated file Show diff for this revision Revisions of this file
max32630fthr.h Show annotated file Show diff for this revision Revisions of this file
--- a/max32630fthr.cpp	Sun Nov 20 23:41:01 2016 +0000
+++ b/max32630fthr.cpp	Tue Dec 13 21:28:57 2016 +0000
@@ -38,9 +38,8 @@
 #include "max32630fthr.h"
 
 //******************************************************************************
-MAX32630FTHR::MAX32630FTHR(vio_t vio) : i2c(P5_7, P6_0), max14690(&i2c)
+MAX32630FTHR::MAX32630FTHR() : i2c(P5_7, P6_0), max14690(&i2c)
 {
-    hdrVio = vio;
 }
 
 //******************************************************************************
@@ -49,7 +48,7 @@
 }
 
 //******************************************************************************
-int MAX32630FTHR::init()
+int MAX32630FTHR::init(vio_t hdrVio)
 {
     // Override the default values
     max14690.ldo2Millivolts = 3300;
--- a/max32630fthr.h	Sun Nov 20 23:41:01 2016 +0000
+++ b/max32630fthr.h	Tue Dec 13 21:28:57 2016 +0000
@@ -41,25 +41,25 @@
  * @brief MAX32630FTHR Board Support Library
  *
  * @details The MAX32630FTHR is a rapid development application board for
- * ultra low power wearable applications.  It includes common peripherals and 
- * expansion connectors all power optimized for getting the longest life from 
+ * ultra low power wearable applications.  It includes common peripherals and
+ * expansion connectors all power optimized for getting the longest life from
  * the battery.  This library configures the power and I/O for the board.
  * <br>https://www.maximintegrated.com/max32630fthr
  *
  * @code
  * #include "mbed.h"
  * #include "max32630fthr.h"
- * 
+ *
  * DigitalOut led1(LED1);
  * MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
- * 
+ *
  * // main() runs in its own thread in the OS
  * // (note the calls to Thread::wait below for delays)
  * int main()
  * {
  *     // initialize power and I/O on MAX32630FTHR board
  *     pegasus.init();
- *     
+ *
  *     while (true) {
  *         led1 = !led1;
  *         Thread::wait(500);
@@ -84,9 +84,8 @@
     /**
         * MAX32630FTHR constructor.
         *
-        * @param vio I/O voltage for header pins
         */
-    MAX32630FTHR(vio_t vio);
+    MAX32630FTHR();
 
     /**
         * MAX32630FTHR destructor.
@@ -100,30 +99,28 @@
      *  Disables resisitive pulldown on MON(AIN_0)
      *  Sets default I/O voltages to 3V3 for micro SD card.
      *  Sets I/O voltage for header pins to hdrVio specified.
+     * @param hdrVio I/O voltage for header pins
      * @returns 0 if no errors, -1 if error.
     */
-    int init();
+    int init(vio_t hdrVio);
 
     /**
      * @brief   Sets I/O Voltage
      * @details Sets the voltage rail to be used for a given pin.
-     *  VIO_1V8 selects VDDIO which is supplied by Buck2, which is set at 1.8V,   
+     *  VIO_1V8 selects VDDIO which is supplied by Buck2, which is set at 1.8V,
      *  VIO_3V3 selects VDDIOH which is supplied by LDO2, which is typically 3.3V/
      * @param   pin Pin whose voltage supply is being assigned.
      * @param   vio Voltage rail to be used for specified pin.
      * @returns 0 if no errors, -1 if error.
     */
     int vddioh(PinName pin, vio_t vio);
-    
+
     /// Local I2C bus for configuring PMIC and accessing BMI160 IMU.
     I2C i2c;
 
     /// MAX14690 PMIC Instance
     MAX14690 max14690;
 
-    /// The default I/O voltage to be used for header pins.
-    vio_t hdrVio;    
-
 };
 
 #endif /* _MAX32630FTHR_H_ */