Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Drivers/BSP/STM32L476G-Discovery/stm32l476g_discovery_idd.h@1:917af0ca86df, 2017-07-05 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Wed Jul 05 10:51:49 2017 +0200
- Revision:
- 1:917af0ca86df
- Child:
- 3:4c7d003a8259
Update with STM32Cube_FW_L4_V1.8.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jerome Coutant
1:917af0ca86df
|
1
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
2
|
******************************************************************************
|
|
Jerome Coutant
1:917af0ca86df
|
3
|
* @file stm32l476g_discovery_idd.h
|
|
Jerome Coutant
1:917af0ca86df
|
4
|
* @author MCD Application Team
|
|
Jerome Coutant
1:917af0ca86df
|
5
|
* @version V2.0.0
|
|
Jerome Coutant
1:917af0ca86df
|
6
|
* @date 07-April-2017
|
|
Jerome Coutant
1:917af0ca86df
|
7
|
* @brief Header file for stm32l476g_discovery_idd.c module.
|
|
Jerome Coutant
1:917af0ca86df
|
8
|
******************************************************************************
|
|
Jerome Coutant
1:917af0ca86df
|
9
|
* @attention
|
|
Jerome Coutant
1:917af0ca86df
|
10
|
*
|
|
Jerome Coutant
1:917af0ca86df
|
11
|
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
|
Jerome Coutant
1:917af0ca86df
|
12
|
*
|
|
Jerome Coutant
1:917af0ca86df
|
13
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
Jerome Coutant
1:917af0ca86df
|
14
|
* are permitted provided that the following conditions are met:
|
|
Jerome Coutant
1:917af0ca86df
|
15
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
Jerome Coutant
1:917af0ca86df
|
16
|
* this list of conditions and the following disclaimer.
|
|
Jerome Coutant
1:917af0ca86df
|
17
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
Jerome Coutant
1:917af0ca86df
|
18
|
* this list of conditions and the following disclaimer in the documentation
|
|
Jerome Coutant
1:917af0ca86df
|
19
|
* and/or other materials provided with the distribution.
|
|
Jerome Coutant
1:917af0ca86df
|
20
|
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
|
Jerome Coutant
1:917af0ca86df
|
21
|
* may be used to endorse or promote products derived from this software
|
|
Jerome Coutant
1:917af0ca86df
|
22
|
* without specific prior written permission.
|
|
Jerome Coutant
1:917af0ca86df
|
23
|
*
|
|
Jerome Coutant
1:917af0ca86df
|
24
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Jerome Coutant
1:917af0ca86df
|
25
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Jerome Coutant
1:917af0ca86df
|
26
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Jerome Coutant
1:917af0ca86df
|
27
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
Jerome Coutant
1:917af0ca86df
|
28
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Jerome Coutant
1:917af0ca86df
|
29
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Jerome Coutant
1:917af0ca86df
|
30
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Jerome Coutant
1:917af0ca86df
|
31
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Jerome Coutant
1:917af0ca86df
|
32
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Jerome Coutant
1:917af0ca86df
|
33
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Jerome Coutant
1:917af0ca86df
|
34
|
*
|
|
Jerome Coutant
1:917af0ca86df
|
35
|
******************************************************************************
|
|
Jerome Coutant
1:917af0ca86df
|
36
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
37
|
|
|
Jerome Coutant
1:917af0ca86df
|
38
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
Jerome Coutant
1:917af0ca86df
|
39
|
#ifndef __STM32L476G_DISCOVERY_IDD_H
|
|
Jerome Coutant
1:917af0ca86df
|
40
|
#define __STM32L476G_DISCOVERY_IDD_H
|
|
Jerome Coutant
1:917af0ca86df
|
41
|
|
|
Jerome Coutant
1:917af0ca86df
|
42
|
#ifdef __cplusplus
|
|
Jerome Coutant
1:917af0ca86df
|
43
|
extern "C" {
|
|
Jerome Coutant
1:917af0ca86df
|
44
|
#endif
|
|
Jerome Coutant
1:917af0ca86df
|
45
|
|
|
Jerome Coutant
1:917af0ca86df
|
46
|
/* Includes ------------------------------------------------------------------*/
|
|
Jerome Coutant
1:917af0ca86df
|
47
|
#include "stm32l476g_discovery.h"
|
|
Jerome Coutant
1:917af0ca86df
|
48
|
/* Include Idd measurement component driver */
|
|
Jerome Coutant
1:917af0ca86df
|
49
|
#include "../Components/mfxstm32l152/mfxstm32l152.h"
|
|
Jerome Coutant
1:917af0ca86df
|
50
|
|
|
Jerome Coutant
1:917af0ca86df
|
51
|
/** @addtogroup BSP
|
|
Jerome Coutant
1:917af0ca86df
|
52
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
53
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
54
|
|
|
Jerome Coutant
1:917af0ca86df
|
55
|
/** @addtogroup STM32L476G_DISCOVERY
|
|
Jerome Coutant
1:917af0ca86df
|
56
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
57
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
58
|
|
|
Jerome Coutant
1:917af0ca86df
|
59
|
/** @addtogroup STM32L476G_DISCOVERY_IDD
|
|
Jerome Coutant
1:917af0ca86df
|
60
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
61
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
62
|
|
|
Jerome Coutant
1:917af0ca86df
|
63
|
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Types Exported Types
|
|
Jerome Coutant
1:917af0ca86df
|
64
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
65
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
66
|
|
|
Jerome Coutant
1:917af0ca86df
|
67
|
/** @defgroup IDD_Config IDD Config
|
|
Jerome Coutant
1:917af0ca86df
|
68
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
69
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
70
|
typedef enum
|
|
Jerome Coutant
1:917af0ca86df
|
71
|
{
|
|
Jerome Coutant
1:917af0ca86df
|
72
|
IDD_OK = 0,
|
|
Jerome Coutant
1:917af0ca86df
|
73
|
IDD_TIMEOUT = 1,
|
|
Jerome Coutant
1:917af0ca86df
|
74
|
IDD_ZERO_VALUE = 2,
|
|
Jerome Coutant
1:917af0ca86df
|
75
|
IDD_ERROR = 0xFF
|
|
Jerome Coutant
1:917af0ca86df
|
76
|
}
|
|
Jerome Coutant
1:917af0ca86df
|
77
|
IDD_StatusTypeDef;
|
|
Jerome Coutant
1:917af0ca86df
|
78
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
79
|
* @}
|
|
Jerome Coutant
1:917af0ca86df
|
80
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
81
|
|
|
Jerome Coutant
1:917af0ca86df
|
82
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
83
|
* @}
|
|
Jerome Coutant
1:917af0ca86df
|
84
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
85
|
|
|
Jerome Coutant
1:917af0ca86df
|
86
|
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Defines Exported Defines
|
|
Jerome Coutant
1:917af0ca86df
|
87
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
88
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
89
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
90
|
* @brief Shunt values on discovery in milli ohms
|
|
Jerome Coutant
1:917af0ca86df
|
91
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
92
|
#define DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000) /*!< value in milliohm */
|
|
Jerome Coutant
1:917af0ca86df
|
93
|
#define DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24) /*!< value in ohm */
|
|
Jerome Coutant
1:917af0ca86df
|
94
|
#define DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620) /*!< value in ohm */
|
|
Jerome Coutant
1:917af0ca86df
|
95
|
#define DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000) /*!< value in ohm */
|
|
Jerome Coutant
1:917af0ca86df
|
96
|
|
|
Jerome Coutant
1:917af0ca86df
|
97
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
98
|
* @brief Shunt stabilization delay on discovery in milli ohms
|
|
Jerome Coutant
1:917af0ca86df
|
99
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
100
|
#define DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149) /*!< value in millisec */
|
|
Jerome Coutant
1:917af0ca86df
|
101
|
#define DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149) /*!< value in millisec */
|
|
Jerome Coutant
1:917af0ca86df
|
102
|
#define DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149) /*!< value in millisec */
|
|
Jerome Coutant
1:917af0ca86df
|
103
|
#define DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255) /*!< value in millisec */
|
|
Jerome Coutant
1:917af0ca86df
|
104
|
|
|
Jerome Coutant
1:917af0ca86df
|
105
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
106
|
* @brief IDD Ampli Gain on discovery
|
|
Jerome Coutant
1:917af0ca86df
|
107
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
108
|
#if defined(USE_STM32L476G_DISCO_REVC)
|
|
Jerome Coutant
1:917af0ca86df
|
109
|
#define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967) /*!< value is gain * 100 */
|
|
Jerome Coutant
1:917af0ca86df
|
110
|
#else
|
|
Jerome Coutant
1:917af0ca86df
|
111
|
#define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4990) /*!< value is gain * 100 */
|
|
Jerome Coutant
1:917af0ca86df
|
112
|
#endif
|
|
Jerome Coutant
1:917af0ca86df
|
113
|
|
|
Jerome Coutant
1:917af0ca86df
|
114
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
115
|
* @brief IDD Vdd Min on discovery
|
|
Jerome Coutant
1:917af0ca86df
|
116
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
117
|
#define DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000) /*!< value in millivolt */
|
|
Jerome Coutant
1:917af0ca86df
|
118
|
|
|
Jerome Coutant
1:917af0ca86df
|
119
|
/**
|
|
Jerome Coutant
1:917af0ca86df
|
120
|
* @}
|
|
Jerome Coutant
1:917af0ca86df
|
121
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
122
|
|
|
Jerome Coutant
1:917af0ca86df
|
123
|
/* Exported functions --------------------------------------------------------*/
|
|
Jerome Coutant
1:917af0ca86df
|
124
|
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Functions Exported Functions
|
|
Jerome Coutant
1:917af0ca86df
|
125
|
* @{
|
|
Jerome Coutant
1:917af0ca86df
|
126
|
*/
|
|
Jerome Coutant
1:917af0ca86df
|
127
|
uint8_t BSP_IDD_Init(void);
|
|
Jerome Coutant
1:917af0ca86df
|
128
|
void BSP_IDD_DeInit(void);
|
|
Jerome Coutant
1:917af0ca86df
|
129
|
void BSP_IDD_Reset(void);
|
|
Jerome Coutant
1:917af0ca86df
|
130
|
void BSP_IDD_LowPower(void);
|
|
Jerome Coutant
1:917af0ca86df
|
131
|
void BSP_IDD_WakeUp(void);
|
|
Jerome Coutant
1:917af0ca86df
|
132
|
void BSP_IDD_StartMeasure(void);
|
|
Jerome Coutant
1:917af0ca86df
|
133
|
void BSP_IDD_Config(IDD_ConfigTypeDef IddConfig);
|
|
Jerome Coutant
1:917af0ca86df
|
134
|
void BSP_IDD_GetValue(uint32_t *IddValue);
|
|
Jerome Coutant
1:917af0ca86df
|
135
|
void BSP_IDD_EnableIT(void);
|
|
Jerome Coutant
1:917af0ca86df
|
136
|
void BSP_IDD_ClearIT(void);
|
|
Jerome Coutant
1:917af0ca86df
|
137
|
uint8_t BSP_IDD_GetITStatus(void);
|
|
Jerome Coutant
1:917af0ca86df
|
138
|
void BSP_IDD_DisableIT(void);
|
|
Jerome Coutant
1:917af0ca86df
|
139
|
uint8_t BSP_IDD_ErrorGetCode(void);
|
|
Jerome Coutant
1:917af0ca86df
|
140
|
void BSP_IDD_ErrorEnableIT(void);
|
|
Jerome Coutant
1:917af0ca86df
|
141
|
void BSP_IDD_ErrorClearIT(void);
|
|
Jerome Coutant
1:917af0ca86df
|
142
|
uint8_t BSP_IDD_ErrorGetITStatus(void);
|
|
Jerome Coutant
1:917af0ca86df
|
143
|
void BSP_IDD_ErrorDisableIT(void);
|
|
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
|
|
|
Jerome Coutant
1:917af0ca86df
|
161
|
#ifdef __cplusplus
|
|
Jerome Coutant
1:917af0ca86df
|
162
|
}
|
|
Jerome Coutant
1:917af0ca86df
|
163
|
#endif
|
|
Jerome Coutant
1:917af0ca86df
|
164
|
|
|
Jerome Coutant
1:917af0ca86df
|
165
|
#endif /* __STM32L476G_DISCOVERY_IDD_H */
|
|
Jerome Coutant
1:917af0ca86df
|
166
|
|
|
Jerome Coutant
1:917af0ca86df
|
167
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|