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.
Dependents: HelloWorld_IPS02A1
Fork of X_NUCLEO_IPS02A1 by
IPS_def.h
00001 /** 00002 ******************************************************************************* 00003 * @file IPS.c 00004 * @author ADG 00005 * @version V1.0.1 00006 * @date 01-July-2016 00007 * @brief IPS (Intelligent Power Switch) module driver common interface. 00008 * 00009 ******************************************************************************* 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __IPS_H 00041 #define __IPS_H 00042 00043 #include <stdint.h> 00044 00045 00046 /* Exported types ------------------------------------------------------------*/ 00047 00048 /** 00049 * @brief IPS Init Structure definition 00050 */ 00051 00052 typedef struct 00053 { 00054 uint32_t Init; /* Inserted for sake of generality */ 00055 }IPS_InitTypeDef; 00056 00057 /** 00058 * @brief IPS State structures definition 00059 */ 00060 typedef enum 00061 { 00062 IPS_SUCCESS = 0x00, /*!< No error */ 00063 IPS_FAIL = 0x01, /*!< Error */ 00064 IPS_WRONG_CHANNEL = 0x02, /*!< Wrong IPS channel selected */ 00065 }IPS_StatusTypeDef; 00066 00067 /** 00068 * @brief IPS I/O error type structures definition 00069 */ 00070 typedef enum 00071 { 00072 IPS_IO_SUCCESS = 0x00, /*!< No error */ 00073 IPS_IO_FAIL = 0x01, /*!< Error */ 00074 IPS_ADC_INIT_FAILED = 0x02, /*!< ADC Init failed */ 00075 IPS_ADC_CAL_FAILED = 0x03, /*!< ADC Calibration failed */ 00076 IPS_ADC_CONF_CH_FAILED = 0x04, /*!< ADC Configure Channel failed */ 00077 IPS_ADC_START_FAILED = 0x05, /*!< ADC Start Conversion failed */ 00078 IPS_ADC_STOP_FAILED = 0x06, /*!< ADC Stop Conversion failed */ 00079 IPS_ADC_STATE_FAILED = 0x07, /*!< ADC Get State failed */ 00080 IPS_ADC_POLL_FAILED = 0x08 /*!< ADC Poll for conversion failed */ 00081 }IO_ErrorType; 00082 00083 /** 00084 * @brief IPS handle Structure definition 00085 */ 00086 typedef struct 00087 { 00088 uint8_t ipsChannel; /* IPS channel to get sense measurement*/ 00089 IPS_StatusTypeDef Status; /* IPS Status */ 00090 IO_ErrorType IO_Status; /* IO Status */ 00091 float SenseRawValue; /* V-Sense raw value */ 00092 float GNDSenseRawValue; /* GND Value */ 00093 float TemperatureValue; /* Chip Temperature */ 00094 float VccValue; /* Vcc Value */ 00095 float IValue; /* Current Value */ 00096 }IPS_HandleTypeDef; 00097 00098 /** 00099 * @brief IPS component id enumerator definition 00100 */ 00101 typedef enum 00102 { 00103 IPS_NONE_COMPONENT = 0, 00104 ISP_VPS2535H_COMPONENT = 1 00105 } IPS_ComponentTypeDef; 00106 00107 /** 00108 * @brief IPS driver extended structure definition 00109 */ 00110 typedef struct 00111 { 00112 IPS_ComponentTypeDef 00113 id; /* This id must be unique for each component belonging to this class that wants to extend common class */ 00114 void *pData; /* This pointer is specific for each component */ 00115 } IPS_DrvExtTypeDef; 00116 00117 /** 00118 * @brief Intelligent Power Switch driver structure definition 00119 */ 00120 typedef struct 00121 { 00122 IPS_StatusTypeDef (*Init)(IPS_HandleTypeDef *); 00123 IPS_StatusTypeDef (*Close)(void); 00124 IPS_StatusTypeDef (*ConfigureMuxChannel)(uint8_t, uint8_t); 00125 IPS_StatusTypeDef (*GetSenseChannelDiagnostic)(IPS_HandleTypeDef *); 00126 IPS_StatusTypeDef (*GetTemperatureChipSense)(IPS_HandleTypeDef *); 00127 IPS_StatusTypeDef (*GetVccSense)(IPS_HandleTypeDef *hips); 00128 IPS_StatusTypeDef (*GetCurrentSense)(IPS_HandleTypeDef *hips); 00129 IPS_DrvExtTypeDef *extData; 00130 }IPS_DrvTypeDef; 00131 00132 #endif /* __IPS_H */ 00133 00134 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 00135
Generated on Sat Jul 16 2022 04:19:39 by
1.7.2

X-NUCLEO-IPS02A1 - 24V Intelligent power switch expansion board