Statistiques
| Branche: | Révision:

root / Version 0.5 / Panel_reader_controller.X / defValues.h @ eae0761b

Historique | Voir | Annoter | Télécharger (2,872 ko)

1 eae0761b Enzo Niro
/* Microchip Technology Inc. and its subsidiaries.  You may use this software 
2
 * and any derivatives exclusively with Microchip products. 
3
 * 
4
 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS".  NO WARRANTIES, WHETHER 
5
 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 
6
 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 
7
 * PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION 
8
 * WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION. 
9
 *
10
 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, 
11
 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND 
12
 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS 
13
 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.  TO THE 
14
 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS 
15
 * IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF 
16
 * ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
17
 *
18
 * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE 
19
 * TERMS. 
20
 */
21
22
/* 
23
 * File:   defValues.h
24
 * Author: Enzo Niro
25
 * Comments: Defitions values for every default variables/registers/ect...
26
 * Revision history: 1.0
27
 */
28
29
// This is a guard condition so that contents of this file are not included
30
// more than once.  
31
#ifndef APP_DEF_VALUES_H
32
#define        APP_DEF_VALUES_H
33
34
#include <xc.h> // include processor files - each processor file is guarded.  
35
36
#define ENABLE_BIT  1
37
38
//ADC definitions
39
#define ADC_PGA_BIAS    0x00 //Set PGA BIAS -> We must set CLK_ADC less than 6MHz
40
#define ADC_PGA_SMD     0x02  //Set PGA SAMPDUR -> We must set CLK_ADC less than 6MHz
41
42
//PGA gains
43
enum ADCPGAGain
44
{
45
    ADC_PGA_1X = 0,
46
    ADC_PGA_2X,
47
    ADC_PGA_4X,
48
    ADC_PGA_8X,
49
    ADC_PGA_16X,
50
};
51
52
53
#define ADC_VIA_DIRECT  0x00 //Analog input linked direct to ADC
54
#define ADC_VIA_PGA     0x01 //Analog input linked to PGA
55
56
enum ADCMUXPOS
57
{
58
    ADC_MUX_DEFAULT = 0,
59
    ADC_MUX_AIN1,
60
    ADC_MUX_AIN2,
61
    ADC_MUX_AIN3,
62
    ADC_MUX_AIN4,
63
    ADC_MUX_AIN5,
64
    ADC_MUX_AIN6,
65
    ADC_MUX_AIN7,
66
    ADC_MUX_AIN8,
67
    ADC_MUX_AIN9,
68
    ADC_MUX_AIN10,
69
    ADC_MUX_AIN11,
70
    ADC_MUX_AIN12,
71
    ADC_MUX_AIN13,
72
    ADC_MUX_AIN14,
73
    ADC_MUX_AIN15,
74
    ADC_MUX_GND = 30,
75
    ADC_MUX_VDDDIV10,
76
    ADC_MUX_TEMPSENSE,
77
    ADC_MUX_DACREF0,
78
};
79
80
81
enum ADCMUXNEG
82
{
83
    ADC_MUXN_DEFAULT = 0,
84
    ADC_MUXN_AIN1,
85
    ADC_MUXN_AIN2,
86
    ADC_MUXN_AIN3,
87
    ADC_MUXN_AIN4,
88
    ADC_MUXN_AIN5,
89
    ADC_MUXN_AIN6,
90
    ADC_MUXN_AIN7,
91
    ADC_MUXN_AIN8,
92
    ADC_MUXN_AIN9,
93
    ADC_MUXN_AIN10,
94
    ADC_MUXN_AIN11,
95
    ADC_MUXN_AIN12,
96
    ADC_MUXN_AIN13,
97
    ADC_MUXN_AIN14,
98
    ADC_MUXN_AIN15,
99
    ADC_MUXN_GND = 30,
100
    ADC_MUXN_VDDDIV10,
101
    ADC_MUXN_TEMPSENSE,
102
    ADC_MUXN_DACREF0,
103
};
104
105
//ADC operation mode
106
#define ADC_SINGLE_8BIT     0x00
107
#define ADC_SINGLE_12BIT     0x01
108
109
#endif        /* XC_HEADER_TEMPLATE_H */