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_ADC   0
 

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. More...
 
static void adc_select_input (uint input)
 ADC input select. More...
 
static uint adc_get_selected_input (void)
 Get the currently selected ADC input channel. More...
 
static void adc_set_round_robin (uint input_mask)
 Round Robin sampling selector. More...
 
static void adc_set_temp_sensor_enabled (bool enable)
 Enable the onboard temperature sensor. More...
 
static uint16_t adc_read (void)
 Perform a single conversion. More...
 
static void adc_run (bool run)
 Enable or disable free-running sampling mode. More...
 
static void adc_set_clkdiv (float clkdiv)
 Set the ADC Clock divisor. More...
 
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. More...
 
static bool adc_fifo_is_empty (void)
 Check FIFO empty state. More...
 
static uint8_t adc_fifo_get_level (void)
 Get number of entries in the ADC FIFO. More...
 
static uint16_t adc_fifo_get (void)
 Get ADC result from FIFO. More...
 
static uint16_t adc_fifo_get_blocking (void)
 Wait for the ADC FIFO to have data. More...
 
static void adc_fifo_drain (void)
 Drain the ADC FIFO. More...
 
static void adc_irq_set_enabled (bool enabled)
 Enable/Disable ADC interrupts. More...