Solar panel
Loading...
Searching...
No Matches
adc.h
Go to the documentation of this file.
1
24/*
25 (c) 2018 Microchip Technology Inc. and its subsidiaries.
26
27 Subject to your compliance with these terms, you may use Microchip software and any
28 derivatives exclusively with Microchip products. It is your responsibility to comply with third party
29 license terms applicable to your use of third party software (including open source software) that
30 may accompany Microchip software.
31
32 THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
33 EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY
34 IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS
35 FOR A PARTICULAR PURPOSE.
36
37 IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
38 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
39 WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP
40 HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO
41 THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL
42 CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT
43 OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS
44 SOFTWARE.
45*/
46
47#ifndef ADC_H
48#define ADC_H
49
54#include <xc.h>
55#include <stdint.h>
56#include <stdbool.h>
57
58#ifdef __cplusplus // Provide C++ Compatibility
59
60 extern "C" {
61
62#endif
63
72typedef uint16_t adc_result_t;
73
77typedef struct
78{
82
95typedef enum
96{
97 voltage = 0x5,
98 current = 0x6
100
134void ADC_Initialize(void);
135
164void ADC_SelectChannel(adc_channel_t channel);
165
191void ADC_StartConversion(void);
192
223bool ADC_IsConversionDone(void);
224
257
287
315
316#ifdef __cplusplus // Provide C++ Compatibility
317
318 }
319
320#endif
321
322#endif //ADC_H
void ADC_SelectChannel(adc_channel_t channel)
Definition: adc.c:82
void ADC_TemperatureAcquisitionDelay(void)
Definition: adc.c:129
adc_result_t ADC_GetConversion(adc_channel_t channel)
Definition: adc.c:109
adc_result_t ADC_GetConversionResult(void)
Definition: adc.c:103
adc_channel_t
Definition: adc.h:96
@ voltage
Definition: adc.h:97
@ current
Definition: adc.h:98
void ADC_Initialize(void)
Definition: adc.c:61
uint16_t adc_result_t
Definition: adc.h:72
bool ADC_IsConversionDone(void)
Definition: adc.c:97
void ADC_StartConversion(void)
Definition: adc.c:90
adc_result_t adcResult2
Definition: adc.h:80
adc_result_t adcResult1
Definition: adc.h:79