RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dac.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2024 RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2020-06-19 thread-liu the first version
9 */
10
11#ifndef __DAC_H__
12#define __DAC_H__
13#include <rtthread.h>
65
70struct rt_dac_device;
75{
76 rt_err_t (*disabled)(struct rt_dac_device *device, rt_uint32_t channel);
77 rt_err_t (*enabled)(struct rt_dac_device *device, rt_uint32_t channel);
78 rt_err_t (*convert)(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value);
80};
81
86{
88 const struct rt_dac_ops *ops;
89};
91
98
107rt_err_t rt_hw_dac_register(rt_dac_device_t dac,const char *name, const struct rt_dac_ops *ops, const void *user_data);
108
117
125
133
135
136#endif /* __dac_H__ */
rt_err_t rt_dac_write(rt_dac_device_t dev, rt_uint32_t channel, rt_uint32_t value)
set the value of DAC
struct rt_dac_device * rt_dac_device_t
定义 dac.h:90
rt_err_t rt_dac_disable(rt_dac_device_t dev, rt_uint32_t channel)
disable the DAC channel
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)
Register a DAC device
rt_err_t rt_dac_enable(rt_dac_device_t dev, rt_uint32_t channel)
enable the DAC channel
rt_dac_cmd_t
定义 dac.h:93
@ RT_DAC_CMD_ENABLE
定义 dac.h:94
@ RT_DAC_CMD_DISABLE
定义 dac.h:95
@ RT_DAC_CMD_GET_RESOLUTION
定义 dac.h:96
#define RT_DEVICE_CTRL_BASE(Type)
rt_base_t rt_err_t
unsigned char rt_uint8_t
unsigned int rt_uint32_t
DAC device structure
定义 dac.h:86
struct rt_device parent
定义 dac.h:87
const struct rt_dac_ops * ops
定义 dac.h:88
Configuration of DAC device
定义 dac.h:75
rt_uint8_t(* get_resolution)(struct rt_dac_device *device)
定义 dac.h:79
rt_err_t(* enabled)(struct rt_dac_device *device, rt_uint32_t channel)
定义 dac.h:77
rt_err_t(* convert)(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value)
定义 dac.h:78
rt_err_t(* disabled)(struct rt_dac_device *device, rt_uint32_t channel)
定义 dac.h:76