ATY_LIB
V2_102_230218
ATY_LIB for general devices or ALGO
Loading...
Searching...
No Matches
fw_adc.c
Go to the documentation of this file.
1
// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include "
fw_adc.h
"
16
17
18
uint8_t
ADC_Convert
(
void
)
19
{
20
ADC_Start
();
21
NOP();
22
NOP();
23
while
(!
ADC_SamplingFinished
());
24
ADC_ClearInterrupt
();
25
return
ADC_RES;
26
}
27
28
uint16_t
ADC_ConvertHP
(
void
)
29
{
30
int16_t
res
;
31
ADC_Start
();
32
NOP();
33
NOP();
34
while
(!
ADC_SamplingFinished
());
35
ADC_ClearInterrupt
();
36
res
= ADC_RES;
37
return
(
res
<< 8) + ADC_RESL;
38
}
res
uint16_t res
Definition:
adc_interrupt_10bit.c:32
ADC_ConvertHP
uint16_t ADC_ConvertHP(void)
Definition:
fw_adc.c:28
ADC_Convert
uint8_t ADC_Convert(void)
Definition:
fw_adc.c:18
fw_adc.h
ADC_SamplingFinished
#define ADC_SamplingFinished()
Definition:
fw_adc.h:23
ADC_ClearInterrupt
#define ADC_ClearInterrupt()
Definition:
fw_adc.h:24
ADC_Start
#define ADC_Start()
Definition:
fw_adc.h:22
uint16_t
unsigned short uint16_t
Definition:
fw_types.h:19
int16_t
short int16_t
Definition:
fw_types.h:24
uint8_t
unsigned char uint8_t
Definition:
fw_types.h:18
ATY_LIB
FwLib_STC8
src
fw_adc.c
Generated by
1.9.6