OpenBIC
OpenSource Bridge-IC
ads7830.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 _ADS7830_H_
18#define _ADS7830_H_
19
20#include <stdint.h>
21#include <stdbool.h>
22#include "sensor.h"
23
24#define ADC_CH0 0x8C // CH0: SD=1, C2=0, C1=0, C0=0, PD=11
25#define ADC_CH1 0xCC
26#define ADC_CH2 0x9C
27#define ADC_CH3 0xDC
28#define ADC_CH4 0xAC
29#define ADC_CH5 0xEC
30#define ADC_CH6 0xBC
31#define ADC_CH7 0xFC
32
33uint8_t ads7830_init(sensor_cfg *cfg);
34uint8_t ads7830_read(sensor_cfg *cfg, int *reading);
35
36#endif /* _ADS7830_H_ */
uint8_t ads7830_read(sensor_cfg *cfg, int *reading)
Definition: ads7830.c:26
uint8_t ads7830_init(sensor_cfg *cfg)
Definition: ads7830.c:68
uint8_t reading[1]
Definition: pldm_monitor.h:3
Definition: sensor.h:262