Skip to content

Commit

Permalink
Create charybdis_pmw3610.dtsi
Browse files Browse the repository at this point in the history
  • Loading branch information
stylustrader authored Dec 31, 2024
1 parent 68c0b4a commit 00d2466
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions config/boards/shields/charybdis/charybdis_pmw3610.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#define INPUT_EV_KEY 0x01 /**< Key event */
#define INPUT_EV_REL 0x02 /**< Relative coordinate event */
#define INPUT_EV_ABS 0x03 /**< Absolute coordinate event */
#define INPUT_EV_MSC 0x04 /**< Miscellaneous event */
#define INPUT_EV_VENDOR_START 0xf0 /**< Vendor specific event start */
#define INPUT_EV_VENDOR_STOP 0xff /**< Vendor specific event stop */

#define INPUT_REL_X 0x00 /**< Relative X coordinate */
#define INPUT_REL_Y 0x01 /**< Relative Y coordinate */
#define INPUT_REL_WHEEL 0x08 /**< Relative wheel coordinate */
#define INPUT_REL_HWHEEL 0x06 /**< Relative horizontal wheel coordinate */
#define INPUT_REL_MISC 0x09 /**< Relative misc coordinate */

&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 17)>;
};
};

spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 17)>;
low-power-enable;
};
};
};

&spi0 {
status = "disabled";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;

trackball: trackball@0 {
status = "disabled";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
cpi = <1000>;
evt-type = <INPUT_EV_REL>;
x-input-code = <INPUT_REL_X>;
y-input-code = <INPUT_REL_Y>;
};
};

0 comments on commit 00d2466

Please sign in to comment.