Subversion Repositories Code-Repo

Rev

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

Rev 283 Rev 285
Line 2... Line 2...
2
#define	DEFINES_H
2
#define	DEFINES_H
3
 
3
 
4
#include <xc.h>
4
#include <xc.h>
5
#include <stdint.h>
5
#include <stdint.h>
6
 
6
 
-
 
7
//#define CONTROL_FROM_CONTROLLER
-
 
8
#define CONTROL_FROM_UART
-
 
9
 
7
// <editor-fold defaultstate="collapsed" desc="I/O Pins">
10
// <editor-fold defaultstate="collapsed" desc="I/O Pins">
8
#define LED_1_TRIS  TRISCbits.TRISC2
11
#define LED_1_TRIS  TRISCbits.TRISC2
9
#define LED_1_LAT   LATCbits.LATC2
12
#define LED_1_LAT   LATCbits.LATC2
10
 
13
 
11
#define LED_2_TRIS  TRISCbits.TRISC4
14
#define LED_2_TRIS  TRISCbits.TRISC4
Line 17... Line 20...
17
#define CCP_2_TRIS  TRISCbits.TRISC3
20
#define CCP_2_TRIS  TRISCbits.TRISC3
18
#define CCP_2_LAT   LATCbits.LATC3
21
#define CCP_2_LAT   LATCbits.LATC3
19
 
22
 
20
#define I2C_1_CLK_TRIS  TRISCbits.TRISC0
23
#define I2C_1_CLK_TRIS  TRISCbits.TRISC0
21
#define I2C_1_DAT_TRIS  TRISCbits.TRISC1
24
#define I2C_1_DAT_TRIS  TRISCbits.TRISC1
-
 
25
 
-
 
26
#define UART_RX_TRIS    TRISAbits.TRISA1
-
 
27
#define UART_TX_TRIS    TRISAbits.TRISA0
22
// </editor-fold>
28
// </editor-fold>
23
 
29
 
24
#define _XTAL_FREQ      32000000
30
#define _XTAL_FREQ      32000000
25
 
31
 
26
#define PWM_NOMINAL 1500
32
#define PWM_NOMINAL 1500
27
#define PWM_MAX     1950
33
#define PWM_MAX     1950
28
#define PWM_MIN     1050
34
#define PWM_MIN     1050
29
 
35
 
-
 
36
#define UART_STATE_READ_CMD     0x1
-
 
37
#define UART_STATE_READ_DATA    0x2
-
 
38
 
-
 
39
#define UART_CMD_RESET          0x1
-
 
40
#define UART_CMD_LEFT_FORWARD   0x2
-
 
41
#define UART_CMD_LEFT_BACKWARD  0x3
-
 
42
#define UART_CMD_RIGHT_FORWARD  0x4
-
 
43
#define UART_CMD_RIGHT_BACKWARD 0x5
-
 
44
 
30
#endif	/* DEFINES_H */
45
#endif	/* DEFINES_H */