Skip to content

Commit 327969d

Browse files
committed
include: adc: add doxygen docs for voltage_divider extended API
Adds doxygen documentation for the extended API of the voltage divider ADC driver. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent fb62a29 commit 327969d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

‎dts/bindings/iio/afe/voltage-divider.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2019, Peter Bigot Consulting, LLC
22
# SPDX-License-Identifier: Apache-2.0
33

4+
title: Voltage Divider
5+
46
description: |
57
Description for a voltage divider, with optional ability to measure
68
resistance of the upper leg.

‎include/zephyr/drivers/adc/voltage_divider.h‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,37 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/**
8+
* @file
9+
* @brief Header file for extended API of Voltage Divider
10+
* @ingroup adc_voltage_divider_interface
11+
*/
12+
713
#ifndef ZEPHYR_INCLUDE_DRIVERS_ADC_VOLTAGE_DIVIDER_H_
814
#define ZEPHYR_INCLUDE_DRIVERS_ADC_VOLTAGE_DIVIDER_H_
915

1016
#include <zephyr/drivers/adc.h>
1117

18+
/**
19+
* @brief Voltage Divider
20+
* @defgroup adc_voltage_divider_interface Voltage Divider
21+
* @ingroup adc_interface_ext
22+
* @{
23+
*/
24+
25+
/**
26+
* @brief Voltage divider DT struct.
27+
*
28+
* This stores information about a voltage divider obtained from Devicetree.
29+
*
30+
* @see VOLTAGE_DIVIDER_DT_SPEC_GET
31+
*/
1232
struct voltage_divider_dt_spec {
33+
/** ADC channel info */
1334
const struct adc_dt_spec port;
35+
/** Full resistance in ohms */
1436
uint32_t full_ohms;
37+
/** Output resistance in ohms */
1538
uint32_t output_ohms;
1639
};
1740

@@ -33,7 +56,7 @@ struct voltage_divider_dt_spec {
3356
}
3457

3558
/**
36-
* @brief Calculates the actual voltage from the measured voltage
59+
* @brief Calculates the actual voltage from a measured voltage
3760
*
3861
* @param[in] spec voltage divider specification from Devicetree.
3962
* @param[in,out] v_to_v Pointer to the measured voltage on input, and the
@@ -56,4 +79,6 @@ static inline int voltage_divider_scale_dt(const struct voltage_divider_dt_spec
5679
return 0;
5780
}
5881

82+
/** @} */
83+
5984
#endif /* ZEPHYR_INCLUDE_DRIVERS_ADC_VOLTAGE_DIVIDER_H_ */

0 commit comments

Comments
 (0)