17#ifndef PCA9685_PARAMS_H
18#define PCA9685_PARAMS_H
32#ifndef PCA9685_PARAM_DEV
34#define PCA9685_PARAM_DEV I2C_DEV(0)
37#ifndef PCA9685_PARAM_ADDR
39#define PCA9685_PARAM_ADDR (PCA9685_I2C_BASE_ADDR + 0)
42#ifndef PCA9685_PARAM_INV
44#define PCA9685_PARAM_INV (false)
47#ifndef PCA9685_PARAM_MODE
49#define PCA9685_PARAM_MODE (PWM_LEFT)
52#ifndef PCA9685_PARAM_FREQ
54#define PCA9685_PARAM_FREQ (100)
57#ifndef PCA9685_PARAM_RES
59#define PCA9685_PARAM_RES (4096)
62#ifndef PCA9685_PARAM_OE_PIN
64#define PCA9685_PARAM_OE_PIN (GPIO_UNDEF)
67#ifndef PCA9685_PARAM_EXT_FREQ
69#define PCA9685_PARAM_EXT_FREQ (0)
72#ifndef PCA9685_PARAM_OUT_DRV
74#define PCA9685_PARAM_OUT_DRV (PCA9685_TOTEM_POLE)
77#ifndef PCA9685_PARAM_OUT_NE
79#define PCA9685_PARAM_OUT_NE (PCA9685_OFF)
83#define PCA9685_PARAMS { \
84 .i2c_dev = PCA9685_PARAM_DEV, \
85 .i2c_addr = PCA9685_PARAM_ADDR, \
86 .inv = PCA9685_PARAM_INV, \
87 .mode = PCA9685_PARAM_MODE, \
88 .freq = PCA9685_PARAM_FREQ, \
89 .res = PCA9685_PARAM_RES, \
90 .ext_freq = PCA9685_PARAM_EXT_FREQ, \
91 .oe_pin = PCA9685_PARAM_OE_PIN, \
92 .out_drv = PCA9685_PARAM_OUT_DRV, \
93 .out_ne = PCA9685_PARAM_OUT_NE, \
97#ifndef PCA9685_SAUL_PWM_PARAMS
99#define PCA9685_SAUL_PWM_PARAMS { \
100 .name = "PCA9685-0:0", \
103 .initial = (PCA9685_PARAM_RES >> 1), \
106 .name = "PCA9685-0:1", \
109 .initial = (PCA9685_PARAM_RES >> 2), \
112 .name = "PCA9685-0:1", \
115 .initial = (PCA9685_PARAM_RES >> 3), \
128#if MODULE_SAUL || DOXYGEN
static const pca9685_saul_pwm_params_t pca9685_saul_pwm_params[]
Additional meta information to keep in the SAUL registry.
#define PCA9685_SAUL_PWM_PARAMS
Example for mapping PWM channels to SAUL.
static const pca9685_params_t pca9685_params[]
Allocate some memory to store the actual configuration.
SAUL registry interface definition.
PCA9685 device initialization parameters.
PCA9685 configuration structure for mapping PWM channels to SAUL.