File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 50
50
#include "analog.h"
51
51
#include "timer.h"
52
52
#include "PinAF_STM32F1.h"
53
+ // Specific defines in the variant
54
+ #include "variant.h"
53
55
54
56
#ifdef __cplusplus
55
57
extern "C" {
69
71
/** @addtogroup STM32F4xx_System_Private_Defines
70
72
* @{
71
73
*/
74
+ #ifndef SAMPLINGTIME
72
75
#if defined(ADC_SAMPLETIME_15CYCLES )
73
76
#define SAMPLINGTIME ADC_SAMPLETIME_15CYCLES;
74
77
#elif defined(ADC_SAMPLETIME_13CYCLES_5 )
82
85
#else
83
86
#error "ADC SAMPLINGTIME could not be defined"
84
87
#endif
88
+ #endif
85
89
86
90
#ifndef STM32F1xx
87
91
#ifdef ADC_CLOCK_SYNC_PCLK_DIV2
Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ PC_0,
132
132
PC_1,
133
133
PC_2,
134
134
PC_3,
135
+ ADC_VREF,
136
+ ADC_VTEMP,
137
+ ADC_VBAT,
135
138
};
136
139
137
140
#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -148,14 +148,17 @@ PC0_2,
148
148
PC1_2 ,
149
149
PC2_2 ,
150
150
PC3_2 ,
151
+ VREF ,
152
+ VTEMP ,
153
+ VBAT ,
151
154
152
155
PEND
153
156
};
154
157
155
158
// This must be a literal with the same value as PEND
156
159
// It is used with preprocessor tests (e.g. #if NUM_DIGITAL_PINS > 3)
157
160
// so an enum will not work.
158
- #define NUM_DIGITAL_PINS 92
161
+ #define NUM_DIGITAL_PINS 95
159
162
160
163
// Allow to define Arduino style alias for analog input pin number --> Ax
161
164
// All pins are digital, analog inputs are a subset of digital pins
@@ -173,6 +176,9 @@ PC3_2,
173
176
// First analog pin value (A0) must be greater than or equal to NUM_ANALOG_INPUTS
174
177
#define NUM_ANALOG_FIRST 83
175
178
179
+ //ADC sampling time
180
+ #define SAMPLINGTIME ADC_SAMPLETIME_640CYCLES_5
181
+
176
182
//ADC resolution is 12bits
177
183
#define ADC_RESOLUTION 12
178
184
#define DACC_RESOLUTION 12
You can’t perform that action at this time.
0 commit comments