Subversion Repositories Code-Repo

Rev

Rev 149 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 150
Line 2... Line 2...
2
#define __maindefs_h
2
#define __maindefs_h
3
 
3
 
4
#include <p18f27j13.h>
4
#include <p18f27j13.h>
5
#include "uart.h"
5
#include "uart.h"
6
 
6
 
7
// Option to enable/disable internal oscillator
-
 
8
#define USE_EXT_OSC
-
 
9
 
-
 
10
// 
-
 
11
#define UART1_RX_TO_BUFFER
7
#define UART1_RX_TO_BUFFER
12
//#define UART1_RX_TO_XBEE
8
//#define UART1_RX_TO_XBEE
13
 
9
 
14
// Option to disable SPI MISO
10
// Option to disable SPI MISO
15
#define SPI2_WRITE_ONLY
11
#define SPI2_WRITE_ONLY
16
 
12
 
17
//#define _DEBUG
13
#define _DEBUG
-
 
14
 
18
//#define _TEST_UART
15
//#define _TEST_UART
19
//#define _TEST_I2C_MASTER
16
//#define _TEST_I2C_MASTER
20
//#define _TEST_I2C_SLAVE
17
//#define _TEST_I2C_SLAVE
21
//#define _TEST_SPI
18
//#define _TEST_SPI
22
//#define _TEST_NFC
19
//#define _TEST_NFC
Line 27... Line 24...
27
//#define _TEST_XBEE
24
//#define _TEST_XBEE
28
//#define _TEST_NFC_TO_SSD1306_OLED
25
//#define _TEST_NFC_TO_SSD1306_OLED
29
//#define _TEST_TIMER1_RTC
26
//#define _TEST_TIMER1_RTC
30
//#define _TEST_LUX
27
//#define _TEST_LUX
31
//#define _TEST_OLED_CHAR
28
//#define _TEST_OLED_CHAR
-
 
29
//#define _TEST_BMP
-
 
30
 
32
 
31
 
33
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
32
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
34
#ifdef _DEBUG
33
#ifdef _DEBUG
35
#define DBG_PRINT_MAIN(x) UART1_WriteS(x)
34
#define DBG_PRINT_MAIN(x) UART1_WriteS(x)
-
 
35
#define DBG_PRINT_MAIN_F(x) UART1_WriteF(x)
36
#define DBG_PRINT_UART(x) UART1_WriteS(x)
36
#define DBG_PRINT_UART(x) UART1_WriteS(x)
37
#define DBG_PRINT_I2C(x) UART1_WriteS(x)
37
#define DBG_PRINT_I2C(x) UART1_WriteS(x)
38
#define DBG_PRINT_SPI(x) UART1_WriteS(x)
38
#define DBG_PRINT_SPI(x) UART1_WriteS(x)
39
#define DBG_PRINT_XBEE(x) UART1_WriteS(x)
39
#define DBG_PRINT_XBEE(x) UART1_WriteS(x)
40
#define DBG_PRINT_PORTB_INT(x)
40
#define DBG_PRINT_PORTB_INT(x)
41
#define DBG_PRINT_INT(x) 
41
#define DBG_PRINT_INT(x) 
42
#define DBG_PRINT_BUFFER(x)
42
#define DBG_PRINT_LUX(x)
43
#define DBG_PRINT_LUX(x) UART1_WriteS(x)
43
#define DBG_PRINT_BMP(x)
44
#else
44
#else
45
#define DBG_PRINT_MAIN(x)
45
#define DBG_PRINT_MAIN(x)
46
#define DBG_PRINT_UART(x)
46
#define DBG_PRINT_UART(x)
47
#define DBG_PRINT_I2C(x)
47
#define DBG_PRINT_I2C(x)
48
#define DBG_PRINT_SPI(x)
48
#define DBG_PRINT_SPI(x)
49
#define DBG_PRINT_XBEE(x)
49
#define DBG_PRINT_XBEE(x)
50
#define DBG_PRINT_PORTB_INT(x)
50
#define DBG_PRINT_PORTB_INT(x)
51
#define DBG_PRINT_INT(x)
51
#define DBG_PRINT_INT(x)
52
#define DBG_PRINT_BUFFER(x)
-
 
53
#define DBG_PRINT_LUX(x)
52
#define DBG_PRINT_LUX(x)
-
 
53
#define DBG_PRINT_BMP(x)
54
#endif
54
#endif
55
 
55
 
56
// Pin allocations
56
// Pin allocations
57
#define LED_BLUE_TRIS           TRISCbits.TRISC5
57
#define LED_BLUE_TRIS           TRISCbits.TRISC5
58
#define LED_BLUE_LAT            LATCbits.LATC5
58
#define LED_BLUE_LAT            LATCbits.LATC5