Subversion Repositories FuelGauge

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/**
2
  ******************************************************************************
3
  * @file    stm32f0xx.h
4
  * @author  MCD Application Team
5
  * @brief   CMSIS STM32F0xx Device Peripheral Access Layer Header File.          
6
  *            
7
  *          The file is the unique include file that the application programmer
8
  *          is using in the C source code, usually in main.c. This file contains:
9
  *           - Configuration section that allows to select:
10
  *              - The STM32F0xx device used in the target application
11
  *              - To use or not the peripheral’s drivers in application code(i.e.
12
  *                code will be based on direct access to peripheral’s registers
13
  *                rather than drivers API), this option is controlled by
14
  *                "#define USE_HAL_DRIVER"
15
  *  
16
  ******************************************************************************
17
  * @attention
18
  *
19
  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
20
  * All rights reserved.</center></h2>
21
  *
22
  * This software component is licensed by ST under BSD 3-Clause license,
23
  * the "License"; You may not use this file except in compliance with the
24
  * License. You may obtain a copy of the License at:
25
  *                        opensource.org/licenses/BSD-3-Clause
26
  *
27
  ******************************************************************************
28
  */
29
 
30
/** @addtogroup CMSIS
31
  * @{
32
  */
33
 
34
/** @addtogroup stm32f0xx
35
  * @{
36
  */
37
 
38
#ifndef __STM32F0xx_H
39
#define __STM32F0xx_H
40
 
41
#ifdef __cplusplus
42
 extern "C" {
43
#endif /* __cplusplus */
44
 
45
/** @addtogroup Library_configuration_section
46
  * @{
47
  */
48
 
49
/**
50
  * @brief STM32 Family
51
  */
52
#if !defined  (STM32F0)
53
#define STM32F0
54
#endif /* STM32F0 */
55
 
56
/* Uncomment the line below according to the target STM32 device used in your
57
   application
58
  */
59
 
60
#if !defined (STM32F030x6) && !defined (STM32F030x8) &&                           \
61
    !defined (STM32F031x6) && !defined (STM32F038xx) &&                           \
62
    !defined (STM32F042x6) && !defined (STM32F048xx) && !defined (STM32F070x6) && \
63
    !defined (STM32F051x8) && !defined (STM32F058xx) &&                           \
64
    !defined (STM32F071xB) && !defined (STM32F072xB) && !defined (STM32F078xx) && !defined (STM32F070xB) && \
65
    !defined (STM32F091xC) && !defined (STM32F098xx) && !defined (STM32F030xC)
66
  /* #define STM32F030x6 */  /*!< STM32F030x4, STM32F030x6 Devices (STM32F030xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes)              */
67
  /* #define STM32F030x8 */  /*!< STM32F030x8 Devices (STM32F030xx microcontrollers where the Flash memory is 64 Kbytes)                                              */
68
  /* #define STM32F031x6 */  /*!< STM32F031x4, STM32F031x6 Devices (STM32F031xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes)              */
69
  /* #define STM32F038xx */  /*!< STM32F038xx Devices (STM32F038xx microcontrollers where the Flash memory is 32 Kbytes)                                              */
70
  /* #define STM32F042x6 */  /*!< STM32F042x4, STM32F042x6 Devices (STM32F042xx microcontrollers where the Flash memory ranges between 16 and 32 Kbytes)              */
71
  /* #define STM32F048x6 */  /*!< STM32F048xx Devices (STM32F042xx microcontrollers where the Flash memory is 32 Kbytes)                                              */
72
  /* #define STM32F051x8 */  /*!< STM32F051x4, STM32F051x6, STM32F051x8 Devices (STM32F051xx microcontrollers where the Flash memory ranges between 16 and 64 Kbytes) */
73
  /* #define STM32F058xx */  /*!< STM32F058xx Devices (STM32F058xx microcontrollers where the Flash memory is 64 Kbytes)                                              */
74
  /* #define STM32F070x6 */  /*!< STM32F070x6 Devices (STM32F070x6 microcontrollers where the Flash memory ranges between 16 and 32 Kbytes)                           */
75
  /* #define STM32F070xB */  /*!< STM32F070xB Devices (STM32F070xB microcontrollers where the Flash memory ranges between 64 and 128 Kbytes)                          */
76
  /* #define STM32F071xB */  /*!< STM32F071x8, STM32F071xB Devices (STM32F071xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes)             */
77
  /* #define STM32F072xB */  /*!< STM32F072x8, STM32F072xB Devices (STM32F072xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes)             */
78
  /* #define STM32F078xx */  /*!< STM32F078xx Devices (STM32F078xx microcontrollers where the Flash memory is 128 Kbytes)                                             */
79
  /* #define STM32F030xC */  /*!< STM32F030xC Devices (STM32F030xC microcontrollers where the Flash memory is 256 Kbytes)                                             */  
80
  /* #define STM32F091xC */  /*!< STM32F091xB, STM32F091xC Devices (STM32F091xx microcontrollers where the Flash memory ranges between 128 and 256 Kbytes)            */
81
  /* #define STM32F098xx */  /*!< STM32F098xx Devices (STM32F098xx microcontrollers where the Flash memory is 256 Kbytes)                                             */
82
#endif
83
 
84
/*  Tip: To avoid modifying this file each time you need to switch between these
85
        devices, you can define the device in your toolchain compiler preprocessor.
86
  */
87
#if !defined  (USE_HAL_DRIVER)
88
/**
89
 * @brief Comment the line below if you will not use the peripherals drivers.
90
   In this case, these drivers will not be included and the application code will
91
   be based on direct access to peripherals registers
92
   */
93
  /*#define USE_HAL_DRIVER */
94
#endif /* USE_HAL_DRIVER */
95
 
96
/**
97
  * @brief CMSIS Device version number V2.3.4
98
  */
99
#define __STM32F0_DEVICE_VERSION_MAIN   (0x02) /*!< [31:24] main version */
100
#define __STM32F0_DEVICE_VERSION_SUB1   (0x03) /*!< [23:16] sub1 version */
101
#define __STM32F0_DEVICE_VERSION_SUB2   (0x04) /*!< [15:8]  sub2 version */
102
#define __STM32F0_DEVICE_VERSION_RC     (0x00) /*!< [7:0]  release candidate */ 
103
#define __STM32F0_DEVICE_VERSION        ((__STM32F0_DEVICE_VERSION_MAIN << 24)\
104
                                        |(__STM32F0_DEVICE_VERSION_SUB1 << 16)\
105
                                        |(__STM32F0_DEVICE_VERSION_SUB2 << 8 )\
106
                                        |(__STM32F0_DEVICE_VERSION_RC))
