Subversion Repositories HomeAutomation

Rev

Rev 357 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 357 Rev 358
Line 2... Line 2...
2
 *
2
 *
3
 *                  Compiler specifics like clockspeed and portIOs.
3
 *                  Compiler specifics like clockspeed and portIOs.
4
 *
4
 *
5
 *********************************************************************
5
 *********************************************************************
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canLCD/Include/compiler.h $
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canLCD/Include/compiler.h $
7
 * Last changed:    $LastChangedDate: 2007-03-04 12:01:27 +0100 (Sun, 04 Mar 2007) $
7
 * Last changed:    $LastChangedDate: 2007-03-04 14:49:20 +0100 (Sun, 04 Mar 2007) $
8
 * By:              $LastChangedBy: johboh $
8
 * By:              $LastChangedBy: johboh $
9
 * Revision:        $Revision: 357 $
9
 * Revision:        $Revision: 358 $
10
 ********************************************************************/
10
 ********************************************************************/
11
 
11
 
12
#ifndef COMPILER_H
12
#ifndef COMPILER_H
13
#define COMPILER_H
13
#define COMPILER_H
-
 
14
 
-
 
15
#define APP_VERSION 0x0001
-
 
16
 
14
 
17
 
15
#include <p18cxxx.h>
18
#include <p18cxxx.h>
16
#define CLOCK_FREQ      (40000000)      // Hz
19
#define CLOCK_FREQ      (40000000)      // Hz
17
#define INSTR_FREQ          (CLOCK_FREQ/4)
20
#define INSTR_FREQ          (CLOCK_FREQ/4)
18
#define CLOCK_FOSC      (40)      // MHz
21
#define CLOCK_FOSC      (40)      // MHz
19
#define NUM_CYK_1us     10
22
#define NUM_CYK_1us     10
20
#define NUM_CYK_1ms     10000
23
#define NUM_CYK_1ms     10000
21
 
24
 
22
#define LED0_TRIS       (TRISCbits.TRISC1)
-
 
23
#define LED0_IO         (PORTCbits.RC1)
25
#define LED0_IO         (PORTCbits.RC1)
-
 
26
#define LED0_TRIS       (TRISCbits.TRISC1)
24
 
27
 
25
// GLCD
28
// GLCD
26
#define GLCD_CS_TRIS (PORTCbits.RC0)
29
#define GLCD_CS_IO      (PORTCbits.RC0)
27
#define GLCD_CS_IO  (TRISCbits.TRISC0)
30
#define GLCD_CS_TRIS    (TRISCbits.TRISC0)
28
#define GLCD_RES_TRIS (PORTCbits.RC1)
31
#define GLCD_RES_IO     (PORTCbits.RC7)
29
#define GLCD_RES_IO     (TRISCbits.TRISC1)
32
#define GLCD_RES_TRIS   (TRISCbits.TRISC7)
30
#define GLCD_A0_TRIS (PORTCbits.RC2)
33
#define GLCD_A0_IO      (PORTCbits.RC1)
31
#define GLCD_A0_IO  (TRISCbits.TRISC2)
34
#define GLCD_A0_TRIS    (TRISCbits.TRISC1)
32
#define GLCD_SCL_TRIS (PORTCbits.RC3)
35
#define GLCD_SCL_IO     (PORTCbits.RC3)
33
#define GLCD_SCL_IO     (TRISCbits.TRISC3)
36
#define GLCD_SCL_TRIS   (TRISCbits.TRISC3)
34
#define GLCD_SI_TRIS (PORTCbits.RC5)
37
#define GLCD_SI_IO      (PORTCbits.RC5)
35
#define GLCD_SI_IO  (TRISCbits.TRISC5)
38
#define GLCD_SI_TRIS    (TRISCbits.TRISC5)
-
 
39
 
-
 
40
#define GLCD_BAL_IO     (PORTCbits.RC2)
-
 
41
#define GLCD_BAL_TRIS   (TRISCbits.TRISC2)
-
 
42
 
-
 
43
// Rotary, Rotary switch, switch
-
 
44
#define ROTARY_A_IO     (PORTBbits.RB4)
-
 
45
#define ROTARY_A_TRIS   (TRISBbits.TRISB4)   // RB0
-
 
46
#define ROTARY_B_IO     (PORTBbits.RB5)
-
 
47
#define ROTARY_B_TRIS   (TRISBbits.TRISB5)
-
 
48
 
-
 
49
#define ROTARY_SW_IO    (PORTAbits.RA4)
-
 
50
#define ROTARY_SW_TRIS  (TRISAbits.TRISA4)   // RB1
-
 
51
#define SW0_IO          (PORTAbits.RA5)
-
 
52
#define SW0_TRIS        (TRISAbits.TRISA5)
-
 
53
 
-
 
54
// door
-
 
55
#define SW1_IO          (PORTAbits.RA2)     // Poll
-
 
56
#define SW1_TRIS        (TRISAbits.TRISA2)
-
 
57
 
-
 
58
// VREF, temp
-
 
59
#define VREF_IO         (PORTAbits.RA3)
-
 
60
#define VREF_TRIS       (TRISAbits.TRISA3)
-
 
61
#define TEMP_IO         (PORTAbits.RA0)
-
 
62
#define TEMP_TRIS       (TRISAbits.TRISA0)
-
 
63
 
-
 
64
// EE
-
 
65
#define EE_CS_IO        (PORTCbits.RC6)
-
 
66
#define EE_CS_TRIS      (TRISCbits.TRISC6)
-
 
67
#define EE_SI_IO        (PORTCbits.RC4)
-
 
68
#define EE_SI_TRIS      (TRISCbits.TRISC4)
-
 
69
 
36
 
70
 
37
// LCD
71
// LCD
38
/*
72
/*
39
#define LCD_DATA_4_TRIS (PORTCbits.RC0)
73
#define LCD_DATA_4_TRIS (PORTCbits.RC0)
40
#define LCD_DATA_4_IO   (TRISCbits.TRISC0)
74
#define LCD_DATA_4_IO   (TRISCbits.TRISC0)
41
#define LCD_DATA_5_TRIS (PORTCbits.RC1)
75
#define LCD_DATA_5_TRIS (PORTCbits.RC1)
Line 47... Line 81...
47
 
81
 
48
#define LCD_RS_TRIS (PORTAbits.RA4)
82
#define LCD_RS_TRIS (PORTAbits.RA4)
49
#define LCD_RS_IO   (TRISAbits.TRISA4)
83
#define LCD_RS_IO   (TRISAbits.TRISA4)
50
#define LCD_EN_TRIS (PORTAbits.RA5)
84
#define LCD_EN_TRIS (PORTAbits.RA5)
51
#define LCD_EN_IO   (TRISAbits.TRISA5)
85
#define LCD_EN_IO   (TRISAbits.TRISA5)
52
 
86
 
53
#define LCD_LINE1 0
87
#define LCD_LINE1 0
54
#define LCD_LINE2 40
88
#define LCD_LINE2 40
55
#define LCD_LINE_LENGTH 24
89
#define LCD_LINE_LENGTH 24
56
*/
90
*/
57
 
91
 
58
#define APP_VERSION 0x0002
92
#define TEMPERATURE_OUTSIDE 0x0
-
 
93
 
-
 
94
 
59
 
95
 
60
 
96
 
61
#endif //compiler.h
97
#endif //compiler.h