-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for POINTING_DEVICE_DRIVER #11075
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fbe6730
Add PWM3360 driver
drashna 526f19c
Updates to PloopyCo boards to use core driver
drashna b94d4c7
Add documentation for pmw3360 sensor
drashna 7ffd576
Add source link for firmware
drashna b461ae5
Add dm_right_trackball
drashna 6f88fa3
Add _DRIVERS support
drashna 7e8affc
Add drivers
drashna 1f4db05
add comments, remove ifdefs
drashna cfde0b6
Add prototypes for kb/user callbacks
drashna 81434c2
Add include for i2c stuff
drashna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Optical Sensor Driver | ||
|
||
## PixArt PMW3360 Optical Sensor | ||
|
||
The PixArt PMW3360 Motion Sensor is an optical sensor that is commonly used in mice and trackballs, but can be used for other motion input devices, as well. But it works exceptionally well with QMK's Pointing Device feature. | ||
|
||
The PMW3360 Motion Sensor interfaces via SPI, and does require SPI to be configured properly, as well. Details on how to do so are in the [SPI Driver doc](spi_driver.md). | ||
|
||
### Configuration Options | ||
|
||
`config.h` override | Description | AVR Default | ||
-------------------------------------|-------------------------------------------------------------------------------|-------------- | ||
`#define SPI_DIVISOR` | The divisor used (docs target 2.0MHz) | `8` | ||
`#define SS_CS_PIN` | The chip select pin used to "select" the PMW3360 sensor. Can be any GPIO pin. | `hi` | ||
`#define PMW3360_FIRMWARE_H` | If you have a custom firmware blob for the sensor, you can specify it here. | _not defined_ | ||
`#define PMW3360_CPI` | Sets the default CPI/DPI for the sensor (any value between 100 and 12000). | `1600` | ||
`#define ROTATIONAL_TRANSFORM_ANGLE` | Sets the rotation for the sensor (between -30 and 30) in degrees. | _not defined_ | ||
|
||
If you include a custom firmware blob, you must include these settings: | ||
|
||
Setting | Description | Default | ||
----------------------------------------|---------------------------------|-------------- | ||
`#define PMW3360_PRODUCT_ID` | Product ID of firmware | `0x42` | ||
`#define PMW3360_INVERSE_PRODUCT_ID` | Bitwise invesion of Product ID | `0xBD` | ||
`#define PMW3360_SROM_VERSION` | Firmware version | `0x04` | ||
`const uint16_t firmware_length` | Length of array for firmware | | ||
`const uint8_t PROGMEM firmware_data[]` | array of firmware data | | ||
|
||
### Functions | ||
|
||
#### `void pmw3360_spi_init(void)` | ||
|
||
This initializes both SPI, in general, and the PMW3360 sensor. It also uploads the firmware, and verifies the firmware signature (to ensure proper upload). | ||
|
||
#### `report_pmw_t pmw3360_read_burst(void)` | ||
|
||
This reads from the sensor, and returns motion data. | ||
|
||
Mostly, the dx and dy data structures are what you want to read. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still there, just ... formatted, below. yay autoformat