-
Notifications
You must be signed in to change notification settings - Fork 0
/
stm32l476g_discovery_idd.h
148 lines (125 loc) · 3.84 KB
/
stm32l476g_discovery_idd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
******************************************************************************
* @file stm32l476g_discovery_idd.h
* @author MCD Application Team
* @brief Header file for stm32l476g_discovery_idd.c module.
******************************************************************************
* @attention
*
* Copyright (c) 2016 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32L476G_DISCOVERY_IDD_H
#define __STM32L476G_DISCOVERY_IDD_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32l476g_discovery.h"
/* Include Idd measurement component driver */
#include "../Components/mfxstm32l152/mfxstm32l152.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup STM32L476G_DISCOVERY
* @{
*/
/** @addtogroup STM32L476G_DISCOVERY_IDD
* @{
*/
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Types Exported Types
* @{
*/
/** @defgroup IDD_Config IDD Config
* @{
*/
typedef enum
{
IDD_OK = 0,
IDD_TIMEOUT = 1,
IDD_ZERO_VALUE = 2,
IDD_ERROR = 0xFF
}
IDD_StatusTypeDef;
/**
* @}
*/
/**
* @}
*/
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Defines Exported Defines
* @{
*/
/**
* @brief Shunt values on discovery in milli ohms
*/
#define DISCOVERY_IDD_SHUNT0_VALUE ((uint16_t) 1000) /*!< value in milliohm */
#define DISCOVERY_IDD_SHUNT1_VALUE ((uint16_t) 24) /*!< value in ohm */
#define DISCOVERY_IDD_SHUNT2_VALUE ((uint16_t) 620) /*!< value in ohm */
#define DISCOVERY_IDD_SHUNT4_VALUE ((uint16_t) 10000) /*!< value in ohm */
/**
* @brief Shunt stabilization delay on discovery in milli ohms
*/
#define DISCOVERY_IDD_SHUNT0_STABDELAY ((uint8_t) 149) /*!< value in millisec */
#define DISCOVERY_IDD_SHUNT1_STABDELAY ((uint8_t) 149) /*!< value in millisec */
#define DISCOVERY_IDD_SHUNT2_STABDELAY ((uint8_t) 149) /*!< value in millisec */
#define DISCOVERY_IDD_SHUNT4_STABDELAY ((uint8_t) 255) /*!< value in millisec */
/**
* @brief IDD Ampli Gain on discovery
*/
#if defined(USE_STM32L476G_DISCO_REVC)
#define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4967) /*!< value is gain * 100 */
#else
#define DISCOVERY_IDD_AMPLI_GAIN ((uint16_t) 4990) /*!< value is gain * 100 */
#endif
/**
* @brief IDD Vdd Min on discovery
*/
#define DISCOVERY_IDD_VDD_MIN ((uint16_t) 2000) /*!< value in millivolt */
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup STM32L476G_DISCOVERY_IDD_Exported_Functions Exported Functions
* @{
*/
uint8_t BSP_IDD_Init(void);
void BSP_IDD_DeInit(void);
void BSP_IDD_Reset(void);
void BSP_IDD_LowPower(void);
void BSP_IDD_WakeUp(void);
void BSP_IDD_StartMeasure(void);
void BSP_IDD_Config(IDD_ConfigTypeDef IddConfig);
void BSP_IDD_GetValue(uint32_t *IddValue);
void BSP_IDD_EnableIT(void);
void BSP_IDD_ClearIT(void);
uint8_t BSP_IDD_GetITStatus(void);
void BSP_IDD_DisableIT(void);
uint8_t BSP_IDD_ErrorGetCode(void);
void BSP_IDD_ErrorEnableIT(void);
void BSP_IDD_ErrorClearIT(void);
uint8_t BSP_IDD_ErrorGetITStatus(void);
void BSP_IDD_ErrorDisableIT(void);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32L476G_DISCOVERY_IDD_H */