# ADC Example

## Overview

This sample demonstrates the basic K230 ADC HAL workflow.

Source file:

```bash
src/rtsmart/examples/peripheral/adc/test_adc.c
```

## Sample Behavior

- initialize ADC
- read a raw value from the selected channel
- convert it to a voltage value based on the selected reference voltage

## Key APIs

- `drv_adc_init()`
- `drv_adc_read(channel)`
- `drv_adc_read_uv(channel, ref_uv)`
- `drv_adc_deinit()`

## Build and Run

```bash
cd src/rtsmart/examples/peripheral/adc
make
./test_adc [channel] [ref_uv]
```

- `channel`: ADC channel index, default `0`
- `ref_uv`: reference voltage in microvolts, only `1800000` or `3600000`

## Output Example

The sample prints the raw ADC value and the converted voltage value for the selected channel.
