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.
Fork of max77756 by
max77756.h
00001 /******************************************************************************* 00002 * Copyright (C) 2017 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 _MAX77756_H_ 00035 #define _MAX77756_H_ 00036 00037 #include "mbed.h" 00038 00039 class MAX77756 00040 { 00041 00042 public: 00043 00044 /** 00045 * @brief Register Addresses 00046 * @details Enumerated MAX77756 register addresses 00047 */ 00048 typedef enum { 00049 REG_CONFIGA = 0x00, 00050 REG_CONFIGB 00051 } registers_t; 00052 00053 /** 00054 * @brief Spread Spectrum Control 00055 * @details Enumerated Spread Spectrum Module 00056 */ 00057 typedef enum { 00058 S_SPECTRUM_OFF = 0x00, 00059 S_SPECTRUM_ON 00060 } SpreadSpectrum_t; 00061 00062 /** 00063 * @brief Soft Start Control 00064 * @details Enumerated Start-Up Ramp Time for the Regulator 00065 */ 00066 typedef enum { 00067 S_START_8_ms = 0x00, 00068 S_START_4ms 00069 } SoftStart_t; 00070 00071 /** 00072 * @brief Peak Current Limit 00073 * @details Enumerated High Side DMOS Peak Current Limit 00074 */ 00075 typedef enum { 00076 I_PEAK_LIMIT_700_mA = 0x00, 00077 I_PEAK_LIMIT_800_mA, 00078 I_PEAK_LIMIT_900_mA, 00079 I_PEAK_LIMIT_1000_mA 00080 } PeakCurrent_t; 00081 00082 /** 00083 * @brief Enable Logic 00084 * @details Enumerated Enable Logic Control between EN_BIT and EN Pin 00085 */ 00086 typedef enum { 00087 EN_LOGICAL_OR = 0x00, 00088 EN_LOGICAL_AND 00089 } EnableLogic_t; 00090 00091 /** 00092 * @brief Enable Bit 00093 * @details Enumerated Enable for Regulator 00094 */ 00095 typedef enum { 00096 ENABLE = 0x00, 00097 DISABLE 00098 } Enable_t; 00099 00100 /** 00101 * MAX77756 constructor. 00102 * 00103 * @param sda mbed pin to use for SDA line of I2C interface. 00104 * @param scl mbed pin to use for SCL line of I2C interface. 00105 */ 00106 MAX77756(PinName sda, PinName scl); 00107 00108 /** 00109 * MAX77756 constructor. 00110 * 00111 * @param i2c I2C object to use. 00112 */ 00113 MAX77756(I2C *i2c); 00114 00115 /** 00116 * MAX44000 destructor. 00117 */ 00118 ~MAX77756(); 00119 00120 /** 00121 * @brief Initialize MAX77756 00122 */ 00123 int32_t init(); 00124 00125 /** 00126 * @brief Write Register 00127 * @details Writes data to MAX77756 register 00128 * 00129 * @param reg_addr Register to write 00130 * @param reg_data Data to write 00131 * @returns 0 if no errors, -1 if error. 00132 */ 00133 int32_t writeReg(MAX77756::registers_t reg_addr, char reg_data); 00134 00135 /** 00136 * @brief Read Register 00137 * @details Reads data from MAX77756 register 00138 * 00139 * @param reg_addr Register to read 00140 * @returns data if no errors, -1 if error. 00141 */ 00142 int32_t readReg(MAX77756::registers_t reg_addr); 00143 00144 /** 00145 * @brief Regultor Enable 00146 * @details Control EN_BIT to Enable/Disable Regulator 00147 * 00148 * @param enable value to control 00149 * @returns 0 if no errors, -1 if error. 00150 */ 00151 int32_t outEnable(MAX77756::Enable_t enable); 00152 00153 /** 00154 * @brief Set Output Voltage 00155 * @details Control Output Voltage. 00156 * 00157 * @param Output Voltage from 1500 to 7500 (mV) 00158 * @returns 0 if no errors, -1 if error. 00159 */ 00160 int32_t setVout(uint32_t outVoltage); 00161 00162 /** 00163 * @brief Config MAX77756 00164 * @details Set Spread-Spectrum, SoftStart, Peak Current and Enable Logic. 00165 * 00166 * @param Spread Spectrum Configuration Value 00167 * @param Soft Start Configuration Value 00168 * @param High Side DMOS Peak Current Configuration Value 00169 * @param Enable Logic Configuration Value 00170 * @returns 0 if no errors, -1 if error. 00171 */ 00172 int32_t config(MAX77756::SpreadSpectrum_t sspectrum, 00173 MAX77756::SoftStart_t sstart, 00174 MAX77756::PeakCurrent_t ipeak, 00175 MAX77756::EnableLogic_t enlogic); 00176 00177 private: 00178 00179 I2C *i2c_; 00180 bool i2c_owner; 00181 00182 }; 00183 00184 #endif /* _MAX77756_H_ */ 00185
Generated on Sat Jul 23 2022 23:45:09 by
1.7.2

Step-down DC-DC converter MAX77756