1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/serpente: add SAUL PWM integration

This commit is contained in:
Marian Buschsieweke 2021-02-12 22:43:02 +01:00
parent 3a9f8d5851
commit 50b91f35a0
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
3 changed files with 49 additions and 60 deletions

View File

@ -3,7 +3,7 @@ ifneq (,$(filter mtd,$(USEMODULE)))
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
USEMODULE += saul_pwm
endif
# setup the samd21 arduino bootloader related dependencies

View File

@ -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 */
/** @} */

View 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 */
/** @} */