mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
boards/common/silabs: add Arduino API support for SiLabs boards
This commit is contained in:
parent
1140b37c2d
commit
994999132a
2
boards/common/silabs/Makefile.features
Normal file
2
boards/common/silabs/Makefile.features
Normal file
@ -0,0 +1,2 @@
|
||||
# Various other features (if any)
|
||||
FEATURES_PROVIDED += arduino
|
58
boards/common/silabs/include/arduino_board.h
Normal file
58
boards/common/silabs/include/arduino_board.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Federico Pellegrin
|
||||
*
|
||||
* 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_common_silabs
|
||||
* @brief SiLabs Boards configuration for the Arduino API
|
||||
* @file
|
||||
* @author Federico Pellegrin <fede@evolware.org>
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef ARDUINO_BOARD_H
|
||||
#define ARDUINO_BOARD_H
|
||||
|
||||
#include "arduino_pinmap.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Arduino's digital pins mappings
|
||||
*/
|
||||
static const gpio_t arduino_pinmap[] = {
|
||||
ARDUINO_PIN_0,
|
||||
ARDUINO_PIN_1,
|
||||
ARDUINO_PIN_2,
|
||||
ARDUINO_PIN_3
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Arduino's analog pins mappings
|
||||
*/
|
||||
static const adc_t arduino_analog_map[] = {
|
||||
ARDUINO_A0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief On-board LED mapping
|
||||
*/
|
||||
#define ARDUINO_LED (0)
|
||||
|
||||
/**
|
||||
* @brief On-board serial port mapping
|
||||
*/
|
||||
#define ARDUINO_UART_DEV UART_DEV(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARDUINO_BOARD_H */
|
||||
/** @} */
|
46
boards/common/silabs/include/arduino_pinmap.h
Normal file
46
boards/common/silabs/include/arduino_pinmap.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Federico Pellegrin
|
||||
*
|
||||
* 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_common_silabs
|
||||
* @brief SiLabs Boards configuration for the Arduino API
|
||||
* @file
|
||||
* @author Federico Pellegrin <fede@evolware.org>
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef ARDUINO_PINMAP_H
|
||||
#define ARDUINO_PINMAP_H
|
||||
|
||||
#include "board.h"
|
||||
#include "periph_cpu.h"
|
||||
#include "periph/adc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Arduino's digital pins mappings
|
||||
*/
|
||||
#define ARDUINO_PIN_0 LED0_PIN
|
||||
#define ARDUINO_PIN_1 LED1_PIN
|
||||
#define ARDUINO_PIN_2 PB0_PIN
|
||||
#define ARDUINO_PIN_3 PB1_PIN
|
||||
|
||||
/**
|
||||
* @brief Arduino's analog pins mappings
|
||||
*/
|
||||
#define ARDUINO_A0 ADC_LINE(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARDUINO_PINMAP_H */
|
||||
/** @} */
|
@ -11,4 +11,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m4_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -11,4 +11,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m4_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -11,4 +11,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m4_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -11,4 +11,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m4_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -13,4 +13,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m3_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -13,4 +13,6 @@ FEATURES_PROVIDED += periph_uart
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m3_2
|
||||
|
||||
include $(RIOTBOARD)/common/silabs/Makefile.features
|
||||
|
||||
include $(RIOTCPU)/efm32/Makefile.features
|
||||
|
@ -1,7 +1,8 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
# the stm32f4discovery does not have the arduino pinout
|
||||
BOARD_BLACKLIST := stm32f4discovery jiminy-mega256rfr2
|
||||
BOARD_BLACKLIST := stm32f4discovery jiminy-mega256rfr2 slstk3401a slstk3402a \
|
||||
sltb001a slwstk6000b stk3600 stk3700
|
||||
|
||||
# currently the test provides config params for arduinos only
|
||||
FEATURES_REQUIRED += arduino
|
||||
|
Loading…
Reference in New Issue
Block a user