OpenBIC
OpenSource Bridge-IC
plat_class.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_CLASS_H
18#define PLAT_CLASS_H
19
20#define NUMBER_OF_ADC_CHANNEL 16
21#define AST1030_ADC_BASE_ADDR 0x7e6e9000
22
24 REF_VOL_2_5V = 0x0, // 2.5V reference voltage selection
25 REF_VOL_1_2V = 0x40 // 1.2V reference voltage selection
26};
27
30};
31
40};
41
42struct adc_info {
43 long unsigned int offset;
44 int shift;
45};
46
48 float voltage;
49 float range_val;
50 uint8_t board_rev;
51};
52
53bool get_adc_voltage(int channel, float *voltage);
54uint8_t get_board_revision();
56
57#endif
uint8_t get_board_revision()
Definition: plat_class.c:431
int init_platform_config()
Definition: expansion_board.c:43
ADC_REF_VOL_SELECTION
Definition: plat_class.c:53
bool get_adc_voltage(int channel, float *voltage)
Definition: plat_class.c:58
Definition: plat_class.h:42
long unsigned int offset
Definition: plat_class.h:43
int shift
Definition: plat_class.h:44
Definition: plat_class.h:47
float range_val
Definition: plat_class.h:49
uint8_t board_rev
Definition: plat_class.h:50
float voltage
Definition: plat_class.h:48
BOARD_REV_ID
Definition: plat_class.h:31
@ REF_VOL_2_5V
Definition: plat_class.h:24
@ REF_VOL_1_2V
Definition: plat_class.h:25
@ BOARD_PVT
Definition: plat_class.h:37
@ BOARD_EVT
Definition: plat_class.h:35
@ BOARD_MP
Definition: plat_class.h:38
@ BOARD_DVT
Definition: plat_class.h:36
@ UNKNOWN
Definition: plat_class.h:39
@ BOARD_POC2
Definition: plat_class.h:34
@ BOARD_POC
Definition: plat_class.h:33
ADC_CHANNEL_NUM
Definition: plat_class.h:28
@ CHANNEL_1
Definition: plat_class.h:29