1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #13795 from francois-berder/pic32-saul

boards: pic32*: Add GPIO SAUL configuration
This commit is contained in:
benpicco 2020-04-02 21:28:38 +02:00 committed by GitHub
commit fdaf1ac6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,3 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 Francois Berder
*
* 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_pic32-wifire
* @{
*
* @file
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Francois Berder <fberder@outlook.fr>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1",
.pin = LED1_PIN,
.mode = GPIO_OUT,
},
{
.name = "LD2",
.pin = LED2_PIN,
.mode = GPIO_OUT,
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -0,0 +1,3 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -0,0 +1,60 @@
/*
* Copyright (C) 2020 Francois Berder
*
* 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_pic32-wifire
* @{
*
* @file
* @brief Configuration of SAUL mapped GPIO pins
*
* @author Francois Berder <fberder@outlook.fr>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LD1",
.pin = LED1_PIN,
.mode = GPIO_OUT,
},
{
.name = "LD2",
.pin = LED2_PIN,
.mode = GPIO_OUT,
},
{
.name = "LD3",
.pin = LED3_PIN,
.mode = GPIO_OUT,
},
{
.name = "LD4",
.pin = LED4_PIN,
.mode = GPIO_OUT,
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */