doxytest
Definitions.h
Go to the documentation of this file.
1 /*===========================================================================================*/
2 /*
3 01_D�finitions.h
4 Manuel Tschumi
5 5 12 2007
6 12 12 2007(derni�re modif.)
7 
8 Contient toutes les d�finitions globales
9 
10 */
11 /*===========================================================================================*/
12 #ifndef Definitionh
13 #define Definitionh
14 
15 //#define CAN_PARA_MEM
16 
17 
18 //#define VERSION 0x5010001 //Carte uC V4 Rumine
19 //#define VERSION 0x8010001 //Carte uC_V5 petit EPFL IP ...56.50 CH G1 581
20 //#define VERSION 0x8020002 //Carte uC_V5 petit, smd EPFL
21 //#define VERSION 0x9010001 //LS 1 IP ...56.12 CH G1 581
22 //#define VERSION 0x9010002 //LS 2 IP ...56.13 CH G1 581
23 //#define VERSION 0x9010003 //LS 3 IP ...16.195 CH G1 581
24 //#define VERSION 0x9010003 //PS 3 IP ...16.54 CH F1 502
25 //#define VERSION 0xA010001 //IV 1 ! 6 Cellules
26 //#define VERSION 0xA030002 //IV 2
27 //#define VERSION 0xB010001 //Carte Server mini !!!!!!!!!!!!! Ne pas oublier de mettre uC 64 pin
28 //#define VERSION 0xC010001 //Meteo
29 #define VERSION 0xD010001 //Ecran
30 //#define VERSION 0xE010001 //
31 
32 //#define VERSION 0x10010001 //Vérsion(FF), Révision (FF), No (FFFF)
33 /*
34 0x1000000 Carte uC_V1
35 0x2000000 Carte uC_V2
36 0x3000000 Carte uC_V3 connecteur
37 0x4000000 Carte uC_V3 petit
38 0x5000000 Carte uC_V4
39 0x6000000 Carte uC_V4 petit
40 0x7000000 Carte uC_V5
41 0x8000000 Carte uC_V5 petit
42 0x9000000 LS
43 0xA000000 IV
44 0xA000000 Server Mini
45 */
46 
47 // Resistance du fil entre le PCB et la sonde PT1000
48 #define R_FIL_PT1 0.0000 //0.1=1kohm
49 #define R_FIL_PT2 0.0005
50 
51 
52 #define ANC_ON
53 #if ((VERSION&0xFF000000)==0xD000000)
54  #define ECR_ON
55  #define SVN_ON
56 #endif
57 #if ((VERSION&0xFF000000)==0xB000000)
58  #define SVN_ON
59 #endif
60 #define CLAVIER_ON
61 
62 #define AUTO_OSCTUN //Pour ajuster la fr�quence du bus dans le 1% (A utiliser pour protocol CAN)
63 //#define PIC32MX795F512L //100 PINs
64 
65 //#define CAN_SCAN
66 #ifdef CAN_SCAN
67  #define BRG_CAN_INI 3
68 #else
69  #define BRG_CAN_INI 3
70 #endif
71 /*
72  brg @ case_f=11 = f_bus=20 Mhz
73  Value brg F
74  * 0 0 1 Mhz
75  * 1 1 500 kHz
76  * 2 3 250 kHz
77  * 3 7 125 kHz
78  * 4 15 62.5 kHz
79  * 5 31 31.25 kHz
80  * 6 63 15.625 kHz ! Risque de disfonctionnement
81  */
82 #define CASE_F_INI 9
83 /*
84 case f F_bus can value (from to)
85  * 0 16khz Not suported Cristal
86  * 1 16khz Not suported LPRC
87  * 2 15.625khzNot suported FRC/256
88  * 3 62.5khz Not suported FRC/64
89  * 4 125khz Not suported FRC/32
90  * 5 250khz 6 6 FRC/16
91  * 6 500khz 5 6 FRC/8
92  * 7 1Mhz 4 6 FRC/4
93  * 8 2Mhz 3 6 FRC/2
94  * 9 4Mhz 2 6 FRC
95  * 10 10Mhz 1 6 PLL
96  * 11 20Mhz 0 6 PLL
97  * 12 40Mhz 0 5 PLL
98  * 13 48Mhz Not suported PLL
99  */
100 
101 //#define BRG_CAN_INI 1
102 //#define CASE_F_INI 10
103 
104 /*
105 SPI correspondance et vecteur
106 
107 1 1 23 ! Pas présent pour uC 64 pin
108 2 2A 31
109 3 1A 24
110 4 3A 32
111 
112 */
113 
114 
115 
116 
117  #define ADC_mSPIxINT_VECTOR 24
118  #define ADC_mSPIxINT_PRIORITY_F ipl4
119  #define ADC_mSPIxINT_PRIORITY 4
120  #define ADC_mSPIxINT_SUBPRIORITY 1
121 
122  #define ADC_mSPIxIntDisable mSPI1AIntDisable
123  #define ADC_SPIxCON SPI1ACON
124  #define ADC_SPIxBUF SPI1ABUF
125  #define ADC_SPIxSTATCLR SPI1ASTATCLR
126  #define ADC_mSPIxClearAllIntFlags mSPI1AClearAllIntFlags
127  #define ADC_mSPIxSetIntPriority mSPI1ASetIntPriority
128  #define ADC_mSPIxSetIntSubPriority mSPI1ASetIntSubPriority
129  #define ADC_mSPIxRXIntEnable mSPI1ARXIntEnable
130  #define ADC_SPIxCONSET SPI1ACONSET
131  #define ADC_SPIxBRG SPI1ABRG
132 
133  #define ADC_SPIxCONCLR SPI1ACONCLR
134  #define ADC_mSPIxRXClearIntFlag mSPI1ARXClearIntFlag
135  #define ADC_SPIxSTATbits SPI1ASTATbits
136 
137 #if defined ECR_ON
138  #define ECR_mSPIxINT_VECTOR 31
139  #define ECR_mSPIxINT_PRIORITY_F ipl1
140  #define ECR_mSPIxINT_PRIORITY 1
141  #define ECR_mSPIxINT_SUBPRIORITY 1
142 
143  #define ECR_mSPIxIntDisable mSPI2AIntDisable
144  #define ECR_SPIxCON SPI2ACON
145  #define ECR_SPIxBUF SPI2ABUF
146  #define ECR_SPIxSTATCLR SPI2ASTATCLR
147  #define ECR_mSPIxClearAllIntFlags mSPI2AClearAllIntFlags
148  #define ECR_mSPIxSetIntPriority mSPI2ASetIntPriority
149  #define ECR_mSPIxSetIntSubPriority mSPI2ASetIntSubPriority
150  #define ECR_mSPIxRXIntEnable mSPI2ARXIntEnable
151  #define ECR_SPIxCONSET SPI2ACONSET
152  #define ECR_SPIxBRG SPI2ABRG
153  #define ECR_SPIxCONCLR SPI2ACONCLR
154  #define ECR_mSPIxRXClearIntFlag mSPI2ARXClearIntFlag
155  #define ECR_SPIxSTATbits SPI2ASTATbits
156  #define ECR_mSPIxRXClearIntFlag mSPI2ARXClearIntFlag
157 #endif
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170  #define CAN_STBY _RD10
171  #define CAN_STBY_Dir _TRISD10
172  #define CAN_STBY_P 4
173  #define CAN_STBY_O 10
174  #define CAN_STBY_PO ((CAN_STBY_P<<8)+CAN_STBY_O)
175 
176  #define CARD_BUTTON _RE8
177  #define CARD_BUTTON_Dir _TRISE8
178  #define CARD_BUTTON_P 5
179  #define CARD_BUTTON_O 8
180  #define CARD_BUTTON_PO ((CARD_BUTTON_P<<8)+CARD_BUTTON_O)
181 
182  #define LED_INT _RC13
183  #define LED_INT_Dir _TRISC13
184  #define LED_INT_P 3
185  #define LED_INT_O 13
186  #define LED_INT_PO ((LED_INT_P<<8)+LED_INT_O)
187 
188  #define SNUM_1 _RD8
189  #define SNUM_1_Dir _TRISD8
190  #define SNUM_1_P 4
191  #define SNUM_1_O 8
192  #define SNUM_1_PO ((SNUM_1_P<<8)+SNUM_1_O)
193 
194  #define SNUM_2 _RD9
195  #define SNUM_2_Dir _TRISD9
196  #define SNUM_2_P 4
197  #define SNUM_2_O 9
198  #define SNUM_2_PO ((SNUM_2_P<<8)+SNUM_2_O)
199 
200 #if ((VERSION&0xFF000000)==0xD000000)
201  //Pin
202  //Allimente clavier, incr�mentateur
203  #define Clav_ON temp_port
204  #define Clav_ON_Dir temp_port
205  #define Clav_ON_OC temp_port
206  #define Clav_ON_P 0
207  #define Clav_ON_O 0
208  #define Clav_ON_PO ((Clav_ON_P<<8)+Clav_ON_O)
209  //Pin 42
210  #define Clav_I _RD8
211  #define Clav_I_Dir _TRISD8
212  #define Clav_I_P 4
213  #define Clav_I_O 8
214  #define Clav_I_PO ((Clav_I_P<<8)+Clav_I_O)
215  //Pin 43
216  #define Clav_CLK _RD9
217  #define Clav_CLK_Dir _TRISD9
218  #define Clav_CLK_P 4
219  #define Clav_CLK_O 9
220  #define Clav_CLK_PO ((Clav_CLK_P<<8)+Clav_CLK_O)
221 
222  //Pin 1
223  #define LCD_AO _RE5
224  #define LCD_AO_Dir _TRISE5
225  #define LCD_AO_P 5
226  #define LCD_AO_O 5
227  #define LCD_AO_PO ((LCD_AO_P<<8)+LCD_AO_O)
228  //Pin 3
229  #define LCD_CS _RE7
230  #define LCD_CS_Dir _TRISE7
231  #define LCD_CS_P 5
232  #define LCD_CS_O 7
233  #define LCD_CS_PO ((LCD_CS_P<<8)+LCD_CS_O)
234  //Pin 2
235  #define LCD_RST _RE6
236  #define LCD_RST_Dir _TRISE6
237  #define LCD_RST_P 5
238  #define LCD_RST_O 6
239  #define LCD_RST_PO ((LCD_RST_P<<8)+LCD_RST_O)
240  //Pin 64
241  #define LCD_RETRO _RE4
242  #define LCD_RETRO_Dir _TRISE4
243  #define LCD_RETRO_P 5
244  #define LCD_RETRO_O 4
245  #define LCD_RETRO_PO ((LCD_RETRO_P<<8)+LCD_RETRO_O)
246 #else
247  #ifdef CLAVIER_ON
248  //Pin
249  //Allimente clavier, incr�mentateur
250  #define Clav_ON temp_port
251  #define Clav_ON_Dir temp_port
252  #define Clav_ON_OC temp_port
253  #define Clav_ON_P 0
254  #define Clav_ON_O 0
255  #define Clav_ON_PO ((Clav_ON_P<<8)+Clav_ON_O)
256  //Pin 42
257  #define Clav_I _RD8
258  #define Clav_I_Dir _TRISD8
259  #define Clav_I_P 4
260  #define Clav_I_O 8
261  #define Clav_I_PO ((Clav_I_P<<8)+Clav_I_O)
262  //Pin 43
263  #define Clav_CLK _RD9
264  #define Clav_CLK_Dir _TRISD9
265  #define Clav_CLK_P 4
266  #define Clav_CLK_O 9
267  #define Clav_CLK_PO ((Clav_CLK_P<<8)+Clav_CLK_O)
268 
269  #endif
270 #endif
271 
272 
273  /*I/O NUMERIQUE*/
274 
275  //Pin 6
276  #define EXT1 temp_port
277  #define EXT1_Dir temp_port
278  #define EXT1_P 0
279  #define EXT1_O 0
280 
281  //Pin 7
282  #define EXT2 temp_port
283  #define EXT2_Dir temp_port
284  #define EXT2_P 0
285  #define EXT2_O 0
286 /*
287  //Pin 56
288  #define EXT3 temp_port
289  #define EXT3_Dir temp_port
290  #define EXT3_P 0
291  #define EXT3_O 0
292 
293  //Pin 18
294  #define EXT4 temp_port
295  #define EXT4_Dir temp_port
296  #define EXT4_P 0
297  #define EXT4_O 0
298 
299  //Pin 19
300  #define EXT5 _RE9
301  #define EXT5_Dir _TRISE9
302  #define EXT5_P 5
303  #define EXT5_O 9
304  //Pin 66
305  #define EXT6 _RA14
306  #define EXT6_Dir _TRISA14
307  #define EXT6_P 1
308  #define EXT6_O 14
309  //Pin 68
310  #define EXT7 _RD8
311  #define EXT7_Dir _TRISD8
312  #define EXT7_P 4
313  #define EXT7_O 8
314  //Pin 71
315  #define EXT8 _RD11
316  #define EXT8_Dir _TRISD11
317  #define EXT8_P 4
318  #define EXT8_O 11
319  //Pin 79
320  #define EXT9 _RD12
321  #define EXT9_Dir _TRISD12
322  #define EXT9_P 4
323  #define EXT9_O 12
324  //Pin 80
325  #define EXT10 _RD13
326  #define EXT10_Dir _TRISD13
327  #define EXT10_CN CNENbits.CNEN19
328  #define EXT10_P 4
329  #define EXT10_O 13
330  //Pin 82
331  #define EXT11 _RD5
332  #define EXT11_Dir _TRISD5
333  #define EXT11_P 4
334  #define EXT11_O 5
335  //Pin 83
336  #define EXT12 _RD6
337  #define EXT12_Dir _TRISD6
338  #define EXT12_P 4
339  #define EXT12_O 6
340 */
341 
342 
343  //Pin 1
344  #define DAC_CS1 temp_port
345  #define DAC_CS1_Dir temp_port
346  #define DAC_CS1_P 0
347  #define DAC_CS1_O 0
348  #define DAC_CS1_PO ((DAC_CS1_P<<8)+DAC_CS1_O)
349  //Pin 3
350  #define DAC_CS2 temp_port
351  #define DAC_CS2_Dir temp_port
352  #define DAC_CS2_P 0
353  #define DAC_CS2_O 0
354  #define DAC_CS2_PO ((DAC_CS2_P<<8)+DAC_CS2_O)
355  //Pin 4
356  #define DAC_CS3 temp_port
357  #define DAC_CS3_Dir temp_port
358  #define DAC_CS3_P 0
359  #define DAC_CS3_O 0
360  #define DAC_CS3_PO ((DAC_CS3_P<<8)+DAC_CS3_O)
361 
362 
363  //Pin 87
364  #define ADC_CS1 _RE5
365  #define ADC_CS1_Dir _TRISE5
366  #define ADC_CS1_P 5
367  #define ADC_CS1_O 5
368  #define ADC_CS1_PO ((ADC_CS1_P<<8)+ADC_CS1_O)
369  //Pin 88
370  #define ADC_CS2 _RE6
371  #define ADC_CS2_Dir _TRISE6
372  #define ADC_CS2_P 5
373  #define ADC_CS2_O 6
374  #define ADC_CS2_PO ((ADC_CS2_P<<8)+ADC_CS2_O)
375  //Pin 91
376  #define ADC_CS3 _RG9
377  #define ADC_CS3_Dir _TRISG9
378  #define ADC_CS3_P 7
379  #define ADC_CS3_O 9
380  #define ADC_CS3_PO ((ADC_CS3_P<<8)+ADC_CS3_O)
381  //Pin 92
382  #define ADC_CS4 temp_port
383  #define ADC_CS4_Dir temp_port
384  #define ADC_CS4_P 0
385  #define ADC_CS4_O 0
386  #define ADC_CS4_PO ((ADC_CS4_P<<8)+ADC_CS4_O)
387  //Pin 93
388  #define ADC_CS5 _RE4
389  #define ADC_CS5_Dir _TRISE4
390  #define ADC_CS5_P 5
391  #define ADC_CS5_O 4
392  #define ADC_CS5_PO ((ADC_CS5_P<<8)+ADC_CS5_O)
393  //Pin 94
394  #define ADC_CS6 _RE3
395  #define ADC_CS6_Dir _TRISE3
396  #define ADC_CS6_P 5
397  #define ADC_CS6_O 3
398  #define ADC_CS6_PO ((ADC_CS6_P<<8)+ADC_CS6_O)
399  //Pin 97
400  #define ADC_CS7 _RE2
401  #define ADC_CS7_Dir _TRISE2
402  #define ADC_CS7_P 5
403  #define ADC_CS7_O 2
404  #define ADC_CS7_PO ((ADC_CS7_P<<8)+ADC_CS7_O)
405  //Pin 98
406  #define ADC_CS8 _RE1
407  #define ADC_CS8_Dir _TRISE1
408  #define ADC_CS8_P 5
409  #define ADC_CS8_O 1
410  #define ADC_CS8_PO ((ADC_CS8_P<<8)+ADC_CS8_O)
411  //Pin 99
412  #define ADC_CS9 _RD5
413  #define ADC_CS9_Dir _TRISD5
414  #define ADC_CS9_P 4
415  #define ADC_CS9_O 5
416  #define ADC_CS9_PO ((ADC_CS9_P<<8)+ADC_CS9_O)
417  //Pin 100
418  #define ADC_CS10 _RD7
419  #define ADC_CS10_Dir _TRISD7
420  #define ADC_CS10_P 4
421  #define ADC_CS10_O 7
422  #define ADC_CS10_PO ((ADC_CS10_P<<8)+ADC_CS10_O)
423  //Pin 99
424  #define ADC_CS11 _RD6
425  #define ADC_CS11_Dir _TRISD6
426  #define ADC_CS11_P 4
427  #define ADC_CS11_O 6
428  #define ADC_CS11_PO ((ADC_CS11_P<<8)+ADC_CS11_O)
429  //Pin 100
430  #define ADC_CS12 temp_port
431  #define ADC_CS12_Dir temp_port
432  #define ADC_CS12_P 0
433  #define ADC_CS12_O 0
434  #define ADC_CS12_PO ((ADC_CS12_P<<8)+ADC_CS12_O)
435 
436 
437  #define ADC_CS13 temp_port
438  #define ADC_CS13_Dir temp_port
439  #define ADC_CS13_P 0
440  #define ADC_CS13_O 0
441  #define ADC_CS13_PO ((ADC_CS13_P<<8)+ADC_CS13_O)
442 
443  #define ADC_CS14 temp_port
444  #define ADC_CS14_Dir temp_port
445  #define ADC_CS14_P 0
446  #define ADC_CS14_O 0
447  #define ADC_CS14_PO ((ADC_CS14_P<<8)+ADC_CS14_O)
448 
449  #define ADC_CS15 temp_port
450  #define ADC_CS15_Dir temp_port
451  #define ADC_CS15_P 0
452  #define ADC_CS15_O 0
453  #define ADC_CS15_PO ((ADC_CS15_P<<8)+ADC_CS15_O)
454 
455  #define ADC_CS16 temp_port
456  #define ADC_CS16_Dir temp_port
457  #define ADC_CS16_P 0
458  #define ADC_CS16_O 0
459  #define ADC_CS16_PO ((ADC_CS16_P<<8)+ADC_CS16_O)
460 
461 
462 
463 
464 
465 #endif