mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 09:31:51 +00:00
Add adc control module for emulation board. The ADC converts the input voltage signal ranging from 0v to 3v into a 10-bit unsigned integer. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=manual test. 1 - adc channel 1, 3, 5, and 7 to ground. 2 - adc channel 0 and 2 to 1.26v. 3 - adc channel 4 and 6 to 1.72v. 4 - condition, factor_mul = 3000, factor_div = 1024, and shift = 0. 5 - console "adc", result as following. adc_ch0 = 1256 adc_ch1 = 0 adc_ch2 = 1256 adc_ch3 = 0 adc_ch4 = 1722 adc_ch5 = 0 adc_ch6 = 1725 adc_ch7 = 0 Change-Id: I72efd09c9f7dbff25c4f6fd4846c9b1c1e5637ca Reviewed-on: https://chromium-review.googlesource.com/228092 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw>
48 lines
721 B
C
48 lines
721 B
C
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
/* IT8380 development board configuration */
|
|
|
|
#ifndef __BOARD_H
|
|
#define __BOARD_H
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
/* stubbed features */
|
|
#undef CONFIG_LID_SWITCH
|
|
|
|
#include "gpio_signal.h"
|
|
|
|
enum pwm_channel {
|
|
PWM_CH_0,
|
|
PWM_CH_1,
|
|
PWM_CH_2,
|
|
PWM_CH_3,
|
|
PWM_CH_4,
|
|
PWM_CH_5,
|
|
PWM_CH_6,
|
|
PWM_CH_7,
|
|
|
|
/* Number of PWM channels */
|
|
PWM_CH_COUNT
|
|
};
|
|
|
|
enum adc_channel {
|
|
ADC_CH_0,
|
|
ADC_CH_1,
|
|
ADC_CH_2,
|
|
ADC_CH_3,
|
|
ADC_CH_4,
|
|
ADC_CH_5,
|
|
ADC_CH_6,
|
|
ADC_CH_7,
|
|
|
|
/* Number of ADC channels */
|
|
ADC_CH_COUNT
|
|
};
|
|
|
|
#endif /* !__ASSEMBLER__ */
|
|
#endif /* __BOARD_H */
|