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

Default configuration for servo devices. More...

Detailed Description

Default configuration for servo devices.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file servo_params.h.

#include "board.h"
#include "macros/units.h"
#include "periph/gpio.h"
#include "periph/pwm.h"
#include "periph/timer.h"
#include "saul_reg.h"
#include "servo.h"
+ Include dependency graph for servo_params.h:

Go to the source code of this file.

Macros

#define SERVO_SAULINFO   { .name = "servo" }
 Servo SAUL info.
 

Variables

static const servo_pwm_params_t servo_pwm_params []
 Servo PWM parameters.
 
static const servo_timer_params_t servo_timer_params []
 Servo timer parameters.
 
static const servo_params_t servo_params []
 Parameters for controlling a servo.
 
static const saul_reg_info_t servo_saul_info []
 Allocate and configure entries to the SAUL registry.
 

Default servo PWM configuration

#define SERVO_PWM_PARAM_DEV   PWM_DEV(0)
 PWM device to use to control the servo.
 
#define SERVO_PWM_PARAM_RES   UINT16_MAX
 PWM resolution to use to control the servo.
 
#define SERVO_PWM_PARAM_FREQ   50
 PWM frequency in Hertz to use to control the servo.
 
#define SERVO_PWM_PARAMS
 PWM parameters for controlling a servo.
 

Default servo timer configuration

#define SERVO_TIMER_PARAM_DEV   TIMER_DEV(1)
 Timer to use to control the servo.
 
#define SERVO_TIMER_PARAM_TIMER_FREQ   MHZ(1)
 Timer frequency to use to control the servo in Hz.
 
#define SERVO_TIMER_PARAM_SERVO_FREQ   50
 Servo frequency in Hertz.
 
#define SERVO_TIMER_PARAM_TIMER_CTX   (&servo_timer_default_ctx)
 Memory needed for book keeping.
 
#define SERVO_TIMER_PARAMS
 TIMER parameters for controlling a servo.
 
servo_timer_ctx_t servo_timer_default_ctx
 Default servo timer context.
 

Default servo configuration

#define SERVO_PARAM_PWM_PARAMS   (&servo_pwm_params[0])
 PWM parameters.
 
#define SERVO_PARAM_TIMER_PARAMS   (&servo_timer_params[0])
 Timer parameters.
 
#define SERVO_PARAM_PWM_CHAN   0
 PWM channel to use to control the servo.
 
#define SERVO_PARAM_TIMER_CHAN   1
 Timer channel used to clear the servo pin.
 
#define SERVO_PARAM_PIN   GPIO_UNDEF
 GPIO pin the servo input is connected to.
 
#define SERVO_PARAM_MIN_US   900UL
 Minimum time in µs of a pulse (corresponds to minimum extension)
 
#define SERVO_PARAM_MAX_US   2100UL
 Maximum time in µs of a pulse (corresponds to maximum extension)
 

Macro Definition Documentation

◆ SERVO_PARAM_MAX_US

#define SERVO_PARAM_MAX_US   2100UL

Maximum time in µs of a pulse (corresponds to maximum extension)

Defaults to 2100UL.

Definition at line 218 of file servo_params.h.

◆ SERVO_PARAM_MIN_US

#define SERVO_PARAM_MIN_US   900UL

Minimum time in µs of a pulse (corresponds to minimum extension)

Defaults to 900UL.

Definition at line 209 of file servo_params.h.

◆ SERVO_PARAM_PIN

#define SERVO_PARAM_PIN   GPIO_UNDEF

GPIO pin the servo input is connected to.

Note
Only used with periph_timer_periodic based servo driver

Definition at line 200 of file servo_params.h.

◆ SERVO_PARAM_PWM_CHAN

#define SERVO_PARAM_PWM_CHAN   0

PWM channel to use to control the servo.

Defaults to 0

Definition at line 182 of file servo_params.h.

◆ SERVO_PARAM_PWM_PARAMS

#define SERVO_PARAM_PWM_PARAMS   (&servo_pwm_params[0])

PWM parameters.

Defaults to &servo_pwm_params[0].

Definition at line 164 of file servo_params.h.

◆ SERVO_PARAM_TIMER_CHAN

#define SERVO_PARAM_TIMER_CHAN   1

Timer channel used to clear the servo pin.

Defaults to 1

Definition at line 191 of file servo_params.h.

◆ SERVO_PARAM_TIMER_PARAMS

#define SERVO_PARAM_TIMER_PARAMS   (&servo_timer_params[0])

