Clone

Dependents:   SignalProcessLab DigitalSignalAlgorithm_Lab DigitalSignal_Lab

Committer:
ngtkien
Date:
Mon Aug 26 16:33:09 2019 +0000
Revision:
0:fc80425b677a
Library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ngtkien 0:fc80425b677a 1 /**
ngtkien 0:fc80425b677a 2 ******************************************************************************
ngtkien 0:fc80425b677a 3 * @file idd.h
ngtkien 0:fc80425b677a 4 * @author MCD Application Team
ngtkien 0:fc80425b677a 5 * @version V4.0.1
ngtkien 0:fc80425b677a 6 * @date 21-July-2015
ngtkien 0:fc80425b677a 7 * @brief This file contains all the functions prototypes for the IDD driver.
ngtkien 0:fc80425b677a 8 ******************************************************************************
ngtkien 0:fc80425b677a 9 * @attention
ngtkien 0:fc80425b677a 10 *
ngtkien 0:fc80425b677a 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
ngtkien 0:fc80425b677a 12 *
ngtkien 0:fc80425b677a 13 * Redistribution and use in source and binary forms, with or without modification,
ngtkien 0:fc80425b677a 14 * are permitted provided that the following conditions are met:
ngtkien 0:fc80425b677a 15 * 1. Redistributions of source code must retain the above copyright notice,
ngtkien 0:fc80425b677a 16 * this list of conditions and the following disclaimer.
ngtkien 0:fc80425b677a 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
ngtkien 0:fc80425b677a 18 * this list of conditions and the following disclaimer in the documentation
ngtkien 0:fc80425b677a 19 * and/or other materials provided with the distribution.
ngtkien 0:fc80425b677a 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
ngtkien 0:fc80425b677a 21 * may be used to endorse or promote products derived from this software
ngtkien 0:fc80425b677a 22 * without specific prior written permission.
ngtkien 0:fc80425b677a 23 *
ngtkien 0:fc80425b677a 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
ngtkien 0:fc80425b677a 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ngtkien 0:fc80425b677a 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ngtkien 0:fc80425b677a 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
ngtkien 0:fc80425b677a 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
ngtkien 0:fc80425b677a 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
ngtkien 0:fc80425b677a 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
ngtkien 0:fc80425b677a 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ngtkien 0:fc80425b677a 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
ngtkien 0:fc80425b677a 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ngtkien 0:fc80425b677a 34 *
ngtkien 0:fc80425b677a 35 ******************************************************************************
ngtkien 0:fc80425b677a 36 */
ngtkien 0:fc80425b677a 37
ngtkien 0:fc80425b677a 38 /* Define to prevent recursive inclusion -------------------------------------*/
ngtkien 0:fc80425b677a 39 #ifndef __IDD_H
ngtkien 0:fc80425b677a 40 #define __IDD_H
ngtkien 0:fc80425b677a 41
ngtkien 0:fc80425b677a 42 #ifdef __cplusplus
ngtkien 0:fc80425b677a 43 extern "C" {
ngtkien 0:fc80425b677a 44 #endif
ngtkien 0:fc80425b677a 45
ngtkien 0:fc80425b677a 46 /* Includes ------------------------------------------------------------------*/
ngtkien 0:fc80425b677a 47 #include <stdint.h>
ngtkien 0:fc80425b677a 48
ngtkien 0:fc80425b677a 49 /** @addtogroup BSP
ngtkien 0:fc80425b677a 50 * @{
ngtkien 0:fc80425b677a 51 */
ngtkien 0:fc80425b677a 52
ngtkien 0:fc80425b677a 53 /** @addtogroup Components
ngtkien 0:fc80425b677a 54 * @{
ngtkien 0:fc80425b677a 55 */
ngtkien 0:fc80425b677a 56
ngtkien 0:fc80425b677a 57 /** @addtogroup IDD
ngtkien 0:fc80425b677a 58 * @{
ngtkien 0:fc80425b677a 59 */
ngtkien 0:fc80425b677a 60
ngtkien 0:fc80425b677a 61 /** @defgroup IDD_Exported_Types IDD Exported Types
ngtkien 0:fc80425b677a 62 * @{
ngtkien 0:fc80425b677a 63 */
ngtkien 0:fc80425b677a 64
ngtkien 0:fc80425b677a 65 /** @defgroup IDD_Config_structure IDD Configuration structure
ngtkien 0:fc80425b677a 66 * @{
ngtkien 0:fc80425b677a 67 */
ngtkien 0:fc80425b677a 68 typedef struct
ngtkien 0:fc80425b677a 69 {
ngtkien 0:fc80425b677a 70 uint16_t AmpliGain; /*!< Specifies ampli gain value
ngtkien 0:fc80425b677a 71 */
ngtkien 0:fc80425b677a 72 uint16_t VddMin; /*!< Specifies minimum MCU VDD can reach to protect MCU from reset
ngtkien 0:fc80425b677a 73 */
ngtkien 0:fc80425b677a 74 uint16_t Shunt0Value; /*!< Specifies value of Shunt 0 if existing
ngtkien 0:fc80425b677a 75 */
ngtkien 0:fc80425b677a 76 uint16_t Shunt1Value; /*!< Specifies value of Shunt 1 if existing
ngtkien 0:fc80425b677a 77 */
ngtkien 0:fc80425b677a 78 uint16_t Shunt2Value; /*!< Specifies value of Shunt 2 if existing
ngtkien 0:fc80425b677a 79 */
ngtkien 0:fc80425b677a 80 uint16_t Shunt3Value; /*!< Specifies value of Shunt 3 if existing
ngtkien 0:fc80425b677a 81 */
ngtkien 0:fc80425b677a 82 uint16_t Shunt4Value; /*!< Specifies value of Shunt 4 if existing
ngtkien 0:fc80425b677a 83 */
ngtkien 0:fc80425b677a 84 uint16_t Shunt0StabDelay; /*!< Specifies delay of Shunt 0 stabilization if existing
ngtkien 0:fc80425b677a 85 */
ngtkien 0:fc80425b677a 86 uint16_t Shunt1StabDelay; /*!< Specifies delay of Shunt 1 stabilization if existing
ngtkien 0:fc80425b677a 87 */
ngtkien 0:fc80425b677a 88 uint16_t Shunt2StabDelay; /*!< Specifies delay of Shunt 2 stabilization if existing
ngtkien 0:fc80425b677a 89 */
ngtkien 0:fc80425b677a 90 uint16_t Shunt3StabDelay; /*!< Specifies delay of Shunt 3 stabilization if existing
ngtkien 0:fc80425b677a 91 */
ngtkien 0:fc80425b677a 92 uint16_t Shunt4StabDelay; /*!< Specifies delay of Shunt 4 stabilization if existing
ngtkien 0:fc80425b677a 93 */
ngtkien 0:fc80425b677a 94 uint8_t ShuntNbOnBoard; /*!< Specifies number of shunts that are present on board
ngtkien 0:fc80425b677a 95 This parameter can be a value of @ref IDD_shunt_number */
ngtkien 0:fc80425b677a 96 uint8_t ShuntNbUsed; /*!< Specifies number of shunts used for measurement
ngtkien 0:fc80425b677a 97 This parameter can be a value of @ref IDD_shunt_number */
ngtkien 0:fc80425b677a 98 uint8_t VrefMeasurement; /*!< Specifies if Vref is automatically measured before each Idd measurement
ngtkien 0:fc80425b677a 99 This parameter can be a value of @ref IDD_Vref_Measurement */
ngtkien 0:fc80425b677a 100 uint8_t Calibration; /*!< Specifies if calibration is done before each Idd measurement
ngtkien 0:fc80425b677a 101 */
ngtkien 0:fc80425b677a 102 uint8_t PreDelayUnit; /*!< Specifies Pre delay unit
ngtkien 0:fc80425b677a 103 This parameter can be a value of @ref IDD_PreDelay */
ngtkien 0:fc80425b677a 104 uint8_t PreDelayValue; /*!< Specifies Pre delay value in selected unit
ngtkien 0:fc80425b677a 105 */
ngtkien 0:fc80425b677a 106 uint8_t MeasureNb; /*!< Specifies number of Measure to be performed
ngtkien 0:fc80425b677a 107 This parameter can be a value between 1 and 256 */
ngtkien 0:fc80425b677a 108 uint8_t DeltaDelayUnit; /*!< Specifies Delta delay unit
ngtkien 0:fc80425b677a 109 This parameter can be a value of @ref IDD_DeltaDelay */
ngtkien 0:fc80425b677a 110 uint8_t DeltaDelayValue; /*!< Specifies Delta delay between 2 measures
ngtkien 0:fc80425b677a 111 value can be between 1 and 128 */
ngtkien 0:fc80425b677a 112 }IDD_ConfigTypeDef;
ngtkien 0:fc80425b677a 113 /**
ngtkien 0:fc80425b677a 114 * @}
ngtkien 0:fc80425b677a 115 */
ngtkien 0:fc80425b677a 116
ngtkien 0:fc80425b677a 117 /** @defgroup IDD_Driver_structure IDD Driver structure
ngtkien 0:fc80425b677a 118 * @{
ngtkien 0:fc80425b677a 119 */
ngtkien 0:fc80425b677a 120 typedef struct
ngtkien 0:fc80425b677a 121 {
ngtkien 0:fc80425b677a 122 void (*Init)(uint16_t);
ngtkien 0:fc80425b677a 123 void (*DeInit)(uint16_t);
ngtkien 0:fc80425b677a 124 uint16_t (*ReadID)(uint16_t);
ngtkien 0:fc80425b677a 125 void (*Reset)(uint16_t);
ngtkien 0:fc80425b677a 126 void (*LowPower)(uint16_t);
ngtkien 0:fc80425b677a 127 void (*WakeUp)(uint16_t);
ngtkien 0:fc80425b677a 128 void (*Start)(uint16_t);
ngtkien 0:fc80425b677a 129 void (*Config)(uint16_t,IDD_ConfigTypeDef);
ngtkien 0:fc80425b677a 130 void (*GetValue)(uint16_t, uint32_t *);
ngtkien 0:fc80425b677a 131 void (*EnableIT)(uint16_t);
ngtkien 0:fc80425b677a 132 void (*ClearIT)(uint16_t);
ngtkien 0:fc80425b677a 133 uint8_t (*GetITStatus)(uint16_t);
ngtkien 0:fc80425b677a 134 void (*DisableIT)(uint16_t);
ngtkien 0:fc80425b677a 135 void (*ErrorEnableIT)(uint16_t);
ngtkien 0:fc80425b677a 136 void (*ErrorClearIT)(uint16_t);
ngtkien 0:fc80425b677a 137 uint8_t (*ErrorGetITStatus)(uint16_t);
ngtkien 0:fc80425b677a 138 void (*ErrorDisableIT)(uint16_t);
ngtkien 0:fc80425b677a 139 uint8_t (*ErrorGetSrc)(uint16_t);
ngtkien 0:fc80425b677a 140 uint8_t (*ErrorGetCode)(uint16_t);
ngtkien 0:fc80425b677a 141 }IDD_DrvTypeDef;
ngtkien 0:fc80425b677a 142 /**
ngtkien 0:fc80425b677a 143 * @}
ngtkien 0:fc80425b677a 144 */
ngtkien 0:fc80425b677a 145
ngtkien 0:fc80425b677a 146 /**
ngtkien 0:fc80425b677a 147 * @}
ngtkien 0:fc80425b677a 148 */
ngtkien 0:fc80425b677a 149
ngtkien 0:fc80425b677a 150 /**
ngtkien 0:fc80425b677a 151 * @}
ngtkien 0:fc80425b677a 152 */
ngtkien 0:fc80425b677a 153
ngtkien 0:fc80425b677a 154 /**
ngtkien 0:fc80425b677a 155 * @}
ngtkien 0:fc80425b677a 156 */
ngtkien 0:fc80425b677a 157
ngtkien 0:fc80425b677a 158 /**
ngtkien 0:fc80425b677a 159 * @}
ngtkien 0:fc80425b677a 160 */
ngtkien 0:fc80425b677a 161
ngtkien 0:fc80425b677a 162 #ifdef __cplusplus
ngtkien 0:fc80425b677a 163 }
ngtkien 0:fc80425b677a 164 #endif
ngtkien 0:fc80425b677a 165
ngtkien 0:fc80425b677a 166 #endif /* __IDD_H */
ngtkien 0:fc80425b677a 167
ngtkien 0:fc80425b677a 168 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/