All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

Parameter definitions for mapping peripherals directly to SAUL. More...

Detailed Description

Parameter definitions for mapping peripherals directly to SAUL.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file periph.h.

#include "periph/gpio.h"
#include "periph/adc.h"
#include "periph/pwm.h"
+ Include dependency graph for periph.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  saul_gpio_params_t
 Direct mapped GPIO configuration values. More...
 
struct  saul_adc_params_t
 Direct mapped ADC configuration values. More...
 
struct  saul_pwm_channel_t
 Single PWM channel exposed via SAUL. More...
 
struct  saul_pwm_dimmer_params_t
 PWM channels mapped to dimmer-style registration entries. More...
 
struct  saul_pwm_rgb_params_t
 PWM channels mapped to RGB LED registration entries. More...
 
#define SAUL_PWM_FREQ_DEFAULT   1000
 Default value for SAUL_PWM_FREQ.
 
#define SAUL_PWM_FREQ   SAUL_PWM_FREQ_DEFAULT
 Define the PWM frequency for LEDs.
 
#define SAUL_PWM_NO_DIMMER
 Suppress saul_pwm's dimmer generation.
 
#define SAUL_PWM_NO_RGB
 Suppress saul_pwm's RGB LED generation.
 
enum  saul_gpio_flags_t { SAUL_GPIO_INVERTED = (1 << 0) , SAUL_GPIO_INIT_CLEAR = (1 << 1) , SAUL_GPIO_INIT_SET = (1 << 2) }
 SAUL GPIO configuration flags. More...
 
enum  saul_pwm_flags_t { SAUL_PWM_REGULAR = (0 << 0) , SAUL_PWM_INVERTED = (1 << 0) }
 SAUL PWM parameters. More...
 
static const uint16_t saul_pwm_resolution = 255
 Resolution of SAUL mapped PWMs.
 

Macro Definition Documentation

◆ SAUL_PWM_FREQ

#define SAUL_PWM_FREQ   SAUL_PWM_FREQ_DEFAULT

Define the PWM frequency for LEDs.

This frequency is requested from the PWM driver. As the per pwm_init, the actual frequency may be lower, and the SAUL wrapper does not place a limit there.

Frequencies of above 200Hz usually give a smooth visual experience. The higher 1kHz is picked as a default as some devices can't go that low with their timer.

This is typically set in the board's pwm_params.h.

Definition at line 119 of file periph.h.

◆ SAUL_PWM_FREQ_DEFAULT

#define SAUL_PWM_FREQ_DEFAULT   1000

Default value for SAUL_PWM_FREQ.

Definition at line 101 of file periph.h.

◆ SAUL_PWM_NO_DIMMER

#define SAUL_PWM_NO_DIMMER

Suppress saul_pwm's dimmer generation.

This can be defined in pwm_params.h if the saul_pwm module is used, but no dimmers (and only RGB LEDs) are in use. Then, no saul_pwm_dimmer_params needs to be set.

Definition at line 130 of file periph.h.

◆ SAUL_PWM_NO_RGB

#define SAUL_PWM_NO_RGB

Suppress saul_pwm's RGB LED generation.

This can be defined in pwm_params.h if the saul_pwm module is used, but no RGB LEDs (and only dimmers) are in use. Then, no saul_pwm_rgb_params_t needs to be set.

Definition at line 157 of file periph.h.

Enumeration Type Documentation

◆ saul_gpio_flags_t

SAUL GPIO configuration flags.

Enumerator
SAUL_GPIO_INVERTED 

pin is used as inverted

SAUL_GPIO_INIT_CLEAR 

set pin inactive after init

SAUL_GPIO_INIT_SET 

set pin active after init

Definition at line 42 of file periph.h.

◆ saul_pwm_flags_t

SAUL PWM parameters.

Enumerator
SAUL_PWM_REGULAR 

Physical values are proportional to average voltage levels (ie.

LEDs are in active-high, anode driven)

SAUL_PWM_INVERTED 

Physical values are inverted from average voltage levels (ie.

LEDs are in active-low, cathode driven)

Definition at line 79 of file periph.h.

Variable Documentation

◆ saul_pwm_resolution

const uint16_t saul_pwm_resolution = 255
static

Resolution of SAUL mapped PWMs.

Definition at line 74 of file periph.h.