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.
Dependencies: max20303
Dependents: HSP3_USB_serial MAX32630HSP3_IMU_Hello_World
max32630hsp.h
00001 /******************************************************************************* 00002 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 00003 * 00004 * Permission is hereby granted, free of charge, to any person obtaining a 00005 * copy of this software and associated documentation files (the "Software"), 00006 * to deal in the Software without restriction, including without limitation 00007 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00008 * and/or sell copies of the Software, and to permit persons to whom the 00009 * Software is furnished to do so, subject to the following conditions: 00010 * 00011 * The above copyright notice and this permission notice shall be included 00012 * in all copies or substantial portions of the Software. 00013 * 00014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00015 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00016 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00017 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 00018 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00019 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00020 * OTHER DEALINGS IN THE SOFTWARE. 00021 * 00022 * Except as contained in this notice, the name of Maxim Integrated 00023 * Products, Inc. shall not be used except as stated in the Maxim Integrated 00024 * Products, Inc. Branding Policy. 00025 * 00026 * The mere transfer of this software does not imply any licenses 00027 * of trade secrets, proprietary technology, copyrights, patents, 00028 * trademarks, maskwork rights, or any other form of intellectual 00029 * property whatsoever. Maxim Integrated Products, Inc. retains all 00030 * ownership rights. 00031 ******************************************************************************* 00032 */ 00033 00034 #ifndef _MAX32630HSP_H_ 00035 #define _MAX32630HSP_H_ 00036 00037 #include "mbed.h" 00038 #include "MAX20303.h" 00039 00040 /** 00041 * @brief MAX32630HSP Board Support Library 00042 * 00043 * @details The MAX32630HSP is a rapid development application board for 00044 * ultra low power wearable applications. It includes common peripherals and 00045 * expansion connectors all power optimized for getting the longest life from 00046 * the battery. This library configures the power and I/O for the board. 00047 * <br>https://www.maximintegrated.com/max32630hsp 00048 * 00049 * @code 00050 * #include "mbed.h" 00051 * #include "max32630hsp.h" 00052 * 00053 * DigitalOut led1(LED1); 00054 * MAX32630HSP icarus(MAX32630HSP::VIO_3V3); 00055 * 00056 * // main() runs in its own thread in the OS 00057 * // (note the calls to Thread::wait below for delays) 00058 * int main() 00059 * { 00060 * // initialize power and I/O on MAX32630HSP board 00061 * icarus.init(); 00062 * 00063 * while (true) { 00064 * led1 = !led1; 00065 * Thread::wait(500); 00066 * } 00067 * } 00068 * @endcode 00069 */ 00070 00071 // Sharp LS013B7DH03 Memory Display 00072 #define SCK_PIN P6_1 00073 #define MOSI_PIN P6_2 00074 #define CS_PIN P6_5 00075 #define EXTCOM_PIN P6_4 00076 #define DISP_PIN P6_6 00077 #define DISPSEL_PIN NC 00078 00079 class MAX32630HSP 00080 { 00081 public: 00082 // max32630hsp configuration utilities 00083 00084 /** 00085 * @brief IO Voltage 00086 * @details Enumerated options for operating voltage 00087 */ 00088 typedef enum { 00089 VIO_1V8 = 0x00, ///< 1.8V IO voltage at headers (from BUCK2) 00090 VIO_3V3 = 0x01, ///< 3.3V IO voltage at headers (from LDO2) 00091 } vio_t; 00092 00093 /** 00094 * MAX32630HSP constructor. 00095 * 00096 */ 00097 MAX32630HSP(); 00098 00099 /** 00100 * MAX32630HSP constructor. 00101 * 00102 */ 00103 MAX32630HSP(vio_t vio); 00104 00105 /** 00106 * MAX32630HSP destructor. 00107 */ 00108 ~MAX32630HSP(); 00109 00110 /** 00111 * @brief Initialize MAX32630HSP board 00112 * @details Initializes PMIC and I/O on MAX32630HSP board. 00113 * Configures PMIC to enable LDO2 and LDO3 at 3.3V. 00114 * Disables resisitive pulldown on MON(AIN_0) 00115 * Sets default I/O voltages to 3V3 for micro SD card. 00116 * Sets I/O voltage for header pins to hdrVio specified. 00117 * @param hdrVio I/O voltage for header pins 00118 * @returns 0 if no errors, -1 if error. 00119 */ 00120 int init(vio_t hdrVio); 00121 00122 /** 00123 * @brief Sets I/O Voltage 00124 * @details Sets the voltage rail to be used for a given pin. 00125 * VIO_1V8 selects VDDIO which is supplied by Buck2, which is set at 1.8V, 00126 * VIO_3V3 selects VDDIOH which is supplied by LDO2, which is typically 3.3V/ 00127 * @param pin Pin whose voltage supply is being assigned. 00128 * @param vio Voltage rail to be used for specified pin. 00129 * @returns 0 if no errors, -1 if error. 00130 */ 00131 int vddioh(PinName pin, vio_t vio); 00132 00133 /* Set vddio for Sharp LS013B7DH03 Display */ 00134 void enableDisplay(void); 00135 00136 /// Local I2C bus for configuring PMIC and accessing BMI160 IMU. 00137 I2C i2c; 00138 00139 /// MAX20303 PMIC Instance 00140 MAX20303 max20303; 00141 }; 00142 00143 #endif /* _MAX32630HSP_H_ */
Generated on Tue Jul 19 2022 23:21:06 by
1.7.2