Project

General

Profile

Revision 323

more stuff

View differences:

mouse.c
19 19
// Byte 2 - Y delta
20 20

  
21 21
/* Mouse Commands */
22
#define RESET           0xFF /* @brief Reset mouse */
23
#define RESEND          0xFE /* @brief Resend command */
24
#define DEFAULT         0xF6 /* @brief Set default values */
22
//#define RESET           0xFF /* @brief Reset mouse */
23
//#define RESEND          0xFE /* @brief Resend command */
24
//#define DEFAULT         0xF6 /* @brief Set default values */
25 25
#define DIS_DATA_REP    0xF5 /* @brief Disable Data Reporting */
26 26
#define ENABLE_DATA_REP 0xF4 /* @brief Enable Data Reporting */
27
#define SET_SAMPLE_RT   0xF3 /* @brief Sets state sampling rate */
28
#define SET_REMOTE_MD   0xF0 /* @brief Sets Mouse on Remote Mode, data on request */
27
//#define SET_SAMPLE_RT   0xF3 /* @brief Sets state sampling rate */
28
//#define SET_REMOTE_MD   0xF0 /* @brief Sets Mouse on Remote Mode, data on request */
29 29
#define READ_DATA       0xEB /* @brief Sends data packet request */
30
#define SET_STREAM_MD   0xEA /* @brief Sets mouse on Stream Mode, data on events */
31
#define STATUS_REQUEST  0xE9 /* @brief Get mouse configuration */
32
#define SET_RESOLUTION  0xE8 /* @brief Sets resolution for mouse movement */
33
#define SCALING_ACC_MD  0xE7 /* @brief Sets scaling on acceleration mode */
34
#define SCALING_LIN_MD  0xE6 /* @brief Sets scaling on linear mode */
30
//#define SET_STREAM_MD   0xEA /* @brief Sets mouse on Stream Mode, data on events */
31
//#define STATUS_REQUEST  0xE9 /* @brief Get mouse configuration */
32
//#define SET_RESOLUTION  0xE8 /* @brief Sets resolution for mouse movement */
33
//#define SCALING_ACC_MD  0xE7 /* @brief Sets scaling on acceleration mode */
34
//#define SCALING_LIN_MD  0xE6 /* @brief Sets scaling on linear mode */
35 35

  
36 36
/* Mouse Controller Responses */
37 37
#define ACK_OK      0xFA /* @brief Operation sucessful */
38
#define ACK_INVALID 0xFE /* @brief Invalid Byte, first occurence */
38
//#define ACK_INVALID 0xFE /* @brief Invalid Byte, first occurence */
39 39
#define ACK_ERROR   0xFC /* @brief Invalid Byte on resend */
40 40

  
41 41
int (subscribe_mouse_interrupt)(uint8_t interrupt_bit, int *interrupt_id) {
......
45 45
    return SUCCESS;
46 46
}
47 47

  
48
int got_error_mouse_ih = 0;
49
uint8_t packet_mouse_ih[3];
50
int counter_mouse_ih = 0;
48
static int got_error_mouse_ih = 0;
49
static uint8_t packet_mouse_ih[3];
50
static int counter_mouse_ih = 0;
51 51
int (mouse_get_got_error_mouse_ih)(void){return got_error_mouse_ih; }
52 52
const uint8_t* (mouse_get_packet_mouse_ih)(void){return packet_mouse_ih; }
53 53
int (mouse_get_counter_mouse_ih)(void){return counter_mouse_ih; }
54
void (mouse_set_counter_mouse_ih)(int n){ counter_mouse_ih = n; }
54 55

  
55 56
void (mouse_ih)(void) {
56 57
    uint8_t status = 0;
......
117 118
    return SUCCESS;
118 119
}
119 120

  
120
int (mouse_issue_cmd)(uint32_t cmd) {
121
int (mouse_issue_cmd)(uint8_t cmd) {
121 122
    int ret;
122 123
    uint8_t ack = 0;
123 124
    for (unsigned int i = 0; i < KBC_NUM_TRIES; i++) {

Also available in: Unified diff