Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
283 Kevin 1
#ifndef DEFINES_H
2
#define	DEFINES_H
3
 
4
#include <xc.h>
5
#include <stdint.h>
6
 
285 Kevin 7
//#define CONTROL_FROM_CONTROLLER
8
#define CONTROL_FROM_UART
9
 
283 Kevin 10
// <editor-fold defaultstate="collapsed" desc="I/O Pins">
11
#define LED_1_TRIS  TRISCbits.TRISC2
12
#define LED_1_LAT   LATCbits.LATC2
13
 
14
#define LED_2_TRIS  TRISCbits.TRISC4
15
#define LED_2_LAT   LATCbits.LATC4
16
 
17
#define CCP_1_TRIS  TRISCbits.TRISC5
18
#define CCP_1_LAT   LATCbits.LATC5
19
 
20
#define CCP_2_TRIS  TRISCbits.TRISC3
21
#define CCP_2_LAT   LATCbits.LATC3
22
 
23
#define I2C_1_CLK_TRIS  TRISCbits.TRISC0
24
#define I2C_1_DAT_TRIS  TRISCbits.TRISC1
285 Kevin 25
 
26
#define UART_RX_TRIS    TRISAbits.TRISA1
27
#define UART_TX_TRIS    TRISAbits.TRISA0
283 Kevin 28
// </editor-fold>
29
 
30
#define _XTAL_FREQ      32000000
31
 
32
#define PWM_NOMINAL 1500
33
#define PWM_MAX     1950
34
#define PWM_MIN     1050
35
 
285 Kevin 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
 
283 Kevin 45
#endif	/* DEFINES_H */