We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fd40374 + 856da01 commit 5cf1048Copy full SHA for 5cf1048
4 files changed
cores/arduino/stm32/analog.cpp
@@ -797,7 +797,11 @@ uint16_t adc_read_value(PinName pin)
797
#ifdef ADC_DATAALIGN_RIGHT
798
AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT; /* Right-alignment for converted data */
799
#endif
800
+#ifdef ADC_SCAN_SEQ_FIXED
801
+ AdcHandle.Init.ScanConvMode = ADC_SCAN_SEQ_FIXED; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
802
+#else
803
AdcHandle.Init.ScanConvMode = DISABLE; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
804
+#endif
805
#ifdef ADC_EOC_SINGLE_CONV
806
AdcHandle.Init.EOCSelection = ADC_EOC_SINGLE_CONV; /* EOC flag picked-up to indicate conversion end */
807
@@ -845,7 +849,6 @@ uint16_t adc_read_value(PinName pin)
845
849
#if defined(STM32G0xx)
846
850
AdcHandle.Init.SamplingTimeCommon1 = samplingTime; /* Set sampling time common to a group of channels. */
847
851
AdcHandle.Init.SamplingTimeCommon2 = samplingTime; /* Set sampling time common to a group of channels, second common setting possible.*/
848
- AdcHandle.Init.TriggerFrequencyMode = ADC_TRIGGER_FREQ_HIGH;
852
853
#if defined(STM32L0xx)
854
AdcHandle.Init.LowPowerFrequencyMode = DISABLE; /* To be enabled only if ADC clock < 2.8 MHz */
@@ -887,7 +890,11 @@ uint16_t adc_read_value(PinName pin)
887
890
#endif /* STM32L4xx || STM32WBxx */
888
891
return 0;
889
892
}
893
894
+ AdcChannelConf.Rank = ADC_RANK_CHANNEL_NUMBER; /* Enable the rank of the selected channels when not fully configurable */
895
896
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
897
898
#if !defined(STM32L0xx)
899
#if !defined(STM32G0xx)
900
AdcChannelConf.SamplingTime = samplingTime; /* Sampling time value to be set for the selected channel */
variants/NUCLEO_G071RB/PeripheralPins.c
@@ -32,7 +32,7 @@ WEAK const PinMap PinMap_ADC[] = {
32
//{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
33
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
34
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
35
- {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
+ //{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
36
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
37
{PB_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
38
{PB_10, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11
variants/NUCLEO_G071RB/variant.cpp
@@ -34,9 +34,9 @@ const PinName digitalPin[] = {
PA_8, //D7
PA_9, //D8
PC_7, //D9
- PB_0, //D10/A8
- PA_7, //D11/A7
39
- PA_6, //D12/A6
+ PB_0, //D10
+ PA_7, //D11/A6
+ PA_6, //D12/A7
40
PA_5, //D13/LED
41
PB_9, //D14
42
PB_8, //D15
@@ -74,10 +74,10 @@ const PinName digitalPin[] = {
74
PA_12, //D42
75
PC_1, //D43
76
PC_0, //D44
77
- PB_2, //D45/A9
+ PB_2, //D45/A8
78
PB_6, //D46
79
PB_15, //D47
80
- PB_10, //D48/A10
+ PB_10, //D48/A9
81
PB_13, //D49
82
PA_2, //D50
83
PD_8, //D51
@@ -89,11 +89,10 @@ const PinName digitalPin[] = {
89
PB_11, //D57/A4
90
PB_12, //D58/A5
91
// Duplicated pins in order to be aligned with PinMap_ADC
92
- PB_0, //D59/A6 = D10
93
- PA_7, //D60/A7 = D11
94
- PA_6, //D61/A8 = D12
95
- PB_2, //D62/A9 = D45
96
- PB_10 //D63/A10 = D48
+ PA_7, //D59/A6 = D11
+ PA_6, //D60/A7 = D12
+ PB_2, //D61/A8 = D45
+ PB_10 //D62/A9 = D48
97
};
98
99
#ifdef __cplusplus
variants/NUCLEO_G071RB/variant.h
@@ -37,9 +37,9 @@ extern "C" {
#define PA8 7
#define PA9 8
#define PC7 9
-#define PB0 10 // A6
-#define PA7 11 // A7
-#define PA6 12 // A8
+#define PB0 10
+#define PA7 11 // A6
+#define PA6 12 // A7
43
#define PA5 13 // LED
44
#define PB9 14
45
#define PB8 15
@@ -77,10 +77,10 @@ extern "C" {
#define PA12 42
#define PC1 43
#define PC0 44
-#define PB2 45 // A9
+#define PB2 45 // A8
#define PB6 46
#define PB15 47
-#define PB10 48 // A10
+#define PB10 48 // A9
84
#define PB13 49
85
#define PA2 50
86
#define PD8 51
@@ -93,9 +93,9 @@ extern "C" {
#define PB12 58 // A5
// This must be a literal
-#define NUM_DIGITAL_PINS 64
+#define NUM_DIGITAL_PINS 63
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
-#define NUM_ANALOG_INPUTS 11
+#define NUM_ANALOG_INPUTS 10
#define NUM_ANALOG_FIRST 53
100
101
// On-board LED pin number
0 commit comments