openUBMC Chip Abstract Layer
V0.1
载入中...
搜索中...
未找到
include
bcal
adc.h
浏览该文件的文档.
1
/*
2
* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
3
*
4
* this file licensed under the Mulan PSL v2.
5
* You can use this software according to the terms and conditions of the Mulan PSL v2.
6
* You may obtain a copy of Mulan PSL v2 at:
7
* http://license.coscl.org.cn/MulanPSL2
8
*
9
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
10
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
11
* PURPOSE.
12
* See the Mulan PSL v2 for more details.
13
*
14
* Create: 2025-07-17
15
*/
16
21
#ifndef DRIVER_ADC_H
22
#define DRIVER_ADC_H
23
#include "
driver.h
"
24
25
namespace
DRIVER_ADC {
26
using namespace
bcal;
27
34
enum class
VOLT_REF_SRC
{
35
EXTERNAL_VOLT
,
36
INTERNAL_VOLT
37
};
38
43
struct
AdcConfig
{
44
uint32_t
rate
;
45
VOLT_REF_SRC
volt_ref_src
;
46
uint32_t
volt_ref_val
;
47
};
48
53
class
Adc
:
public
IDriver
{
54
public
:
60
virtual
uint32_t
read
(int32_t index) = 0;
61
};
62
}
63
64
#endif
// DRIVER_ADC_H
DRIVER_ADC::VOLT_REF_SRC
VOLT_REF_SRC
参考电压源选择
Definition
adc.h:34
DRIVER_ADC::VOLT_REF_SRC::INTERNAL_VOLT
@ INTERNAL_VOLT
DRIVER_ADC::VOLT_REF_SRC::EXTERNAL_VOLT
@ EXTERNAL_VOLT
DRIVER_ADC::Adc
ADC 驱动抽象接口类
Definition
adc.h:53
DRIVER_ADC::Adc::read
virtual uint32_t read(int32_t index)=0
读取 ADC 转换结果
bcal::IDriver
BCAL层驱动公共接口
Definition
driver.h:41
driver.h
BCAL 驱动公共接口定义
DRIVER_ADC::AdcConfig
ADC 配置参数结构体
Definition
adc.h:43
DRIVER_ADC::AdcConfig::rate
uint32_t rate
Definition
adc.h:44
DRIVER_ADC::AdcConfig::volt_ref_val
uint32_t volt_ref_val
Definition
adc.h:46
DRIVER_ADC::AdcConfig::volt_ref_src
VOLT_REF_SRC volt_ref_src
Definition
adc.h:45
制作者
1.9.8