Functions | |
| cy_rslt_t | cyhal_adc_channel_init (cyhal_adc_channel_t *obj, cyhal_adc_t *adc, cyhal_gpio_t pin) |
| void | cyhal_adc_channel_free (cyhal_adc_channel_t *obj) |
| uint16_t | cyhal_adc_read_u16 (const cyhal_adc_channel_t *obj) |
| cy_rslt_t cyhal_adc_channel_init | ( | cyhal_adc_channel_t * | obj, |
| cyhal_adc_t * | adc, | ||
| cyhal_gpio_t | pin | ||
| ) |
Initialize a single-ended ADC channel.
Configures the pin used by ADC.
| [out] | obj | The adc channel object to initialize |
| [in] | adc | The adc for which the channel should be initialized |
| [in] | pin | The adc pin name |
| void cyhal_adc_channel_free | ( | cyhal_adc_channel_t * | obj | ) |
Uninitialize the ADC channel and cyhal_adc_channel_t object
| [in,out] | obj | The ADC channel object |
| uint16_t cyhal_adc_read_u16 | ( | const cyhal_adc_channel_t * | obj | ) |
Read the value from ADC pin, represented as an unsigned 16bit value where 0x0000 represents the minimum value in the ADC's range, and 0xFFFF represents the maximum value in the ADC's range.
| [in] | obj | The ADC object |