diff options
author | uqs <uqs@FreeBSD.org> | 2022-04-19 12:29:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 20:29:17 +1000 |
commit | 690dc4bdafe9e5e23e201d6bc839c32106074288 (patch) | |
tree | 2d6678346b3d99958854028720f4390689b7f165 /drivers/sensors/pmw3360.h | |
parent | 9f63bce70bd8e065e54de17c48994c3c008d2e0a (diff) |
Add support for multiple sensors to pmw3360 (#15996)
Diffstat (limited to 'drivers/sensors/pmw3360.h')
-rw-r--r-- | drivers/sensors/pmw3360.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/sensors/pmw3360.h b/drivers/sensors/pmw3360.h index eec7295871..3aa8ed0ed8 100644 --- a/drivers/sensors/pmw3360.h +++ b/drivers/sensors/pmw3360.h @@ -52,8 +52,14 @@ # define ROTATIONAL_TRANSFORM_ANGLE 0x00 #endif -#ifndef PMW3360_CS_PIN -# error "No chip select pin defined -- missing PMW3360_CS_PIN" +// Support single and plural spellings +#ifndef PMW3360_CS_PINS +# ifndef PMW3360_CS_PIN +# error "No chip select pin defined -- missing PMW3360_CS_PIN or PMW3360_CS_PINS" +# else +# define PMW3360_CS_PINS \ + { PMW3360_CS_PIN } +# endif #endif typedef struct { @@ -66,10 +72,8 @@ typedef struct { int8_t mdy; } report_pmw3360_t; -bool pmw3360_init(void); -void pmw3360_upload_firmware(void); -bool pmw3360_check_signature(void); +bool pmw3360_init(int8_t index); uint16_t pmw3360_get_cpi(void); void pmw3360_set_cpi(uint16_t cpi); /* Reads and clears the current delta values on the sensor */ -report_pmw3360_t pmw3360_read_burst(void); +report_pmw3360_t pmw3360_read_burst(int8_t index); |