Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/mbed/hal/analogout_api.h
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/analogout_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Analogout hal structure. dac_s is declared in the target's hal 31 */ 27 32 typedef struct dac_s dac_t; 28 33 29 void analogout_init (dac_t *obj, PinName pin); 30 void analogout_free (dac_t *obj); 31 void analogout_write (dac_t *obj, float value); 32 void analogout_write_u16(dac_t *obj, uint16_t value); 33 float analogout_read (dac_t *obj); 34 uint16_t analogout_read_u16 (dac_t *obj); 34 /** 35 * \defgroup hal_analogout Analogout hal functions 36 * @{ 37 */ 38 39 /** Initialize the analogout peripheral 40 * 41 * Configures the pin used by analogout. 42 * @param obj The analogout object to initialize 43 * @param pin The analogout pin name 44 */ 45 void analogout_init(dac_t *obj, PinName pin); 46 47 /** Release the analogout object 48 * 49 * Note: This is not currently used in the mbed-drivers 50 * @param obj The analogout object 51 */ 52 void analogout_free(dac_t *obj); 53 54 /** Set the output voltage, specified as a percentage (float) 55 * 56 * @param obj The analogin object 57 * @param value The floating-point output voltage to be set 58 */ 59 void analogout_write(dac_t *obj, float value); 60 61 /** Set the output voltage, specified as unsigned 16-bit 62 * 63 * @param obj The analogin object 64 * @param value The unsigned 16-bit output voltage to be set 65 */ 66 void analogout_write_u16(dac_t *obj, uint16_t value); 67 68 /** Read the current voltage value on the pin 69 * 70 * @param obj The analogin object 71 * @return A floating-point value representing the current voltage on the pin, 72 * measured as a percentage 73 */ 74 float analogout_read(dac_t *obj); 75 76 /** Read the current voltage value on the pin, as a normalized unsigned 16bit value 77 * 78 * @param obj The analogin object 79 * @return An unsigned 16-bit value representing the current voltage on the pin 80 */ 81 uint16_t analogout_read_u16(dac_t *obj); 82 83 /**@}*/ 35 84 36 85 #ifdef __cplusplus … … 41 90 42 91 #endif 92 93 /** @}*/
Note:
See TracChangeset
for help on using the changeset viewer.