Skip to content

Commit 85a2cb2

Browse files
committed
Analogout: add defined behavior
1 parent 2929895 commit 85a2cb2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

hal/analogout_api.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,32 @@ typedef struct dac_s dac_t;
3535

3636
/**
3737
* \defgroup hal_analogout Analogout hal functions
38+
*
39+
* # Defined behaviour
40+
* * The function ::analogout_init initializes the analogin peripheral
41+
* * The function ::analogout_write sets the output voltage, specified as a percentage (float) in range [0.0, 1.0]
42+
* * The function ::analogout_write_u16 sets the output voltage, specified as unsigned 16-bit value
43+
* * The function ::analogout_read reads the current voltage value on the pin and returns a floating-point value representing the current voltage in range [0.0, 1.0]
44+
* * The function ::analogout_read_u16 reads the current voltage value on the pin and returns the output voltage, specified as unsigned 16-bit value
45+
* * The function ::analogout_free releases the analogout object
46+
*
47+
* # Undefined behaviour
48+
*
49+
* * ::analogout_init is called with invalid pin (which does not support analog output function)
50+
* * Calling other functions before ::analogout_init
3851
* @{
3952
*/
4053

54+
/**
55+
* \defgroup hal_analogin_tests Analogout hal tests
56+
* The Analogout HAL tests ensure driver conformance to defined behaviour.
57+
*
58+
* To run the Analogout hal tests use the command:
59+
*
60+
* mbed test -t <toolchain> -m <target> -n tests-mbed_hal_fpga_ci_test_shield-analogout
61+
*
62+
*/
63+
4164
/** Initialize the analogout peripheral
4265
*
4366
* Configures the pin used by analogout.

0 commit comments

Comments
 (0)