Carga Dinâmica  0.1
Sistemas de Instrumentação Electrónica
adc.h
Go to the documentation of this file.
1 
6 #ifndef ADC_H
7 #define ADC_H
8 
9 // ****************************************************************************
10 //includes
11 #include <stdint.h>
12 #include <xc.h>
13 #include <stdio.h>
14 
15 #include "interrup.h"
16 #include "uart.h"
17 #include "led.h"
18 #include "confHardware.h"
19 
20 // ****************************************************************************
21 //define's
22 //configuraçao feita no confHardware
23 
24 #define ANALOG_INPUTS inputAnalog
25 #define ResPower rSense
26 #define gainOpamp gainCorrent
27 #define factorConv divResitiveV
28 
30 
31 
32 //**************************************************************************
38 void adcInit(void);
39 
40 //**************************************************************************
46 void adcStart(void);
47 
48 //**************************************************************************
54 void adcReset(void);
55 
56 
57 //**************************************************************************
65 void adcValue(void);
66 
67 //*****************************************************************************
74 uint16_t readInputVoltage(void);
75 
76 //*****************************************************************************
84 uint16_t readCorrentConsumer(void);
85 
86 //**************************************************************************
92 void debugADC(void);
93 
94 
95 
96 #endif /* ADC_H */
97 
Configure uart1.
void adcValue(void)
reading 3 values per channel and makes convert 0 a 1024 to a read voltage value, 0 to 3...
configuratoin the define relative hardware
#define ANALOG_INPUTS
Number od ADC in using MAX: 4.
Definition: adc.h:24
void adcStart(void)
start A/D module
configuratoin for i2c
uint16_t valueADC[ANALOG_INPUTS]
Array of adc read.
Definition: adc.h:29
uint16_t readInputVoltage(void)
Convert adc to voltage.
void debugADC(void)
function use for testing ADC
configuratoin for led
void adcInit(void)
this function is to initialization ADC
void adcReset(void)
stop A/D module
uint16_t readCorrentConsumer(void)
Convert adc value to corrent.