Subversion Repositories Code-Repo

Rev

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

Rev 275 Rev 277
Line 25... Line 25...
25
#define LSM303_INT_TRIS TRISAbits.TRISA5
25
#define LSM303_INT_TRIS TRISAbits.TRISA5
26
#define L3GD20_INT_TRIS TRISAbits.TRISA4
26
#define L3GD20_INT_TRIS TRISAbits.TRISA4
27
#define UART_RX_TRIS    TRISCbits.TRISC5
27
#define UART_RX_TRIS    TRISCbits.TRISC5
28
#define UART_TX_TRIS    TRISCbits.TRISC4
28
#define UART_TX_TRIS    TRISCbits.TRISC4
29
 
29
 
30
#define BTN_CAP_0_TRIS  TRISCbits.TRISC6
-
 
31
#define BTN_CAP_1_TRIS  TRISCbits.TRISC7
-
 
32
 
-
 
33
#define BTN_INT_TRIS    TRISAbits.TRISA2
30
#define BTN_INT_TRIS    TRISAbits.TRISA2
34
 
31
 
35
#define I2C_ADDR_3_TRIS TRISCbits.TRISC3
32
#define I2C_ADDR_3_TRIS TRISCbits.TRISC3
36
#define I2C_ADDR_2_TRIS TRISCbits.TRISC2
33
#define I2C_ADDR_2_TRIS TRISCbits.TRISC2
37
#define I2C_ADDR_1_TRIS TRISCbits.TRISC1
34
#define I2C_ADDR_1_TRIS TRISCbits.TRISC1
Line 50... Line 47...
50
#define I2C_1_CLK_TRIS  TRISBbits.TRISB6
47
#define I2C_1_CLK_TRIS  TRISBbits.TRISB6
51
#define I2C_1_DAT_TRIS  TRISBbits.TRISB4
48
#define I2C_1_DAT_TRIS  TRISBbits.TRISB4
52
 
49
 
53
#define I2C_2_CLK_TRIS  TRISBbits.TRISB7
50
#define I2C_2_CLK_TRIS  TRISBbits.TRISB7
54
#define I2C_2_DAT_TRIS  TRISBbits.TRISB5
51
#define I2C_2_DAT_TRIS  TRISBbits.TRISB5
-
 
52
 
-
 
53
#define CPS_R_TRIS  TRISCbits.TRISC6
-
 
54
#define CPS_L_TRIS  TRISCbits.TRISC7
-
 
55
#define CPS_R_ANSL  ANSELCbits.ANSC6
-
 
56
#define CPS_L_ANSL  ANSELCbits.ANSC7
-
 
57
#define CPS_R_WPU   WPUCbits.WPUC6
-
 
58
#define CPS_L_WPU   WPUCbits.WPUC7
-
 
59
 
55
// </editor-fold>
60
// </editor-fold>
56
 
61
 
57
#define _XTAL_FREQ      32000000
62
#define _XTAL_FREQ      32000000
58
 
63
 
59
#define CMD_QUERY_BTN   0x0A
64
#define CMD_QUERY_BTN   0x0A
Line 71... Line 76...
71
#define RESET_RST   0x4
76
#define RESET_RST   0x4
72
#define RESET_STK   0x5
77
#define RESET_STK   0x5
73
 
78
 
74
#define I2C1_SLAVE_PREFIX   0x10
79
#define I2C1_SLAVE_PREFIX   0x10
75
 
80
 
-
 
81
#define DIR_BRIGHTNESS  0x40
-
 
82
#define DIR_S   0x00
-
 
83
#define DIR_W   0x01
-
 
84
#define DIR_N   0x02
-
 
85
#define DIR_E   0x03
-
 
86
 
76
typedef union {
87
typedef union {
77
    struct {
88
    struct {
78
        unsigned BTN_L_N    :1;
89
        unsigned BTN_L_N    :1;
79
        unsigned BTN_L_E    :1;
90
        unsigned BTN_L_E    :1;
80
        unsigned BTN_R_E    :1;
91
        unsigned BTN_R_E    :1;
Line 110... Line 121...
110
} LED_VALUES;
121
} LED_VALUES;
111
 
122
 
112
void Reset_Board(uint8_t next_state);
123
void Reset_Board(uint8_t next_state);
113
uint8_t Get_Last_Reset(void);
124
uint8_t Get_Last_Reset(void);
114
 
125
 
115
void Check_I2C(void);
126
void Check_I2C_Idle(void);
116
void Idle_Animation(void);
127
void Idle_Animation(void);
117
 
128
 
-
 
129
uint8_t Direction_Rotate_Clockwise(uint8_t);
-
 
130
uint8_t Direction_Rotate_CClockwise(uint8_t);
-
 
131
 
118
#endif	/* DEFINES_H */
132
#endif	/* DEFINES_H */
119
 
133