HSP2.0 P2 forked library

Dependencies:   max20303

Dependents:   Host_Software_MAX32664GWEB_HR_wrist Host_Software_MAX32664GWEC_SpO2_HR Host_Software_MAX32664GWEB_HR_EXTENDED Host_Software_MAX32664GWEC_SpO2_HR-_EXTE ... more

Revision:
4:8f96e309b233
Parent:
3:60c0cc971d85
--- a/max32630hsp.h	Wed Apr 25 09:56:03 2018 +0300
+++ b/max32630hsp.h	Thu Jan 03 12:08:03 2019 +0300
@@ -37,6 +37,7 @@
 #include "mbed.h"
 #include "MAX20303.h"
 
+
 /**
  * @brief MAX32630HSP Board Support Library
  *
@@ -69,12 +70,15 @@
  */
 
 // Sharp LS013B7DH03 Memory Display
-#define SCK_PIN     P6_1
-#define MOSI_PIN    P6_2
-#define CS_PIN      P6_5
-#define EXTCOM_PIN  P6_4
-#define DISP_PIN    P6_6
-#define DISPSEL_PIN NC
+#define SCK_PIN     		P6_1
+#define MOSI_PIN    		P6_2
+#define CS_PIN      		P6_5
+#define EXTCOM_PIN  		P6_4
+#define DISP_PIN    		P6_6
+#define DISPSEL_PIN 		NC
+#define	PIN_POWERBUTTON		P7_6
+#define	PIN_UPBUTTON		P2_3
+#define	PIN_DOWNBUTTON		P6_5
 
 class MAX32630HSP
 {
@@ -90,6 +94,11 @@
         VIO_3V3 = 0x01,    ///< 3.3V IO voltage at headers (from LDO2)
     } vio_t;
 
+    enum ButtonStatus {
+    	BUTTONSTATUS_RELEASED = 1,
+		BUTTONSTATUS_PRESSED
+    } ;
+
     /**
         * MAX32630HSP constructor.
         *
@@ -103,10 +112,18 @@
     MAX32630HSP(vio_t vio);
 
     /**
+        * MAX32630HSP constructor.
+        *
+        */
+    MAX32630HSP(vio_t vio, InterruptIn *max32630hsp3_powerButtonInterrupt);
+
+    /**
         * MAX32630HSP destructor.
         */
     ~MAX32630HSP();
 
+    //InterruptIn _interruptIn_PowerButton;
+
     /**
      * @brief   Initialize MAX32630HSP board
      * @details Initializes PMIC and I/O on MAX32630HSP board.
@@ -130,7 +147,12 @@
     */
     int vddioh(PinName pin, vio_t vio);
 
-	/* Set vddio for Sharp LS013B7DH03 Display */
+    /**Interrupt Hander for Power Button Press**/
+
+    //InterruptIn _interruptIn_UpButton(PIN_UPBUTTON);
+    //InterruptIn _interruptIn_DownButton(PIN_DOWNBUTTON);
+
+    /* Set vddio for Sharp LS013B7DH03 Display */
 	void enableDisplay(void);
 
     /// Local I2C bus for configuring PMIC and accessing BMI160 IMU.
@@ -138,6 +160,19 @@
 
     /// MAX20303 PMIC Instance
     MAX20303 max20303;
+
+
+    InterruptIn *m_max32630hsp3_powerButtonInterrupt;
+    bool	button_status;
+    bool	button_longpressdetected;
+    Timeout	button_timeout;
+
+    ButtonStatus status_powerButton;
+    ButtonStatus status_upButton;
+    ButtonStatus status_downButton;
+    void event_powerButtonPressed(void);
+    void event_powerButtonReleased(void);
+    void event_longpresscheck(void);
 };
 
 #endif /* _MAX32630HSP_H_ */