Trackball based on the NXP LPC11U24 and the ADNS-9500
Dependencies: ADNS9500 USBDevice mbed 25LCxxx_SPI
Diff: main.h
- Revision:
- 5:c7056267daa7
- Parent:
- 4:ba169f98e9be
- Child:
- 6:4cb2c9a3abcd
--- a/main.h Thu Dec 13 03:10:46 2012 +0000 +++ b/main.h Sun Dec 16 18:38:20 2012 +0000 @@ -1,30 +1,61 @@ -#include "mbed.h" -#include "USBMouse.h" -#include <math.h> -#include <stdint.h> - -#define ADNS9500_SROM_91 - -#define DEBUG - -#include "adns9500.hpp" -#include "Ser25lcxxx.h" - -DigitalOut led1(LED1); -DigitalOut led2(LED2); -DigitalOut led3(LED3); -DigitalOut led4(LED4); - -InterruptIn btn_hr(p16); -InterruptIn btn_z(p17); -InterruptIn btn_l(p18); -InterruptIn btn_m(p19); -InterruptIn btn_r(p20); - -bool motion_triggered = false; -bool z_axis_active = false; -bool high_rez_active = false; - -int default_motion_cpi = 1080; -int default_z_cpi = 90; -int default_hirez_cpi = 180; \ No newline at end of file +#include "mbed.h" +#include "USBHID.h" +#include "USBMouse.h" +#include <math.h> +#include <stdint.h> + +#define ADNS9500_SROM_91 + +#define DEBUG + +#include "adns9500.hpp" +#include "Ser25lcxxx.h" + +#define CHAT_SET 0x01 +#define CHAT_GET 0x02 + +#define CHAT_MOTION_DEFAULT_CPI 0x01 +#define CHAT_MOTION_MAX_CPI 0x02 +#define CHAT_MOTION_MIN_CPI 0x03 +#define CHAT_MOTION_STEP_CPI 0x04 +#define CHAT_Z_DEFAULT_CPI 0x05 +#define CHAT_HR_DEFAULT_CPI 0x06 + +#define CHAT_VID 0x07 +#define CHAT_PID 0x08 + +#define CHAT_ADNS_SROM 0x09 + +#define CHAT_LED_BEHAVIOR 0x0a + + + +//This report will contain data to be sent +HID_REPORT send_rep; +HID_REPORT recv_rep; + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); + +InterruptIn btn_hr(p16); +InterruptIn btn_z(p17); +InterruptIn btn_l(p18); +InterruptIn btn_m(p19); +InterruptIn btn_r(p20); + +bool motion_triggered = false; +bool z_axis_active = false; +bool high_rez_active = false; + +int default_motion_cpi = 1080; +int default_z_cpi = 90; +int default_hirez_cpi = 180; + + + + + +void set( uint8_t attrib, uint8_t *val ); +void get( uint8_t attrib); \ No newline at end of file