Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
129 johboh 1
/*********************************************************************
2
 *
3
 *                  Compiler specifics like clockspeed and portIOs.
4
 *
5
 *********************************************************************
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canLCD/Include/compiler.h $
7
 * Last changed:    $LastChangedDate: 2007-03-04 14:49:20 +0100 (Sun, 04 Mar 2007) $
8
 * By:              $LastChangedBy: johboh $
9
 * Revision:        $Revision: 358 $
10
 ********************************************************************/
11
 
12
#ifndef COMPILER_H
13
#define COMPILER_H
14
 
358 johboh 15
#define APP_VERSION 0x0001
16
 
17
 
129 johboh 18
#include <p18cxxx.h>
19
#define CLOCK_FREQ      (40000000)      // Hz
20
#define INSTR_FREQ          (CLOCK_FREQ/4)
21
#define CLOCK_FOSC      (40)      // MHz
140 johboh 22
#define NUM_CYK_1us     10
23
#define NUM_CYK_1ms     10000
129 johboh 24
 
358 johboh 25
#define LED0_IO         (PORTCbits.RC1)
129 johboh 26
#define LED0_TRIS       (TRISCbits.TRISC1)
27
 
357 johboh 28
// GLCD
358 johboh 29
#define GLCD_CS_IO      (PORTCbits.RC0)
30
#define GLCD_CS_TRIS    (TRISCbits.TRISC0)
31
#define GLCD_RES_IO     (PORTCbits.RC7)
32
#define GLCD_RES_TRIS   (TRISCbits.TRISC7)
33
#define GLCD_A0_IO      (PORTCbits.RC1)
34
#define GLCD_A0_TRIS    (TRISCbits.TRISC1)
35
#define GLCD_SCL_IO     (PORTCbits.RC3)
36
#define GLCD_SCL_TRIS   (TRISCbits.TRISC3)
37
#define GLCD_SI_IO      (PORTCbits.RC5)
38
#define GLCD_SI_TRIS    (TRISCbits.TRISC5)
357 johboh 39
 
358 johboh 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
 
70
 
140 johboh 71
// LCD
357 johboh 72
/*
140 johboh 73
#define LCD_DATA_4_TRIS (PORTCbits.RC0)
74
#define LCD_DATA_4_IO   (TRISCbits.TRISC0)
75
#define LCD_DATA_5_TRIS (PORTCbits.RC1)
76
#define LCD_DATA_5_IO   (TRISCbits.TRISC1)
77
#define LCD_DATA_6_TRIS (PORTCbits.RC2)
78
#define LCD_DATA_6_IO   (TRISCbits.TRISC2)
79
#define LCD_DATA_7_TRIS (PORTCbits.RC3)
80
#define LCD_DATA_7_IO   (TRISCbits.TRISC3)
129 johboh 81
 
140 johboh 82
#define LCD_RS_TRIS (PORTAbits.RA4)
83
#define LCD_RS_IO   (TRISAbits.TRISA4)
84
#define LCD_EN_TRIS (PORTAbits.RA5)
85
#define LCD_EN_IO   (TRISAbits.TRISA5)
86
 
87
#define LCD_LINE1 0
88
#define LCD_LINE2 40
89
#define LCD_LINE_LENGTH 24
357 johboh 90
*/
140 johboh 91
 
358 johboh 92
#define TEMPERATURE_OUTSIDE 0x0
357 johboh 93
 
94
 
358 johboh 95
 
96
 
129 johboh 97
#endif //compiler.h