Subversion Repositories HomeAutomation

Rev

Rev 359 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

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