Timer parameters.

Defaults to &servo_timer_params[0].

Definition at line 173 of file servo_params.h.

◆ SERVO_PWM_PARAM_DEV

#define SERVO_PWM_PARAM_DEV   PWM_DEV(0)

PWM device to use to control the servo.

Defaults to PWM_DEV(0).

Definition at line 44 of file servo_params.h.

◆ SERVO_PWM_PARAM_FREQ

#define SERVO_PWM_PARAM_FREQ   50

PWM frequency in Hertz to use to control the servo.

Defaults to 50UL Hz.

Definition at line 62 of file servo_params.h.

◆ SERVO_PWM_PARAM_RES

#define SERVO_PWM_PARAM_RES   UINT16_MAX

PWM resolution to use to control the servo.

Defaults to UINT16_MAX.

Definition at line 53 of file servo_params.h.

◆ SERVO_PWM_PARAMS

#define SERVO_PWM_PARAMS
Value:
{\
}
#define SERVO_PWM_PARAM_DEV
PWM device to use to control the servo.
#define SERVO_PWM_PARAM_RES
PWM resolution to use to control the servo.
#define SERVO_PWM_PARAM_FREQ
PWM frequency in Hertz to use to control the servo.

PWM parameters for controlling a servo.

Definition at line 69 of file servo_params.h.

◆ SERVO_SAULINFO

#define SERVO_SAULINFO   { .name = "servo" }

Servo SAUL info.

Definition at line 257 of file servo_params.h.

◆ SERVO_TIMER_PARAM_DEV

#define SERVO_TIMER_PARAM_DEV   TIMER_DEV(1)

Timer to use to control the servo.

Defaults to TIMER_DEV(1).

Definition at line 95 of file servo_params.h.

◆ SERVO_TIMER_PARAM_SERVO_FREQ

#define SERVO_TIMER_PARAM_SERVO_FREQ   50

Servo frequency in Hertz.

Defaults to 50UL Hz.

Definition at line 113 of file servo_params.h.

◆ SERVO_TIMER_PARAM_TIMER_CTX

#define SERVO_TIMER_PARAM_TIMER_CTX   (&servo_timer_default_ctx)

Memory needed for book keeping.

Defaults to &servo_timer_default_ctx. One context per timer used is needed. E.g. when 4 servos are connected but all are controlled with the same timer peripheral, only one context is needed.

Definition at line 130 of file servo_params.h.

◆ SERVO_TIMER_PARAM_TIMER_FREQ

#define SERVO_TIMER_PARAM_TIMER_FREQ   MHZ(1)

Timer frequency to use to control the servo in Hz.

Defaults to 1 MHz

Definition at line 104 of file servo_params.h.

◆ SERVO_TIMER_PARAMS

#define SERVO_TIMER_PARAMS
Value:
{\
}
#define SERVO_TIMER_PARAM_TIMER_CTX
Memory needed for book keeping.
#define SERVO_TIMER_PARAM_TIMER_FREQ
Timer frequency to use to control the servo in Hz.
#define SERVO_TIMER_PARAM_DEV
Timer to use to control the servo.
#define SERVO_TIMER_PARAM_SERVO_FREQ
Servo frequency in Hertz.

TIMER parameters for controlling a servo.

Definition at line 137 of file servo_params.h.

Variable Documentation

◆ servo_params

const servo_params_t servo_params[]
static
Initial value:
=
{
SERVO_PARAMS
}

Parameters for controlling a servo.

Servo configuration

Definition at line 248 of file servo_params.h.

◆ servo_pwm_params

const servo_pwm_params_t servo_pwm_params[]
static
Initial value:
=
{
}
#define SERVO_PWM_PARAMS
PWM parameters for controlling a servo.

Servo PWM parameters.

Definition at line 80 of file servo_params.h.

◆ servo_saul_info

const saul_reg_info_t servo_saul_info[]
static
Initial value:
=
{
}
#define SERVO_SAULINFO
Servo SAUL info.

Allocate and configure entries to the SAUL registry.

Definition at line 263 of file servo_params.h.

◆ servo_timer_default_ctx

servo_timer_ctx_t servo_timer_default_ctx
extern

Default servo timer context.

Allocated in drivers/servo/timer.c

◆ servo_timer_params

const servo_timer_params_t servo_timer_params[]
static
Initial value:
=
{
}
#define SERVO_TIMER_PARAMS
TIMER parameters for controlling a servo.

Servo timer parameters.

Definition at line 149 of file servo_params.h.