Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
152 Kevin 1
#ifndef DEFINES_H
2
#define	DEFINES_H
3
 
4
#define UART1_RX_TO_BUFFER
5
//#define UART1_RX_TO_XBEE
6
 
7
#define _DEBUG
155 Kevin 8
 
152 Kevin 9
//#define _TEST_UART
10
//#define _TEST_I2C_MASTER
11
//#define _TEST_I2C_SLAVE
12
//#define _TEST_SPI
13
//#define _TEST_NFC
14
//#define _TEST_LED_BACKPACK
15
//#define _TEST_SSD1306_OLED
16
//#define _TEST_SSD1331_OLED
155 Kevin 17
//#define _TEST_TIMER1_RTC
18
//#define _TEST_LUX
19
//#define _TEST_OLED_CHAR
20
//#define _TEST_NFC_TO_SSD1306_OLED
21
//#define _TEST_LUX_TO_CHAR_OLED
152 Kevin 22
//#define _TEST_ADC
157 Kevin 23
//#define _TEST_BMP
24
//#define _TEST_XBEE
152 Kevin 25
 
155 Kevin 26
 
27
 
28
 
29
//#define _TEST_BMP
30
 
152 Kevin 31
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
32
#ifdef _DEBUG
33
#define DBG_PRINT_MAIN UART1_WriteS
155 Kevin 34
#define DBG_PRINT_UART UART1_WriteS
35
#define DBG_PRINT_I2C UART1_WriteS
36
#define DBG_PRINT_SPI UART1_WriteS
37
#define DBG_PRINT_XBEE UART1_WriteS
38
#define DBG_PRINT_PORTB_INT
39
#define DBG_PRINT_INT
40
#define DBG_PRINT_LUX
41
#define DBG_PRINT_BMP
152 Kevin 42
#else
155 Kevin 43
#define DBG_PRINT_MAIN
44
#define DBG_PRINT_UART
45
#define DBG_PRINT_I2C
46
#define DBG_PRINT_SPI
47
#define DBG_PRINT_XBEE
48
#define DBG_PRINT_PORTB_INT
49
#define DBG_PRINT_INT
50
#define DBG_PRINT_LUX
51
#define DBG_PRINT_BMP
152 Kevin 52
#endif
53
 
54
// Pin allocations
55
#define UART1_RX_TRIS           TRISCbits.TRISC7
56
#define UART1_TX_TRIS           TRISCbits.TRISC6
57
 
58
#define I2C_CLK_TRIS            TRISCbits.TRISC3
59
#define I2C_DAT_TRIS            TRISCbits.TRISC4
60
 
61
#define LED_BLUE_TRIS           TRISCbits.TRISC5
62
#define LED_BLUE_LAT            LATCbits.LATC5
63
#define LED_RED_TRIS            TRISCbits.TRISC2
64
#define LED_RED_LAT             LATCbits.LATC2
65
 
66
#define ADC_AN0_TRIS            TRISAbits.TRISA0
67
#define ADC_AN1_TRIS            TRISAbits.TRISA1
68
#define ADC_AN2_TRIS            TRISAbits.TRISA2
69
 
70
#define XBEE_CTS_TRIS           TRISBbits.TRISB0
71
#define XBEE_CTS_LAT            LATBbits.LATB0
72
#define XBEE_CTS_PORT           PORTBbits.RB0
73
#define XBEE_RTS_TRIS           TRISBbits.TRISB1
74
#define XBEE_RTS_LAT            LATBbits.LATB1
75
 
76
#define SPI_MOSI_TRIS           TRISBbits.TRISB0
77
#ifndef SPI2_WRITE_ONLY
78
#define SPI_MISO_TRIS           TRISBbits.TRISB0
79
#endif
80
#define SPI_CLK_TRIS            TRISAbits.TRISA0
81
#define SPI_DC_SELECT_TRIS      TRISAbits.TRISA1
82
#define SPI_DC_SELECT_LAT       LATAbits.LATA1
83
#define SPI_RESET_TRIS          TRISAbits.TRISA2
84
#define SPI_RESET_LAT           LATAbits.LATA2
85
#define SPI_SLAVE_SELECT_TRIS   TRISAbits.TRISA3
86
#define SPI_SLAVE_SELECT_LAT    LATAbits.LATA3
87
 
88
#define PARALLEL_RS_TRIS        TRISBbits.TRISB7
89
#define PARALLEL_RS_LAT         LATBbits.LATB7
90
#define PARALLEL_RW_TRIS        TRISBbits.TRISB6
91
#define PARALLEL_RW_LAT         LATBbits.LATB6
92
#define PARALLEL_EN_TRIS        TRISBbits.TRISB5
93
#define PARALLEL_EN_LAT         LATBbits.LATB5
94
#define PARALLEL_D4_TRIS        TRISBbits.TRISB4
95
#define PARALLEL_D4_LAT         LATBbits.LATB4
96
#define PARALLEL_D5_TRIS        TRISBbits.TRISB3
97
#define PARALLEL_D5_LAT         LATBbits.LATB3
98
#define PARALLEL_D6_TRIS        TRISBbits.TRISB2
99
#define PARALLEL_D6_LAT         LATBbits.LATB2
100
#define PARALLEL_D7_TRIS        TRISBbits.TRISB1
101
#define PARALLEL_D7_LAT         LATBbits.LATB1
102
#define PARALLEL_BUSY_TRIS      TRISBbits.TRISB1
103
#define PARALLEL_BUSY_PORT      PORTBbits.RB1
104
 
105
#define NFC_IRQ_TRIS            TRISAbits.TRISA5
106
#define NFC_IRQ_PORT            PORTAbits.RA5
107
//#define NFC_RESET_TRIS          TRISCbits.TRISC2
108
//#define NFC_RESET_LAT           LATCbits.LATC2
109
 
110
// PPS bindings (RP Pins)
111
#define PPS_SPI2_CLK_IN         0       // A0
112
#define PPS_SPI2_CLK_OUT        RPOR0   // A0
113
#define PPS_SPI2_MOSI           RPOR3   // B0
114
#ifndef SPI2_WRITE_ONLY
115
#define PPS_SPI2_MISO           3       // NA
116
#endif
117
 
118
//#define PPS_UART2_RX            5
119
//#define PPS_UART2_TX            RPOR6
120
 
121
#endif	/* DEFINES_H */
122