STM32L476G-Discovery board drivers V1.0.0

Dependents:   DiscoLogger DISCO_L476VG_GlassLCD DISCO_L476VG_MicrophoneRecorder DISCO_L476VG_UART ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l476g_discovery_idd.h Source File

stm32l476g_discovery_idd.h

Go to the documentation of this file.
00001 /**
00002  ******************************************************************************
00003  * @file    stm32l476g_discovery_idd.h
00004  * @author  MCD Application Team
00005  * @brief   Header file for stm32l476g_discovery_idd.c module.
00006  ******************************************************************************
00007  * @attention
00008  *
00009   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016  *
00017  ******************************************************************************
00018  */
00019 
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __STM32L476G_DISCOVERY_IDD_H
00022 #define __STM32L476G_DISCOVERY_IDD_H
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 /* Includes ------------------------------------------------------------------*/
00029 #include "stm32l476g_discovery.h"
00030 /* Include Idd measurement component driver */
00031 #include "../Components/mfxstm32l152/mfxstm32l152.h"
00032 
00033 /** @addtogroup BSP
00034   * @{
00035   */
00036 
00037 /** @addtogroup STM32L476G_DISCOVERY
00038   * @{
00039   */
00040 
00041 /** @addtogroup STM32L476G_DISCOVERY_IDD
00042   * @{
00043   */
00044 
00045 /** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Types  Exported Types
00046   * @{
00047   */
00048 
00049 /** @defgroup IDD_Config  IDD Config
00050   * @{
00051   */
00052 typedef enum
00053 {
00054   IDD_OK = 0,
00055   IDD_TIMEOUT = 1,
00056   IDD_ZERO_VALUE = 2,
00057   IDD_ERROR = 0xFF
00058 }
00059 IDD_StatusTypeDef;
00060 /**
00061   * @}
00062   */
00063 
00064 /**
00065   * @}
00066   */
00067 
00068 /** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Defines  Exported Defines
00069   * @{
00070   */
00071 /**
00072   * @brief  Shunt values on discovery in milli ohms
00073   */
00074 #define DISCOVERY_IDD_SHUNT0_VALUE                  ((uint16_t) 1000)     /*!< value in milliohm */
00075 #define DISCOVERY_IDD_SHUNT1_VALUE                  ((uint16_t) 24)       /*!< value in ohm */
00076 #define DISCOVERY_IDD_SHUNT2_VALUE                  ((uint16_t) 620)      /*!< value in ohm */
00077 #define DISCOVERY_IDD_SHUNT4_VALUE                  ((uint16_t) 10000)    /*!< value in ohm */
00078 
00079 /**
00080   * @brief  Shunt stabilization delay on discovery in milli ohms
00081   */
00082 #define DISCOVERY_IDD_SHUNT0_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00083 #define DISCOVERY_IDD_SHUNT1_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00084 #define DISCOVERY_IDD_SHUNT2_STABDELAY              ((uint8_t) 149)       /*!< value in millisec */
00085 #define DISCOVERY_IDD_SHUNT4_STABDELAY              ((uint8_t) 255)       /*!< value in millisec */
00086 
00087 /**
00088   * @brief  IDD Ampli Gain on discovery
00089   */
00090 #if defined(USE_STM32L476G_DISCO_REVC)
00091 #define DISCOVERY_IDD_AMPLI_GAIN                    ((uint16_t) 4967)     /*!< value is gain * 100 */
00092 #else
00093 #define DISCOVERY_IDD_AMPLI_GAIN                    ((uint16_t) 4990)     /*!< value is gain * 100 */
00094 #endif
00095 
00096 /**
00097   * @brief  IDD Vdd Min on discovery
00098   */
00099 #define DISCOVERY_IDD_VDD_MIN                       ((uint16_t) 2000)     /*!< value in millivolt */
00100 
00101 /**
00102   * @}
00103   */
00104 
00105 /* Exported functions --------------------------------------------------------*/
00106 /** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Functions  Exported Functions
00107   * @{
00108   */
00109 uint8_t   BSP_IDD_Init(void);
00110 void      BSP_IDD_DeInit(void);
00111 void      BSP_IDD_Reset(void);
00112 void      BSP_IDD_LowPower(void);
00113 void      BSP_IDD_WakeUp(void);
00114 void      BSP_IDD_StartMeasure(void);
00115 void      BSP_IDD_Config(IDD_ConfigTypeDef IddConfig);
00116 void      BSP_IDD_GetValue(uint32_t *IddValue);
00117 void      BSP_IDD_EnableIT(void);
00118 void      BSP_IDD_ClearIT(void);
00119 uint8_t   BSP_IDD_GetITStatus(void);
00120 void      BSP_IDD_DisableIT(void);
00121 uint8_t   BSP_IDD_ErrorGetCode(void);
00122 void      BSP_IDD_ErrorEnableIT(void);
00123 void      BSP_IDD_ErrorClearIT(void);
00124 uint8_t   BSP_IDD_ErrorGetITStatus(void);
00125 void      BSP_IDD_ErrorDisableIT(void);
00126 
00127 /**
00128   * @}
00129   */
00130 
00131 /**
00132   * @}
00133   */
00134 
00135 /**
00136   * @}
00137   */
00138 
00139 /**
00140   * @}
00141   */
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif /* __STM32L476G_DISCOVERY_IDD_H */
00148 
00149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/