paa5100je.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2025 TU Dresden
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
44 #include <periph/gpio.h>
45 #include <periph/spi.h>
46 
47 #include <errno.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 typedef enum {
57  PAA5100JE = 0,
58  PMW3901 = 1,
60 
64 typedef enum {
65  PAA5100JE_LED_OFF = 0,
66  PAA5100JE_LED_MEDIUM = 1,
67  PAA5100JE_LED_MAX = 2,
69 
73 typedef struct {
74  spi_t spi;
76  gpio_t cs;
79 
83 typedef struct {
85 } paa5100je_t;
86 
98 
117 int paa5100je_get_motion_burst(const paa5100je_t *dev, int16_t *x, int16_t *y);
118 
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
spi_clk_t
Definition: periph_cpu.h:348
Low-level GPIO peripheral driver interface definitions.
paa5100je_led_brightness_t
PAA5100JE LED brightness levels.
Definition: paa5100je.h:64
int paa5100je_init(paa5100je_t *dev, const paa5100je_params_t *params)
Initialize the given device.
paa5100je_variant_t
Variant of the sensor.
Definition: paa5100je.h:56
int paa5100je_get_motion_burst(const paa5100je_t *dev, int16_t *x, int16_t *y)
Reads the relative motition vector from the device using burst read.
int paa5100je_set_led_brightness(const paa5100je_t *dev, const paa5100je_led_brightness_t level)
Sets the LED brightness level.
Low-level SPI peripheral driver interface definition.
Device initialization parameters.
Definition: paa5100je.h:73
spi_t spi
SPI bus used.
Definition: paa5100je.h:74
gpio_t cs
pin connected to the chip select line
Definition: paa5100je.h:76
paa5100je_variant_t var
variant of the sensor used
Definition: paa5100je.h:77
spi_clk_t clk
clock speed used on the selected SPI bus
Definition: paa5100je.h:75
Device descriptor for the driver.
Definition: paa5100je.h:83
const paa5100je_params_t * params
Device initialization parameters.
Definition: paa5100je.h:84