summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-04-22 18:59:27 -0400
committerguo <[email protected]>2022-04-23 23:03:59 +0800
commit175ca2ee09698f554993fb2ff440cad1c9af89f4 (patch)
tree871af8f7605bc7f6a7d7e79437866bd699aeabfb /components/drivers/include
parent778be73cac4795c97ab01872e94dbf09f2014634 (diff)
[dac] add get resolution method
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/dac.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/dac.h b/components/drivers/include/drivers/dac.h
index dcda0ef68f..0270b988ba 100644
--- a/components/drivers/include/drivers/dac.h
+++ b/components/drivers/include/drivers/dac.h
@@ -18,6 +18,7 @@ struct rt_dac_ops
rt_err_t (*disabled)(struct rt_dac_device *device, rt_uint32_t channel);
rt_err_t (*enabled)(struct rt_dac_device *device, rt_uint32_t channel);
rt_err_t (*convert)(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value);
+ rt_uint8_t (*get_resolution)(struct rt_dac_device *device);
};
struct rt_dac_device
@@ -31,6 +32,7 @@ typedef enum
{
RT_DAC_CMD_ENABLE = RT_DEVICE_CTRL_BASE(DAC) + 0,
RT_DAC_CMD_DISABLE = RT_DEVICE_CTRL_BASE(DAC) + 1,
+ RT_DAC_CMD_GET_RESOLUTION = RT_DEVICE_CTRL_BASE(DAC) + 2,
} rt_dac_cmd_t;
rt_err_t rt_hw_dac_register(rt_dac_device_t dac,const char *name, const struct rt_dac_ops *ops, const void *user_data);