PSoC 6 Hardware Abstraction Layer (HAL)

General Description

Functions

cy_rslt_t cyhal_adc_init (cyhal_adc_t *obj, cyhal_gpio_t pin, const cyhal_clock_divider_t *clk)
 
void cyhal_adc_free (cyhal_adc_t *obj)
 

Function Documentation

◆ cyhal_adc_init()

cy_rslt_t cyhal_adc_init ( cyhal_adc_t *  obj,
cyhal_gpio_t  pin,
const cyhal_clock_divider_t *  clk 
)

Initialize ADC peripheral

Parameters
[out]objThe adc object to initialize
[in]pinA pin corresponding to the ADC block to initialize Note: This pin is not reserved, it is just used to identify which ADC block to allocate. If multiple channels will be allocated for a single ADC instance, only one pin should be passed here; it does not matter which one. After calling this function once, call cyhal_adc_channel_init once for each pin whose value should be measured.
[in]clkThe clock to use can be shared, if not provided a new clock will be allocated
Returns
The status of the init request

◆ cyhal_adc_free()

void cyhal_adc_free ( cyhal_adc_t *  obj)

Uninitialize the ADC peripheral and cyhal_adc_t object

Parameters
[in,out]objThe ADC object