@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
adc.h File Reference
`#include "pico.h"`
`#include "hardware/structs/adc.h"`
`#include "hardware/gpio.h"`
Include dependency graph for adc.h:

Go to the source code of this file.

## Macros

#define | PARAM_ASSERTIONS_ENABLED_HARDWARE_ADC 0
#define | ADC_TEMPERATURE_CHANNEL_NUM (NUM_ADC_CHANNELS - 1)
#define | PICO_ADC_CLKDIV_ROUND_NEAREST PICO_CLKDIV_ROUND_NEAREST

## Functions

void | adc_init (void)
| Initialise the ADC HW.
static void | adc_gpio_init (uint gpio)
| Initialise the gpio for use as an ADC pin.
static void | adc_select_input (uint input)
| ADC input select.
static uint | adc_get_selected_input (void)
| Get the currently selected ADC input channel.
static void | adc_set_round_robin (uint input_mask)
| Round Robin sampling selector.
static void | adc_set_temp_sensor_enabled (bool enable)
| Enable the onboard temperature sensor.
static uint16_t | adc_read (void)
| Perform a single conversion.
static void | adc_run (bool run)
| Enable or disable free-running sampling mode.
static void | adc_set_clkdiv (float clkdiv)
| Set the ADC Clock divisor.
static void | adc_fifo_setup (bool en, bool dreq_en, uint16_t dreq_thresh, bool err_in_fifo, bool byte_shift)
| Setup the ADC FIFO.
static bool | adc_fifo_is_empty (void)
| Check FIFO empty state.
static uint8_t | adc_fifo_get_level (void)
| Get number of entries in the ADC FIFO.
static uint16_t | adc_fifo_get (void)
| Get ADC result from FIFO.
static uint16_t | adc_fifo_get_blocking (void)
| Wait for the ADC FIFO to have data.
static void | adc_fifo_drain (void)
| Drain the ADC FIFO.
static void | adc_irq_set_enabled (bool enabled)
| Enable/Disable ADC interrupts.

## Macro Definition Documentation

## ADC_TEMPERATURE_CHANNEL_NUM

#define ADC_TEMPERATURE_CHANNEL_NUM (NUM_ADC_CHANNELS - 1)

The ADC channel number of the on-board temperature sensor