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
19{
20 ADC_Start();
21 NOP();
22 NOP();
23 while (!ADC_SamplingFinished());
25 return ADC_RES;
26}
27
29{
31 ADC_Start();
32 NOP();
33 NOP();
34 while (!ADC_SamplingFinished());
36 res = ADC_RES;
37 return (res << 8) + ADC_RESL;
38}
uint16_t res
uint16_t ADC_ConvertHP(void)
Definition: fw_adc.c:28
uint8_t ADC_Convert(void)
Definition: fw_adc.c:18
#define ADC_SamplingFinished()
Definition: fw_adc.h:23
#define ADC_ClearInterrupt()
Definition: fw_adc.h:24
#define ADC_Start()
Definition: fw_adc.h:22
unsigned short uint16_t
Definition: fw_types.h:19
short int16_t
Definition: fw_types.h:24
unsigned char uint8_t
Definition: fw_types.h:18