Subversion Repositories Code-Repo

Rev

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

Rev 230 Rev 232
Line 1... Line 1...
1
#ifndef DEFINES_H
1
#ifndef DEFINES_H
2
#define	DEFINES_H
2
#define	DEFINES_H
3
 
3
 
-
 
4
#include <xc.h>
-
 
5
#include <stdint.h>
-
 
6
 
4
// <editor-fold defaultstate="collapsed" desc="I/O Pins">
7
// <editor-fold defaultstate="collapsed" desc="I/O Pins">
5
#define BTN_L_N_TRIS    TRISAbits.TRISA1
8
#define BTN_L_N_TRIS    TRISAbits.TRISA1
6
#define BTN_L_N_PORT    PORTAbits.RA1
9
#define BTN_L_N_PORT    PORTAbits.RA1
7
#define BTN_L_N_WPU     WPUAbits.WPUA1
10
#define BTN_L_N_WPU     WPUAbits.WPUA1
8
 
11
 
Line 55... Line 58...
55
        unsigned BTN_R_E    :1;
58
        unsigned BTN_R_E    :1;
56
        unsigned BTN_R_S    :1;
59
        unsigned BTN_R_S    :1;
57
        unsigned BTN_R_W    :1;
60
        unsigned BTN_R_W    :1;
58
        unsigned            :2;
61
        unsigned            :2;
59
    };
62
    };
60
    char value;
63
    uint8_t value;
61
} BTN_STATUS;
64
} BTN_STATUS;
62
 
65
 
63
typedef union {
66
typedef union {
64
    struct {
67
    struct {
65
        unsigned LED_1      :1;
68
        unsigned LED_1      :1;
66
        unsigned LED_2      :1;
69
        unsigned LED_2      :1;
67
        unsigned LED_3      :1;
70
        unsigned LED_3      :1;
68
        unsigned LED_4      :1;
71
        unsigned LED_4      :1;
69
    };
72
    };
70
    char value;
73
    uint8_t value;
71
} LED_STATUS;
74
} LED_STATUS;
72
 
75
 
73
void Pins_Read(BTN_STATUS *btns);
76
void Pins_Read(BTN_STATUS *btns);
74
void Leds_Write(LED_STATUS *leds);
77
void Leds_Write(LED_STATUS *leds);
75
 
78