Only imu output
Fork of FYDP_Final2 by
drivers/ADNS5090/ADNS5090.h@5:d2e955a94940, 2015-03-25 (annotated)
- Committer:
- tntmarket
- Date:
- Wed Mar 25 09:58:50 2015 +0000
- Revision:
- 5:d2e955a94940
- Parent:
- 0:21019d94ad33
only imu output
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
majik | 0:21019d94ad33 | 1 | #ifndef ADNS5090_H |
majik | 0:21019d94ad33 | 2 | #define ADNS5090_H |
majik | 0:21019d94ad33 | 3 | |
majik | 0:21019d94ad33 | 4 | #include "stdint.h" |
majik | 0:21019d94ad33 | 5 | #include "mbed.h" |
majik | 0:21019d94ad33 | 6 | #include "SWSPI.h" |
majik | 0:21019d94ad33 | 7 | |
majik | 0:21019d94ad33 | 8 | #define ADNS5090_WRITE_VAL (0x80) |
majik | 0:21019d94ad33 | 9 | #define ADNS5090_MOTION_ST_REG (0x02) |
majik | 0:21019d94ad33 | 10 | #define ADNS5090_MOTION_BURST_REG (0x63) |
majik | 0:21019d94ad33 | 11 | #define ADNS5090_RESET_REG (0x3a) |
majik | 0:21019d94ad33 | 12 | #define ADNS5090_RESET_VAL (0x5a) |
majik | 0:21019d94ad33 | 13 | #define ADNS5090_MOUSE_CTRL_REG (0x0d) |
majik | 0:21019d94ad33 | 14 | #define ADNS5090_POWERDOWN_VAL (0x02) |
majik | 0:21019d94ad33 | 15 | |
majik | 0:21019d94ad33 | 16 | |
majik | 0:21019d94ad33 | 17 | class ADNS5090 |
majik | 0:21019d94ad33 | 18 | { |
majik | 0:21019d94ad33 | 19 | private: |
majik | 0:21019d94ad33 | 20 | |
majik | 0:21019d94ad33 | 21 | SWSPI spi; |
majik | 0:21019d94ad33 | 22 | DigitalOut ncs; |
majik | 0:21019d94ad33 | 23 | |
majik | 0:21019d94ad33 | 24 | public: |
majik | 0:21019d94ad33 | 25 | |
majik | 0:21019d94ad33 | 26 | ADNS5090(PinName mosi_pin, PinName miso_pin, PinName sclk_pin, PinName ncs_pin, float pxPerMM_); |
majik | 0:21019d94ad33 | 27 | |
majik | 0:21019d94ad33 | 28 | int8_t dx_px, dy_px; |
majik | 0:21019d94ad33 | 29 | uint8_t sq; //surface quality, higher better, ~30 is good, 0= no surface |
majik | 0:21019d94ad33 | 30 | float pxPerMM; |
majik | 0:21019d94ad33 | 31 | |
majik | 0:21019d94ad33 | 32 | float dx(); |
majik | 0:21019d94ad33 | 33 | float dy(); |
majik | 0:21019d94ad33 | 34 | |
majik | 0:21019d94ad33 | 35 | bool updateMotion(); |
majik | 0:21019d94ad33 | 36 | void reset(); |
majik | 0:21019d94ad33 | 37 | void powerDown(); |
majik | 0:21019d94ad33 | 38 | void setDPI(); |
majik | 0:21019d94ad33 | 39 | }; |
majik | 0:21019d94ad33 | 40 | |
majik | 0:21019d94ad33 | 41 | #endif |