boards/serpente: add SAUL PWM integration
This commit is contained in:
parent
3a9f8d5851
commit
50b91f35a0
@ -3,7 +3,7 @@ ifneq (,$(filter mtd,$(USEMODULE)))
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_pwm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# setup the samd21 arduino bootloader related dependencies
|
# setup the samd21 arduino bootloader related dependencies
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020 Benjamin Valentin
|
|
||||||
*
|
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
|
||||||
* General Public License v2.1. See the file LICENSE in the top level
|
|
||||||
* directory for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ingroup boards_serpente
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* @file
|
|
||||||
* @brief Board specific configuration of direct mapped GPIOs
|
|
||||||
*
|
|
||||||
* @author Benjamin Valentin <benpicco@googlemail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GPIO_PARAMS_H
|
|
||||||
#define GPIO_PARAMS_H
|
|
||||||
|
|
||||||
#include "board.h"
|
|
||||||
#include "saul/periph.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief GPIO pin configuration
|
|
||||||
*/
|
|
||||||
static const saul_gpio_params_t saul_gpio_params[] =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
.name = LED0_NAME,
|
|
||||||
.pin = LED0_PIN,
|
|
||||||
.mode = GPIO_OUT,
|
|
||||||
.flags = SAUL_GPIO_INVERTED,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = LED1_NAME,
|
|
||||||
.pin = LED1_PIN,
|
|
||||||
.mode = GPIO_OUT,
|
|
||||||
.flags = SAUL_GPIO_INVERTED,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = LED2_NAME,
|
|
||||||
.pin = LED2_PIN,
|
|
||||||
.mode = GPIO_OUT,
|
|
||||||
.flags = SAUL_GPIO_INVERTED,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* GPIO_PARAMS_H */
|
|
||||||
/** @} */
|
|
||||||
48
boards/serpente/include/pwm_params.h
Normal file
48
boards/serpente/include/pwm_params.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Marian Buschsieweke
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup boards_serpente
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Configuration of SAUL mapped PWM channels
|
||||||
|
*
|
||||||
|
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PWM_PARAMS_H
|
||||||
|
#define PWM_PARAMS_H
|
||||||
|
|
||||||
|
#include "board.h"
|
||||||
|
#include "saul/periph.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const saul_pwm_rgb_params_t saul_pwm_rgb_params[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.name = "LED",
|
||||||
|
.channels = {
|
||||||
|
{ PWM_DEV(0), 3, SAUL_PWM_INVERTED },
|
||||||
|
{ PWM_DEV(0), 2, SAUL_PWM_INVERTED },
|
||||||
|
{ PWM_DEV(0), 4, SAUL_PWM_INVERTED }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SAUL_PWM_NO_DIMMER
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* PWM_PARAMS_H */
|
||||||
|
/** @} */
|
||||||
Loading…
x
Reference in New Issue
Block a user