123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- #ifndef SYNAPTICS_TOUCHPAD_H
- #define SYNAPTICS_TOUCHPAD_H
- #include <stdbool.h>
- #include <stdint.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define TOUCHPAD_INT_STATUS 0x14
- #define TOUCHPAD_BUTTON_STATUS 0x41
- #define TOUCHPAD_FINGER0_REL 0x30
- #define TOUCHPAD_GESTURE_FLAGS 0x3A
- #define TOUCHPAD_SCROLL 0x3F
- #define TOUCHPAD_CONTROL 0x42
- #define TOUCHPAD_COMMAND 0x8F
- #define TOUCHPAD_RESET 0x54
- #define TOUCHPAD_PAGESELECT 0xFF
- #define TOUCHPAD_PRODUCT_ID 0xA2
- typedef enum
- {
- SleepmodeNormal = 0x00,
- SleepmodeSensorSleep = 0x01
- } TouchpadSleepMode_t;
- bool touchpad_init(uint8_t device_address);
- bool touchpad_reset(void);
- bool touchpad_interrupt_status_read(uint8_t *interrupt_status);
- bool touchpad_set_sleep_mode(TouchpadSleepMode_t mode);
- bool touchpad_read_register(uint8_t register_address, uint8_t *value);
- bool touchpad_write_register(uint8_t register_address, uint8_t value);
- bool touchpad_product_id_read(uint8_t *product_id, uint8_t product_id_bytes);
- bool touchpad_product_id_verify(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|