107
 
108
/**
109
  * @}
110
  */
111
 
112
/** @addtogroup Device_Included
113
  * @{
114
  */
115
 
116
#if defined(STM32F030x6)
117
  #include "stm32f030x6.h"
118
#elif defined(STM32F030x8)
119
  #include "stm32f030x8.h"
120
#elif defined(STM32F031x6)
121
  #include "stm32f031x6.h"
122
#elif defined(STM32F038xx)
123
  #include "stm32f038xx.h"
124
#elif defined(STM32F042x6)
125
  #include "stm32f042x6.h"
126
#elif defined(STM32F048xx)
127
  #include "stm32f048xx.h"
128
#elif defined(STM32F051x8)
129
  #include "stm32f051x8.h"
130
#elif defined(STM32F058xx)
131
  #include "stm32f058xx.h"
132
#elif defined(STM32F070x6)
133
  #include "stm32f070x6.h"
134
#elif defined(STM32F070xB)
135
  #include "stm32f070xb.h"
136
#elif defined(STM32F071xB)
137
  #include "stm32f071xb.h"
138
#elif defined(STM32F072xB)
139
  #include "stm32f072xb.h"
140
#elif defined(STM32F078xx)
141
  #include "stm32f078xx.h"
142
#elif defined(STM32F091xC)
143
  #include "stm32f091xc.h"
144
#elif defined(STM32F098xx)
145
  #include "stm32f098xx.h"
146
#elif defined(STM32F030xC)
147
  #include "stm32f030xc.h"    
148
#else
149
 #error "Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)"
150
#endif
151
 
152
/**
153
  * @}
154
  */
155
 
156
/** @addtogroup Exported_types
157
  * @{
158
  */
159
typedef enum
160
{
161
  RESET = 0U,
162
  SET = !RESET
163
} FlagStatus, ITStatus;
164
 
165
typedef enum
166
{
167
  DISABLE = 0U,
168
  ENABLE = !DISABLE
169
} FunctionalState;
170
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
171
 
172
typedef enum
173
{
174
  SUCCESS = 0U,
175
  ERROR = !SUCCESS
176
} ErrorStatus;
177
 
178
/**
179
  * @}
180
  */
181
 
182
 
183
/** @addtogroup Exported_macros
184
  * @{
185
  */
186
#define SET_BIT(REG, BIT)     ((REG) |= (BIT))
187
 
188
#define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
189
 
190
#define READ_BIT(REG, BIT)    ((REG) & (BIT))
191
 
192
#define CLEAR_REG(REG)        ((REG) = (0x0))
193
 
194
#define WRITE_REG(REG, VAL)   ((REG) = (VAL))
195
 
196
#define READ_REG(REG)         ((REG))
197
 
198
#define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
199
 
200
 
201
/**
202
  * @}
203
  */
204
 
205
#if defined (USE_HAL_DRIVER)
206
 #include "stm32f0xx_hal.h"
207
#endif /* USE_HAL_DRIVER */
208
 
209
 
210
#ifdef __cplusplus
211
}
212
#endif /* __cplusplus */
213
 
214
#endif /* __STM32F0xx_H */
215
/**
216
  * @}
217
  */
218
 
219
/**
220
  * @}
221
  */
222
 
223
 
224
 
225
 
226
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/