Skip to content

Commit

Permalink
Update the ADC driver docs for RP2040
Browse files Browse the repository at this point in the history
  • Loading branch information
sigprof committed Jan 15, 2023
1 parent 629094e commit 09ef8b6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/adc_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Then place this include at the top of your code:

### ARM

#### STM32

Note that some of these pins are doubled-up on ADCs with the same channel. This is because the pins can be used for either ADC.

Also note that the F0 and F3 use different numbering schemes. The F0 has a single ADC and the channels are 0-indexed, whereas the F3 has 4 ADCs and the channels are 1-indexed. This is because the F0 uses the `ADCv1` implementation of the ADC, whereas the F3 uses the `ADCv3` implementation.
Expand Down Expand Up @@ -121,6 +123,21 @@ Also note that the F0 and F3 use different numbering schemes. The F0 has a singl

<sup>² Not all STM32F4xx devices have ADC2 and/or ADC3, therefore some configurations shown in this table may be unavailable; in particular, pins `F4``F10` cannot be used as ADC inputs on devices which do not have ADC3. Check the device datasheet to confirm which pin functions are supported.</sup>

#### RP2040

RP2040 has only a single ADC (`ADCD1` in ChibiOS); in the QMK API the index for that ADC is 0.

|Channel|Pin |
|-------|-------------------|
|0 |`GP26` |
|1 |`GP27` |
|2 |`GP28` |
|3 |`GP29` |
|4 |Temperature sensor¹|


<sup>¹ The temperature sensor is disabled by default and needs to be enabled by the RP2040-specific function: `adcRPEnableTS(&ADCD1)`. The ADC must be initialized before calling that function; an easy way to ensure that is to perform a dummy conversion.</sup>

## Functions

### AVR
Expand Down

0 comments on commit 09ef8b6

Please sign in to comment.