Loading...
Searching...
No Matches
motor_driver_params.h File Reference

Default configuration for motor driver. More...

Detailed Description

Default configuration for motor driver.

Author
Gilles DOFFE g.dof.nosp@m.fe@g.nosp@m.mail..nosp@m.com

Definition in file motor_driver_params.h.

#include "board.h"
#include "motor_driver.h"
#include "saul_reg.h"
+ Include dependency graph for motor_driver_params.h:

Go to the source code of this file.

Variables

static const motor_driver_params_t motor_driver_params []
 MOTOR_DRIVER configuration.
 
static const saul_reg_info_t motor_driver_saul_info []
 Additional meta information to keep in the SAUL registry.
 

Set default configuration parameters for motor_driver

#define MOTOR_DRIVER_PARAM_MODE   MOTOR_DRIVER_1_DIR
 Default motor driver mode.
 
#define MOTOR_DRIVER_PARAM_BRAKE_INVERTED   false
 Default brake level.
 
#define MOTOR_DRIVER_PARAM_ENABLE_INVERTED   false
 Default enable level.
 
#define MOTOR_DRIVER_PARAM_PWM   0
 Default PWM device.
 
#define MOTOR_DRIVER_PARAM_PWM_MODE   PWM_LEFT
 Default PWM mode.
 
#define MOTOR_DRIVER_PARAM_PWM_FREQUENCY   20000U
 Default PWM frequency.
 
#define MOTOR_DRIVER_PARAM_PWM_RESOLUTION   100U
 Default PWM resolution.
 
#define MOTOR_DRIVER_PARAM_NB_MOTORS   2U
 Default number of motors.
 
#define MOTOR_DRIVER_PARAM_MOTOR_SET_POST_CALLBACK   NULL
 Default callback called at end of motor_set()
 
#define MOTOR_DRIVER_PARAM_MOTOR1_PWM_CHANNEL   1U
 Default motor 1 PWM channel.
 
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_ENABLE   GPIO_UNDEF
 Default motor 1 enable GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR0   GPIO_UNDEF
 Default motor 1 direction GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR1_OR_BRAKE   GPIO_UNDEF
 Default motor 1 direction or brake GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR_REVERSE   0
 Default motor 1 direction GPIO(s) reverse.
 
#define MOTOR_DRIVER_PARAM_MOTOR2_PWM_CHANNEL   2U
 Default motor 2 PWM channel.
 
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_ENABLE   GPIO_UNDEF
 Default motor 2 enable GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR0   GPIO_UNDEF
 Default motor 2 direction GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR1_OR_BRAKE   GPIO_UNDEF
 Default motor 2 direction or brake GPIO.
 
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR_REVERSE   0
 Default motor 2 direction GPIO(s) reverse.
 
#define MOTOR_DRIVER_PARAMS
 Default motor driver parameters.
 
#define MOTOR_DRIVER_SAUL_INFO   { .name = "motor_driver" }
 SAUL information.
 

Macro Definition Documentation

◆ MOTOR_DRIVER_PARAM_BRAKE_INVERTED

#define MOTOR_DRIVER_PARAM_BRAKE_INVERTED   false

Default brake level.

Definition at line 38 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_ENABLE_INVERTED

#define MOTOR_DRIVER_PARAM_ENABLE_INVERTED   false

Default enable level.

Definition at line 42 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MODE

#define MOTOR_DRIVER_PARAM_MODE   MOTOR_DRIVER_1_DIR

Default motor driver mode.

Definition at line 34 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR0

#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR0   GPIO_UNDEF

Default motor 1 direction GPIO.

Definition at line 80 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR1_OR_BRAKE

#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR1_OR_BRAKE   GPIO_UNDEF

Default motor 1 direction or brake GPIO.

Definition at line 84 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR_REVERSE

#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR_REVERSE   0

Default motor 1 direction GPIO(s) reverse.

Definition at line 88 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR1_GPIO_ENABLE

#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_ENABLE   GPIO_UNDEF

Default motor 1 enable GPIO.

Definition at line 76 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR1_PWM_CHANNEL

#define MOTOR_DRIVER_PARAM_MOTOR1_PWM_CHANNEL   1U

Default motor 1 PWM channel.

Definition at line 72 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR0

#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR0   GPIO_UNDEF

Default motor 2 direction GPIO.

Definition at line 102 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR1_OR_BRAKE

#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR1_OR_BRAKE   GPIO_UNDEF

Default motor 2 direction or brake GPIO.

Definition at line 106 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR_REVERSE

#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR_REVERSE   0

Default motor 2 direction GPIO(s) reverse.

Definition at line 110 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR2_GPIO_ENABLE

