Skip to content

Commit a0c9bee

Browse files
committed
Add internal ADC channels (ts,intref,vbat)
1 parent 7635de9 commit a0c9bee

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

variants/OPENTRACKER_V3/PeripheralPins.c

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const PinMap PinMap_ADC[] = {
4949
{PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
5050
{PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
5151
{PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
52+
{ADC_VREF, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // Virtual Ch16 (VREFINT)
53+
{ADC_VTEMP, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // Virtual Ch17 (VTEMPSENSOR)
54+
{ADC_VBAT, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // Virtual Ch18 (VBAT/3)
5255
{NC, NP, 0}
5356
};
5457
#endif

variants/OPENTRACKER_V3/PinNamesVar.h

+13
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@
2323
#ifdef PWR_WAKEUP_PIN8
2424
SYS_WKUP8 = NC,
2525
#endif
26+
27+
#ifdef ADC_CHANNEL_0
28+
ADC_CH0 = 0xA0,
29+
#endif
30+
#ifdef ADC_CHANNEL_VBAT
31+
ADC_VBAT = 0xA1,
32+
#endif
33+
#ifdef ADC_CHANNEL_VREFINT
34+
ADC_VREF = 0xA2,
35+
#endif
36+
#ifdef ADC_CHANNEL_TEMPSENSOR
37+
ADC_VTEMP = 0xA3,
38+
#endif

0 commit comments

Comments
 (0)