STM32L476G-Discovery board drivers V1.0.0

Dependents:   DiscoLogger DISCO_L476VG_GlassLCD DISCO_L476VG_MicrophoneRecorder DISCO_L476VG_UART ... more

Committer:
bcostm
Date:
Wed Jan 17 14:57:52 2018 +0100
Revision:
3:4c7d003a8259
Parent:
1:917af0ca86df
Child:
5:4943b15cce9f
Update BSP files with CubeL4 V1.11.0

Who changed what in which revision?

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