#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_ENABLE   GPIO_UNDEF

Default motor 2 enable GPIO.

Definition at line 98 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR2_PWM_CHANNEL

#define MOTOR_DRIVER_PARAM_MOTOR2_PWM_CHANNEL   2U

Default motor 2 PWM channel.

Definition at line 94 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_MOTOR_SET_POST_CALLBACK

#define MOTOR_DRIVER_PARAM_MOTOR_SET_POST_CALLBACK   NULL

Default callback called at end of motor_set()

Definition at line 66 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_NB_MOTORS

#define MOTOR_DRIVER_PARAM_NB_MOTORS   2U

Default number of motors.

Definition at line 62 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_PWM

#define MOTOR_DRIVER_PARAM_PWM   0

Default PWM device.

Definition at line 46 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_PWM_FREQUENCY

#define MOTOR_DRIVER_PARAM_PWM_FREQUENCY   20000U

Default PWM frequency.

Definition at line 54 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_PWM_MODE

#define MOTOR_DRIVER_PARAM_PWM_MODE   PWM_LEFT

Default PWM mode.

Definition at line 50 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAM_PWM_RESOLUTION

#define MOTOR_DRIVER_PARAM_PWM_RESOLUTION   100U

Default PWM resolution.

Definition at line 58 of file motor_driver_params.h.

◆ MOTOR_DRIVER_PARAMS

#define MOTOR_DRIVER_PARAMS
Value:
{ \
.pwm_dev = MOTOR_DRIVER_PARAM_PWM, \
.pwm_resolution = MOTOR_DRIVER_PARAM_PWM_RESOLUTION, \
.brake_inverted = MOTOR_DRIVER_PARAM_BRAKE_INVERTED, \
.enable_inverted = MOTOR_DRIVER_PARAM_ENABLE_INVERTED, \
.motors = { \
{ \
}, \
{ \
} \
}, \
}
#define MOTOR_DRIVER_PARAM_MOTOR2_PWM_CHANNEL
Default motor 2 PWM channel.
#define MOTOR_DRIVER_PARAM_PWM_RESOLUTION
Default PWM resolution.
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR1_OR_BRAKE
Default motor 2 direction or brake GPIO.
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR1_OR_BRAKE
Default motor 1 direction or brake GPIO.
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_ENABLE
Default motor 2 enable GPIO.
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR_REVERSE
Default motor 1 direction GPIO(s) reverse.
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_DIR0
Default motor 1 direction GPIO.
#define MOTOR_DRIVER_PARAM_MOTOR1_PWM_CHANNEL
Default motor 1 PWM channel.
#define MOTOR_DRIVER_PARAM_PWM
Default PWM device.
#define MOTOR_DRIVER_PARAM_PWM_MODE
Default PWM mode.
#define MOTOR_DRIVER_PARAM_MOTOR1_GPIO_ENABLE
Default motor 1 enable GPIO.
#define MOTOR_DRIVER_PARAM_BRAKE_INVERTED
Default brake level.
#define MOTOR_DRIVER_PARAM_PWM_FREQUENCY
Default PWM frequency.
#define MOTOR_DRIVER_PARAM_MODE
Default motor driver mode.
#define MOTOR_DRIVER_PARAM_MOTOR_SET_POST_CALLBACK
Default callback called at end of motor_set()
#define MOTOR_DRIVER_PARAM_NB_MOTORS
Default number of motors.
#define MOTOR_DRIVER_PARAM_ENABLE_INVERTED
Default enable level.
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR0
Default motor 2 direction GPIO.
#define MOTOR_DRIVER_PARAM_MOTOR2_GPIO_DIR_REVERSE
Default motor 2 direction GPIO(s) reverse.

Default motor driver parameters.

Definition at line 115 of file motor_driver_params.h.

◆ MOTOR_DRIVER_SAUL_INFO

#define MOTOR_DRIVER_SAUL_INFO   { .name = "motor_driver" }

SAUL information.

Definition at line 148 of file motor_driver_params.h.

Variable Documentation

◆ motor_driver_params

const motor_driver_params_t motor_driver_params[]
static
Initial value:
=
{
}
#define MOTOR_DRIVER_PARAMS
Motor driver configuration array.

MOTOR_DRIVER configuration.

Definition at line 155 of file motor_driver_params.h.

◆ motor_driver_saul_info

const saul_reg_info_t motor_driver_saul_info[]
static
Initial value:
=
{
}
#define MOTOR_DRIVER_SAUL_INFO
SAUL registry information for motor drivers.

Additional meta information to keep in the SAUL registry.

Definition at line 163 of file motor_driver_params.h.