BSP driver for DISCO_L496AG

Dependents:   DISCO_L496AG-LCD-prova_1 DISCO_L496AG-LCD-prova_2 DISCO_L496AG-LCD-demo DISCO_L496AG-SRAM-demo

Committer:
Jerome Coutant
Date:
Wed Nov 20 16:48:24 2019 +0100
Revision:
2:106c7b82e064
Parent:
0:d83f1c8ca282
Update BSP files with CubeL4 V1.14.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:d83f1c8ca282 1 /**
bcostm 0:d83f1c8ca282 2 ******************************************************************************
bcostm 0:d83f1c8ca282 3 * @file stm32l496g_discovery_idd.h
bcostm 0:d83f1c8ca282 4 * @author MCD Application Team
bcostm 0:d83f1c8ca282 5 * @brief Header file for stm32l496g_discovery_idd.c module.
bcostm 0:d83f1c8ca282 6 ******************************************************************************
bcostm 0:d83f1c8ca282 7 * @attention
bcostm 0:d83f1c8ca282 8 *
Jerome Coutant 2:106c7b82e064 9 * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
Jerome Coutant 2:106c7b82e064 10 * All rights reserved.</center></h2>
bcostm 0:d83f1c8ca282 11 *
Jerome Coutant 2:106c7b82e064 12 * This software component is licensed by ST under BSD 3-Clause license,
Jerome Coutant 2:106c7b82e064 13 * the "License"; You may not use this file except in compliance with the
Jerome Coutant 2:106c7b82e064 14 * License. You may obtain a copy of the License at:
Jerome Coutant 2:106c7b82e064 15 * opensource.org/licenses/BSD-3-Clause
bcostm 0:d83f1c8ca282 16 *
bcostm 0:d83f1c8ca282 17 ******************************************************************************
bcostm 0:d83f1c8ca282 18 */
bcostm 0:d83f1c8ca282 19
bcostm 0:d83f1c8ca282 20 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 0:d83f1c8ca282 21 #ifndef __STM32L496G_DISCOVERY_IDD_H
bcostm 0:d83f1c8ca282 22 #define __STM32L496G_DISCOVERY_IDD_H
bcostm 0:d83f1c8ca282 23
bcostm 0:d83f1c8ca282 24 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 25 extern "C" {
bcostm 0:d83f1c8ca282 26 #endif
bcostm 0:d83f1c8ca282 27
bcostm 0:d83f1c8ca282 28 /* Includes ------------------------------------------------------------------*/
bcostm 0:d83f1c8ca282 29 #include "stm32l496g_discovery.h"
bcostm 0:d83f1c8ca282 30 /* Include Idd measurement component driver */
bcostm 0:d83f1c8ca282 31 #include "../Components/mfxstm32l152/mfxstm32l152.h"
bcostm 0:d83f1c8ca282 32
bcostm 0:d83f1c8ca282 33 /** @addtogroup BSP
bcostm 0:d83f1c8ca282 34 * @{
bcostm 0:d83f1c8ca282 35 */
bcostm 0:d83f1c8ca282 36
bcostm 0:d83f1c8ca282 37 /** @addtogroup STM32L496G_DISCOVERY
bcostm 0:d83f1c8ca282 38 * @{
bcostm 0:d83f1c8ca282 39 */
bcostm 0:d83f1c8ca282 40
bcostm 0:d83f1c8ca282 41 /** @addtogroup STM32L496G_DISCOVERY_IDD
bcostm 0:d83f1c8ca282 42 * @{
bcostm 0:d83f1c8ca282 43 */
bcostm 0:d83f1c8ca282 44
bcostm 0:d83f1c8ca282 45 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Types Exported Types
bcostm 0:d83f1c8ca282 46 * @{
bcostm 0:d83f1c8ca282 47 */
bcostm 0:d83f1c8ca282 48
bcostm 0:d83f1c8ca282 49 /** @defgroup IDD_Config IDD Config
bcostm 0:d83f1c8ca282 50 * @{
bcostm 0:d83f1c8ca282 51 */
bcostm 0:d83f1c8ca282 52 typedef enum
bcostm 0:d83f1c8ca282 53 {
bcostm 0:d83f1c8ca282 54 IDD_OK = 0,
bcostm 0:d83f1c8ca282 55 IDD_TIMEOUT = 1,
bcostm 0:d83f1c8ca282 56 IDD_ZERO_VALUE = 2,
bcostm 0:d83f1c8ca282 57 IDD_ERROR = 0xFF
bcostm 0:d83f1c8ca282 58 }
bcostm 0:d83f1c8ca282 59 IDD_StatusTypeDef;
bcostm 0:d83f1c8ca282 60 /**
bcostm 0:d83f1c8ca282 61 * @}
bcostm 0:d83f1c8ca282 62 */
bcostm 0:d83f1c8ca282 63
bcostm 0:d83f1c8ca282 64 /**
bcostm 0:d83f1c8ca282 65 * @}
bcostm 0:d83f1c8ca282 66 */
bcostm 0:d83f1c8ca282 67
bcostm 0:d83f1c8ca282 68 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Defines Exported Defines
bcostm 0:d83f1c8ca282 69 * @{
bcostm 0:d83f1c8ca282 70 */
bcostm 0:d83f1c8ca282 71 /**
bcostm 0:d83f1c8ca282 72 * @brief Shunt values on discovery in milli ohms
bcostm 0:d83f1c8ca282 73 */
bcostm 0:d83f1c8ca282 74 #define DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000) /*!< value in milliohm */
bcostm 0:d83f1c8ca282 75 #define DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24) /*!< value in ohm */
bcostm 0:d83f1c8ca282 76 #define DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620) /*!< value in ohm */
bcostm 0:d83f1c8ca282 77 #define DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000) /*!< value in ohm */
bcostm 0:d83f1c8ca282 78
bcostm 0:d83f1c8ca282 79 /**
bcostm 0:d83f1c8ca282 80 * @brief Shunt stabilization delay on discovery in milli ohms
bcostm 0:d83f1c8ca282 81 */
bcostm 0:d83f1c8ca282 82 #define DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149) /*!< value in millisec */
bcostm 0:d83f1c8ca282 83 #define DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149) /*!< value in millisec */
bcostm 0:d83f1c8ca282 84 #define DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149) /*!< value in millisec */
bcostm 0:d83f1c8ca282 85 #define DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255) /*!< value in millisec */
bcostm 0:d83f1c8ca282 86
bcostm 0:d83f1c8ca282 87 /**
bcostm 0:d83f1c8ca282 88 * @brief IDD Ampli Gain on discovery
bcostm 0:d83f1c8ca282 89 */
bcostm 0:d83f1c8ca282 90 #define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967) /*!< value is gain * 100 */
bcostm 0:d83f1c8ca282 91
bcostm 0:d83f1c8ca282 92 /**
bcostm 0:d83f1c8ca282 93 * @brief IDD Vdd Min on discovery
bcostm 0:d83f1c8ca282 94 */
bcostm 0:d83f1c8ca282 95 #define DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000) /*!< value in millivolt */
bcostm 0:d83f1c8ca282 96
bcostm 0:d83f1c8ca282 97 /**
bcostm 0:d83f1c8ca282 98 * @}
bcostm 0:d83f1c8ca282 99 */
bcostm 0:d83f1c8ca282 100
bcostm 0:d83f1c8ca282 101 /* Exported functions --------------------------------------------------------*/
bcostm 0:d83f1c8ca282 102 /** @defgroup STM32L496G_DISCOVERY_IDD_Exported_Functions Exported Functions
bcostm 0:d83f1c8ca282 103 * @{
bcostm 0:d83f1c8ca282 104 */
bcostm 0:d83f1c8ca282 105 uint8_t BSP_IDD_Init(void);
bcostm 0:d83f1c8ca282 106 void BSP_IDD_DeInit(void);
bcostm 0:d83f1c8ca282 107 void BSP_IDD_Reset(void);
bcostm 0:d83f1c8ca282 108 void BSP_IDD_LowPower(void);
bcostm 0:d83f1c8ca282 109 void BSP_IDD_WakeUp(void);
bcostm 0:d83f1c8ca282 110 void BSP_IDD_StartMeasure(void);
bcostm 0:d83f1c8ca282 111 void BSP_IDD_Config(IDD_ConfigTypeDef IddConfig);
bcostm 0:d83f1c8ca282 112 void BSP_IDD_GetValue(uint32_t *IddValue);
bcostm 0:d83f1c8ca282 113 void BSP_IDD_EnableIT(void);
bcostm 0:d83f1c8ca282 114 void BSP_IDD_ClearIT(void);
bcostm 0:d83f1c8ca282 115 uint8_t BSP_IDD_GetITStatus(void);
bcostm 0:d83f1c8ca282 116 void BSP_IDD_DisableIT(void);
bcostm 0:d83f1c8ca282 117 uint8_t BSP_IDD_ErrorGetCode(void);
bcostm 0:d83f1c8ca282 118 void BSP_IDD_ErrorEnableIT(void);
bcostm 0:d83f1c8ca282 119 void BSP_IDD_ErrorClearIT(void);
bcostm 0:d83f1c8ca282 120 uint8_t BSP_IDD_ErrorGetITStatus(void);
bcostm 0:d83f1c8ca282 121 void BSP_IDD_ErrorDisableIT(void);
bcostm 0:d83f1c8ca282 122
bcostm 0:d83f1c8ca282 123 /**
bcostm 0:d83f1c8ca282 124 * @}
bcostm 0:d83f1c8ca282 125 */
bcostm 0:d83f1c8ca282 126
bcostm 0:d83f1c8ca282 127 /**
bcostm 0:d83f1c8ca282 128 * @}
bcostm 0:d83f1c8ca282 129 */
bcostm 0:d83f1c8ca282 130
bcostm 0:d83f1c8ca282 131 /**
bcostm 0:d83f1c8ca282 132 * @}
bcostm 0:d83f1c8ca282 133 */
bcostm 0:d83f1c8ca282 134
bcostm 0:d83f1c8ca282 135 /**
bcostm 0:d83f1c8ca282 136 * @}
bcostm 0:d83f1c8ca282 137 */
bcostm 0:d83f1c8ca282 138
bcostm 0:d83f1c8ca282 139 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 140 }
bcostm 0:d83f1c8ca282 141 #endif
bcostm 0:d83f1c8ca282 142
bcostm 0:d83f1c8ca282 143 #endif /* __STM32L496G_DISCOVERY_IDD_H */
bcostm 0:d83f1c8ca282 144
bcostm 0:d83f1c8ca282 145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/