projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Silence warning.
[bertos.git]
/
bertos
/
cpu
/
cortex-m3
/
io
/
stm32_adc.h
diff --git
a/bertos/cpu/cortex-m3/io/stm32_adc.h
b/bertos/cpu/cortex-m3/io/stm32_adc.h
index b884b5265630fce6c8e5f467455f21a58c226f62..a3d4d2edc1b5154f3535b64b2d0d6f53cad40f85 100644
(file)
--- a/
bertos/cpu/cortex-m3/io/stm32_adc.h
+++ b/
bertos/cpu/cortex-m3/io/stm32_adc.h
@@
-81,8
+81,8
@@
#define ADC_CHANNEL_13 ((uint8_t)0x0D)
#define ADC_CHANNEL_14 ((uint8_t)0x0E)
#define ADC_CHANNEL_15 ((uint8_t)0x0F)
#define ADC_CHANNEL_13 ((uint8_t)0x0D)
#define ADC_CHANNEL_14 ((uint8_t)0x0E)
#define ADC_CHANNEL_15 ((uint8_t)0x0F)
-#define ADC_CHANNEL_16 ((uint8_t)0
X
10)
-#define ADC_CHANNEL_17 ((uint8_t)0
X
11)
+#define ADC_CHANNEL_16 ((uint8_t)0
x
10)
+#define ADC_CHANNEL_17 ((uint8_t)0
x
11)
/* ADC sampling times */
#define ADC_SAMPLETIME_1CYCLES5 ((uint8_t)0x00)
/* ADC sampling times */
#define ADC_SAMPLETIME_1CYCLES5 ((uint8_t)0x00)
@@
-247,11
+247,41
@@
#define SR_JEOC 2
#define SR_JSTRT 3
#define SR_STRT 4
#define SR_JEOC 2
#define SR_JSTRT 3
#define SR_STRT 4
+
+/* ADC sample time */
+#define SMPR1_CH17 21
+#define SMPR1_CH16 18
+#define SMPR1_CH15 15
+#define SMPR1_CH14 12
+#define SMPR1_CH13 9
+#define SMPR1_CH12 6
+#define SMPR1_CH11 3
+#define SMPR1_CH10 0
+
+#define SMPR2_CH9 27
+#define SMPR2_CH8 24
+#define SMPR2_CH7 21
+#define SMPR2_CH6 18
+#define SMPR2_CH5 15
+#define SMPR2_CH4 12
+#define SMPR2_CH3 9
+#define SMPR2_CH2 6
+#define SMPR2_CH1 3
+#define SMPR2_CH0 0
\r
/* ADC registers Masks */
\r
#define CR1_ADC_CLEAR_MASK ((uint32_t)0xFFF0FEFF)
\r
#define CR2_ADC_CLEAR_MASK ((uint32_t)0xFFF1F7FD)
\r
\r
/* ADC registers Masks */
\r
#define CR1_ADC_CLEAR_MASK ((uint32_t)0xFFF0FEFF)
\r
#define CR2_ADC_CLEAR_MASK ((uint32_t)0xFFF1F7FD)
\r
-#define SQR1_CLEAR_MASK ((uint32_t)0xFF0FFFFF)
+#define SQR1_CLEAR_MASK ((uint32_t)0xFF0FFFFF)
+
+
+
+/* ADC defines for SMT32F103Bxx */
+#define ADC_TEMP_V25 4300 // uV / C
+#define ADC_TEMP_SLOPE 1430 // mV
+#define ADC_TEMP_CONST 25000
+#define ADC_TEMP_CH 16
+#define ADC_VREFINT_CH 17
\r
struct stm32_adc
{
\r
struct stm32_adc
{