bsp disco lib

Dependents:   grove_stream_jpa_sd2 grove_stream_jpa_sd2 grove_stream_jpa_sd2-2 grove_stream_jpa_sd2-3

Committer:
38domo
Date:
Mon Aug 31 17:51:44 2020 +0000
Revision:
14:ed51426706bd
Parent:
7:fe313c53cdb5
bsp lib

Who changed what in which revision?

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