We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a531123 commit 349dfb9Copy full SHA for 349dfb9
src/rp2_common/hardware_adc/include/hardware/adc.h
@@ -88,6 +88,16 @@ static inline void adc_select_input(uint input) {
88
hw_write_masked(&adc_hw->cs, input << ADC_CS_AINSEL_LSB, ADC_CS_AINSEL_BITS);
89
}
90
91
+/*! \brief ADC get input
92
+ * \ingroup hardware_adc
93
+ *
94
+ * Returns the currently selected input. 0...3 are GPIOs 26...29 respectively.
95
+ * Input 4 is the onboard temperature sensor.
96
+ */
97
+static inline uint adc_selected_input(void) {
98
+ return (adc_hw->cs & ADC_CS_AINSEL_BITS) >> ADC_CS_AINSEL_LSB;
99
+}
100
+
101
/*! \brief Round Robin sampling selector
102
* \ingroup hardware_adc
103
*
0 commit comments