Loading...
Searching...
No Matches

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.
 
static const pca9685_saul_pwm_params_t pca9685_saul_pwm_params []
 Additional meta information to keep in the SAUL registry.
 

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.
 

Macro Definition Documentation

◆ PCA9685_PARAM_ADDR

#define PCA9685_PARAM_ADDR   (PCA9685_I2C_BASE_ADDR + 0)

device address is PCA9685_I2C_ADDR

Definition at line 39 of file pca9685_params.h.

◆ PCA9685_PARAM_DEV

#define PCA9685_PARAM_DEV   I2C_DEV(0)

device is I2C_DEV(0)

Definition at line 34 of file pca9685_params.h.

◆ PCA9685_PARAM_EXT_FREQ

#define PCA9685_PARAM_EXT_FREQ   (0)

EXTCLK frequency and pin: not used.

Definition at line 69 of file pca9685_params.h.

◆ PCA9685_PARAM_FREQ

#define PCA9685_PARAM_FREQ   (100)

PWM frequency in Hz: 100.

Definition at line 54 of file pca9685_params.h.

◆ PCA9685_PARAM_INV

#define PCA9685_PARAM_INV   (false)

Invert outputs: yes.

Definition at line 44 of file pca9685_params.h.

◆ PCA9685_PARAM_MODE

#define PCA9685_PARAM_MODE   (PWM_LEFT)

PWM mode for all channels: PWM_LEFT.

Definition at line 49 of file pca9685_params.h.

◆ PCA9685_PARAM_OE_PIN

#define PCA9685_PARAM_OE_PIN   (GPIO_UNDEF)

Output enable pin: not used.

Definition at line 64 of file pca9685_params.h.

◆ PCA9685_PARAM_OUT_DRV

#define PCA9685_PARAM_OUT_DRV   (PCA9685_TOTEM_POLE)

Output driver mode: totem pole.

Definition at line 74 of file pca9685_params.h.

◆ PCA9685_PARAM_OUT_NE

#define PCA9685_PARAM_OUT_NE   (PCA9685_OFF)

Output driver mode: totem pole.

Definition at line 79 of file pca9685_params.h.

◆ PCA9685_PARAM_RES

#define PCA9685_PARAM_RES   (4096)

PWM resolution: 4096.

Definition at line 59 of file pca9685_params.h.

◆ 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, \
}
#define PCA9685_PARAM_FREQ
PWM frequency in Hz: 100.
#define PCA9685_PARAM_OE_PIN
Output enable pin: not used.
#define PCA9685_PARAM_EXT_FREQ
EXTCLK frequency and pin: not used.
#define PCA9685_PARAM_RES
PWM resolution: 4096.
#define PCA9685_PARAM_MODE
PWM mode for all channels: PWM_LEFT.
#define PCA9685_PARAM_OUT_DRV
Output driver mode: totem pole.
#define PCA9685_PARAM_DEV
device is I2C_DEV(0)
#define PCA9685_PARAM_INV
Invert outputs: yes.
#define PCA9685_PARAM_ADDR
device address is PCA9685_I2C_ADDR
#define PCA9685_PARAM_OUT_NE
Output driver mode: totem pole.

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:
=
{
}
#define PCA9685_SAUL_PWM_PARAMS
Example for mapping PWM channels to SAUL.

Additional meta information to keep in the SAUL registry.

Definition at line 132 of file pca9685_params.h.