All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

Default configuration for the PCA9685 I2C PWM controller. More...

Detailed Description

Default configuration for the PCA9685 I2C PWM controller.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file pca9685_params.h.

#include "board.h"
#include "saul_reg.h"
#include "pca9685.h"
+ Include dependency graph for pca9685_params.h:

Go to the source code of this file.

Variables

static const pca9685_params_t pca9685_params []
 Allocate some memory to store the actual configuration. More...
 
static const pca9685_saul_pwm_params_t pca9685_saul_pwm_params []
 Additional meta information to keep in the SAUL registry. More...
 

Set default configuration parameters

#define PCA9685_PARAM_DEV   I2C_DEV(0)
 device is I2C_DEV(0)
 
#define PCA9685_PARAM_ADDR   (PCA9685_I2C_BASE_ADDR + 0)
 device address is PCA9685_I2C_ADDR
 
#define PCA9685_PARAM_INV   (false)
 Invert outputs: yes.
 
#define PCA9685_PARAM_MODE   (PWM_LEFT)
 PWM mode for all channels: PWM_LEFT.
 
#define PCA9685_PARAM_FREQ   (100)
 PWM frequency in Hz: 100.
 
#define PCA9685_PARAM_RES   (4096)
 PWM resolution: 4096.
 
#define PCA9685_PARAM_OE_PIN   (GPIO_UNDEF)
 Output enable pin: not used.
 
#define PCA9685_PARAM_EXT_FREQ   (0)
 EXTCLK frequency and pin: not used.
 
#define PCA9685_PARAM_OUT_DRV   (PCA9685_TOTEM_POLE)
 Output driver mode: totem pole.
 
#define PCA9685_PARAM_OUT_NE   (PCA9685_OFF)
 Output driver mode: totem pole.
 
#define PCA9685_PARAMS
 
#define PCA9685_SAUL_PWM_PARAMS
 Example for mapping PWM channels to SAUL. More...
 

Macro Definition Documentation

◆ PCA9685_PARAMS

#define PCA9685_PARAMS
Value:
{ \
.i2c_dev = PCA9685_PARAM_DEV, \
.i2c_addr = PCA9685_PARAM_ADDR, \
.mode = PCA9685_PARAM_MODE, \
.freq = PCA9685_PARAM_FREQ, \
.ext_freq = PCA9685_PARAM_EXT_FREQ, \
.oe_pin = PCA9685_PARAM_OE_PIN, \
.out_drv = PCA9685_PARAM_OUT_DRV, \
.out_ne = PCA9685_PARAM_OUT_NE, \
}

Definition at line 83 of file pca9685_params.h.

◆ PCA9685_SAUL_PWM_PARAMS

#define PCA9685_SAUL_PWM_PARAMS
Value:
{ \
.name = "PCA9685-0:0", \
.dev = 0, \
.channel = 0, \
.initial = (PCA9685_PARAM_RES >> 1), \
}, \
{ \
.name = "PCA9685-0:1", \
.dev = 0, \
.channel = 1, \
.initial = (PCA9685_PARAM_RES >> 2), \
}, \
{ \
.name = "PCA9685-0:1", \
.dev = 0, \
.channel = 2, \
.initial = (PCA9685_PARAM_RES >> 3), \
},

Example for mapping PWM channels to SAUL.

Definition at line 99 of file pca9685_params.h.

Variable Documentation

◆ pca9685_params

const pca9685_params_t pca9685_params[]
static
Initial value:
=
{
PCA9685_PARAMS
}

Allocate some memory to store the actual configuration.

Definition at line 123 of file pca9685_params.h.

◆ pca9685_saul_pwm_params

const pca9685_saul_pwm_params_t pca9685_saul_pwm_params[]
static
Initial value:

Additional meta information to keep in the SAUL registry.

Definition at line 132 of file pca9685_params.h.

PCA9685_PARAM_MODE
#define PCA9685_PARAM_MODE
PWM mode for all channels: PWM_LEFT.
Definition: pca9685_params.h:49
PCA9685_PARAM_RES
#define PCA9685_PARAM_RES
PWM resolution: 4096.
Definition: pca9685_params.h:59
PCA9685_PARAM_OUT_NE
#define PCA9685_PARAM_OUT_NE
Output driver mode: totem pole.
Definition: pca9685_params.h:79
PCA9685_SAUL_PWM_PARAMS
#define PCA9685_SAUL_PWM_PARAMS
Example for mapping PWM channels to SAUL.
Definition: pca9685_params.h:99
PCA9685_PARAM_ADDR
#define PCA9685_PARAM_ADDR
device address is PCA9685_I2C_ADDR
Definition: pca9685_params.h:39
PCA9685_PARAM_DEV
#define PCA9685_PARAM_DEV
device is I2C_DEV(0)
Definition: pca9685_params.h:34
PCA9685_PARAM_EXT_FREQ
#define PCA9685_PARAM_EXT_FREQ
EXTCLK frequency and pin: not used.
Definition: pca9685_params.h:69
PCA9685_PARAM_INV
#define PCA9685_PARAM_INV
Invert outputs: yes.
Definition: pca9685_params.h:44
PCA9685_PARAM_FREQ
#define PCA9685_PARAM_FREQ
PWM frequency in Hz: 100.
Definition: pca9685_params.h:54
PCA9685_PARAM_OE_PIN
#define PCA9685_PARAM_OE_PIN
Output enable pin: not used.
Definition: pca9685_params.h:64
PCA9685_PARAM_OUT_DRV
#define PCA9685_PARAM_OUT_DRV
Output driver mode: totem pole.
Definition: pca9685_params.h:74