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

boards,sys/arduino: major clean up

- Rename all `arduino_pinmap.h` to `arduino_iomap.h`
    - An empty `arduino_pinmap.h` that just includes `arduino_iomap.h`
      is provided for backward compatibility
    - Move all info from `arduino_board.h` into the new file as trivial
      macros, so that they can also be used outside of sketches
    - The new name reflects the fact not just pin mappings, but also
      other I/O features such as PWMs are mapped
- Drop all `arduino_board.h`
    - `arduino_board.h` and `arduino_iomap.h` now provide the exact
      same information, just in a different format
    - a generic `arduino_board.h` is provided instead that just
      uses the info in `arduinio_iomap.h` and provides them in the
      format the code in `sys/arduino` expects it
- Add fine grained features to indicate for mappings
    - availability of mappings for analog pins, DAC pins, PWM pins,
      UART devices, SPI/I2C buses to the corresponding RIOT
      identification can now be expressed:
        - `arduino_pins`: `ARDUINO_PIN_0` etc. are available
        - `arduino_analog`: `ARDUINO_A0` etc. are available
        - `arduino_pwm`: `ARDUINO_PIN_13_PWM_DEV` etc. are available
        - `arduino_dac`: `ARDUINO_DAC0` etc. are available
        - `arduino_uart`: `ARDUINO_UART_D0D1` or similar are available
        - `arduino_spi`: `ARDUINO_SPI_ISP` or similar are available
        - `arduino_i2c`: `ARDUINO_I2C_UNO` or similar are available
    - mechanical/electrical compatibility with specific form factors
      can now be expressed as features:
        - `aruino_shield_nano`: Arduino NANO compatible headers
        - `aruino_shield_uno`: Arduino UNO compatible headers
        - `aruino_shield_mega`: Arduino MEGA compatible headers
        - `aruino_shield_isp`: ISP header is available

This provides the groundwork to implement shield support as modules
that can rely on the I/O mappings, rather than having to provide a
configuration per board.
This commit is contained in:
Marian Buschsieweke 2023-06-23 15:42:08 +02:00
parent 655211129e
commit 043e8cc88e
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94
199 changed files with 4522 additions and 4955 deletions

View File

@ -11,7 +11,8 @@ config BOARD_ADAFRUIT_GRAND_CENTRAL_M4_EXPRESS
bool
default y
select CPU_MODEL_SAMD51P20A
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_HIGHLEVEL_STDIO
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC

View File

@ -15,5 +15,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# other board features
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += sdcard_spi

View File

@ -1,73 +0,0 @@
/*
* Copyright (C) 2017 Inria
*
* 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_nucleo144
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_14,
ARDUINO_PIN_15,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -16,8 +16,8 @@
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
@ -49,12 +49,26 @@ extern "C" {
#define ARDUINO_PIN_14 GPIO_PIN(PB, 20)
#define ARDUINO_PIN_15 GPIO_PIN(PB, 21)
#define ARDUINO_PIN_A0 GPIO_PIN(PA, 3)
#define ARDUINO_PIN_A1 GPIO_PIN(PC, 0)
#define ARDUINO_PIN_A2 GPIO_PIN(PC, 3)
#define ARDUINO_PIN_A3 GPIO_PIN(PC, 1)
#define ARDUINO_PIN_A4 GPIO_PIN(PC, 4)
#define ARDUINO_PIN_A5 GPIO_PIN(PC, 5)
#define ARDUINO_PIN_16 GPIO_PIN(PA, 3)
#define ARDUINO_PIN_17 GPIO_PIN(PC, 0)
#define ARDUINO_PIN_18 GPIO_PIN(PC, 3)
#define ARDUINO_PIN_19 GPIO_PIN(PC, 1)
#define ARDUINO_PIN_20 GPIO_PIN(PC, 4)
#define ARDUINO_PIN_21 GPIO_PIN(PC, 5)
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_16
#define ARDUINO_PIN_A1 ARDUINO_PIN_17
#define ARDUINO_PIN_A2 ARDUINO_PIN_18
#define ARDUINO_PIN_A3 ARDUINO_PIN_19
#define ARDUINO_PIN_A4 ARDUINO_PIN_20
#define ARDUINO_PIN_A5 ARDUINO_PIN_21
/** @} */
/**
@ -67,11 +81,13 @@ extern "C" {
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_ANALOG_PIN_LAST 5
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -10,6 +10,7 @@ config BOARD_ARDUINO_DUEMILANOVE
select BOARD_COMMON_ARDUINO_ATMEGA
select CPU_MODEL_ATMEGA328P
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_UNO
config BOARD
default "arduino-duemilanove" if BOARD_ARDUINO_DUEMILANOVE

View File

@ -1,3 +1,4 @@
CPU = atmega328p
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -13,5 +13,6 @@ config BOARD_ARDUINO_LEONARDO
select BOARD_COMMON_ARDUINO_ATMEGA
select CPU_MODEL_ATMEGA32U4
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_UNO
source "$(RIOTBOARD)/common/arduino-atmega/Kconfig"

View File

@ -1,3 +1,4 @@
CPU = atmega32u4
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -13,5 +13,7 @@ config BOARD_ARDUINO_MEGA2560
select CPU_MODEL_ATMEGA2560
select BOARD_COMMON_ARDUINO_ATMEGA
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_MEGA
select HAS_ARDUINO_SHIELD_UNO
source "$(RIOTBOARD)/common/arduino-atmega/Kconfig"

View File

@ -1,3 +1,6 @@
CPU = atmega2560
FEATURES_PROVIDED += arduino_shield_mega
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -29,11 +29,6 @@
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 6 on this board
*/
#define ARDUINO_LED (6U)
/**
* @name LED pin definitions and handlers
* @{

View File

@ -40,11 +40,6 @@ extern "C" {
#define ATA8520E_PARAM_RESET_PIN GPIO_PIN(PA, 27)
/** @} */
/**
* @brief The on-board LED is connected to pin 6 on this board
*/
#define ARDUINO_LED (6U)
/**
* @name LED pin definitions and handlers
* @{

View File

@ -30,11 +30,6 @@
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 6 on this board
*/
#define ARDUINO_LED (6U)
/**
* @name LED pin definitions and handlers
* @{

View File

@ -10,6 +10,7 @@ config BOARD_ARDUINO_NANO
select BOARD_COMMON_ARDUINO_ATMEGA
select CPU_MODEL_ATMEGA328P
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_NANO
config BOARD
default "arduino-nano" if BOARD_ARDUINO_NANO

View File

@ -1,3 +1,4 @@
CPU = atmega328p
FEATURES_PROVIDED += arduino_shield_nano
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -10,6 +10,7 @@ config BOARD_ARDUINO_UNO
select CPU_MODEL_ATMEGA328P
select BOARD_COMMON_ARDUINO_ATMEGA
select MODULE_BOARDS_COMMON_ARDUINO-ATMEGA if TEST_KCONFIG
select HAS_ARDUINO_SHIELD_UNO
config BOARD
default "arduino-uno" if BOARD_ARDUINO_UNO

View File

@ -1,3 +1,4 @@
CPU = atmega328p
FEATURES_PROVIDED += arduino_shield_uno
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

View File

@ -14,8 +14,13 @@ config BOARD_COMMON_ARDUINO_ATMEGA
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
# Various other features (if any)
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_I2C
select HAS_ARDUINO_PINS
select HAS_ARDUINO_PWM
select HAS_ARDUINO_SHIELD_ISP
select HAS_ARDUINO_SPI
select HAS_ARDUINO_UART
select HAVE_SAUL_GPIO

View File

@ -7,5 +7,10 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_i2c
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_pwm
FEATURES_PROVIDED += arduino_shield_isp
FEATURES_PROVIDED += arduino_spi
FEATURES_PROVIDED += arduino_uart

View File

@ -1,194 +0,0 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
* 2017 Thomas Perrot <thomas.perrot@tupi.fr>
*
* 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_arduino-atmega
* @{
*
* @file
* @brief Configuration of the Arduino API for Arduino Atmega boards
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Laurent Navet <laurent.navet@gmail.com>
* @author Thomas Perrot <thomas.perrot@tupi.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#include "periph/pwm.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 13 on this board
*/
#define ARDUINO_LED (13)
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_14,
ARDUINO_PIN_15,
ARDUINO_PIN_16,
ARDUINO_PIN_17,
ARDUINO_PIN_18,
ARDUINO_PIN_19,
#if defined(CPU_ATMEGA2560) || defined(CPU_ATMEGA32U4)
ARDUINO_PIN_20,
ARDUINO_PIN_21,
ARDUINO_PIN_22,
ARDUINO_PIN_23,
#endif
#ifdef CPU_ATMEGA2560
ARDUINO_PIN_24,
ARDUINO_PIN_25,
ARDUINO_PIN_26,
ARDUINO_PIN_27,
ARDUINO_PIN_28,
ARDUINO_PIN_29,
#endif
#if defined(CPU_ATMEGA2560) || defined(CPU_ATMEGA32U4)
ARDUINO_PIN_30,
#endif
#ifdef CPU_ATMEGA2560
ARDUINO_PIN_31,
ARDUINO_PIN_32,
ARDUINO_PIN_33,
ARDUINO_PIN_34,
ARDUINO_PIN_35,
ARDUINO_PIN_36,
ARDUINO_PIN_37,
ARDUINO_PIN_38,
ARDUINO_PIN_39,
ARDUINO_PIN_40,
ARDUINO_PIN_41,
ARDUINO_PIN_42,
ARDUINO_PIN_43,
ARDUINO_PIN_44,
ARDUINO_PIN_45,
ARDUINO_PIN_46,
ARDUINO_PIN_47,
ARDUINO_PIN_48,
ARDUINO_PIN_49,
ARDUINO_PIN_50,
ARDUINO_PIN_51,
ARDUINO_PIN_52,
ARDUINO_PIN_53,
ARDUINO_PIN_54,
ARDUINO_PIN_55,
ARDUINO_PIN_56,
ARDUINO_PIN_57,
ARDUINO_PIN_58,
ARDUINO_PIN_59,
ARDUINO_PIN_60,
ARDUINO_PIN_61,
ARDUINO_PIN_62,
ARDUINO_PIN_63,
ARDUINO_PIN_64,
ARDUINO_PIN_65,
ARDUINO_PIN_66,
ARDUINO_PIN_67,
ARDUINO_PIN_68,
ARDUINO_PIN_69
#endif
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
ARDUINO_A6,
ARDUINO_A7,
#ifdef CPU_ATMEGA2560
ARDUINO_A8,
ARDUINO_A9,
ARDUINO_A10,
ARDUINO_A11,
ARDUINO_A12,
ARDUINO_A13,
ARDUINO_A14,
ARDUINO_A15,
#endif
};
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (490U)
/**
* @brief List of PWM GPIO mappings
*/
static const arduino_pwm_t arduino_pwm_list[] = {
#if defined(CPU_ATMEGA2560)
{ .pin = 13, .dev = PWM_DEV(0), .chan = 0 },
{ .pin = 4, .dev = PWM_DEV(0), .chan = 1 },
#elif defined(CPU_ATMEGA32U4)
{ .pin = 11, .dev = PWM_DEV(0), .chan = 0 },
{ .pin = 3, .dev = PWM_DEV(0), .chan = 1 },
#else /* CPU_ATMEGA328p */
{ .pin = 6, .dev = PWM_DEV(0), .chan = 0 },
{ .pin = 5, .dev = PWM_DEV(0), .chan = 1 },
#endif
#if defined(CPU_ATMEGA2560)
{ .pin = 10, .dev = PWM_DEV(1), .chan = 0 },
{ .pin = 9, .dev = PWM_DEV(1), .chan = 1 },
#else /* CPU_ATMEGA328p */
{ .pin = 11, .dev = PWM_DEV(1), .chan = 0 },
{ .pin = 3, .dev = PWM_DEV(1), .chan = 1 },
#endif
};
/**
* @brief F_CPU defines the CPU frequency in Hz.
*
* This is used in AVR's libc delay.h and setbaud.h
*
* In RIOT delay() has a different implementation using ztimer, and F_CPU is
* already defined when using setbaud.h (see cpu/atmega_common/periph/uart.c)
*
* However Arduino libraries and sketches may expect F_CPU to be defined and
* fail otherwise (for example the Arduino SDI-12 package expects this, for AVR
* cpus). For this reason we define F_CPU here, if not already defined.
*/
#ifndef F_CPU
#define F_CPU CLOCK_CORECLOCK
#endif
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,332 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
* 2016 Laurent Navet <laurent.navet@gmail.com>
* 2017 Thomas Perrot <thomas.perrot@tupi.fr>
*
* 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_arduino-atmega
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins for Arduino Atmega boards
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Daniel Nordahl <nordahl.d@gmail.com>
* @author Laurent Navet <laurent.navet@gmail.com>
* @author Thomas Perrot <thomas.perrot@tupi.fr>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/adc.h"
#include "periph/gpio.h"
#include "periph/i2c.h"
#include "periph/pwm.h"
#include "periph/spi.h"
#include "periph/uart.h"
#include "periph_conf.h" /* For ADC_NUMOF */
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Arduino's UART devices
* @{
*/
#define ARDUINO_UART_D0D1 UART_DEV(0)
/** @} */
/**
* @name Arduino's SPI buses
* @{
*/
/**
* @brief The only hardware SPI is connected to the ISP header
*/
#define ARDUINO_SPI_ISP SPI_DEV(0)
/** @} */
/**
* @name Arduino's I2C buses
* @{
*/
/**
* @brief The only hardware I2C on ATmegas
*/
#define ARDUINO_I2C0 I2C_DEV(0)
/** @} */
/**
* @name Mapping of MCU pins to Arduino pins
*
* @note ISCP pins are not mapped.
* @{
*/
/* Digital pins */
#ifdef CPU_ATMEGA328P
# define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 0)
# define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 1)
# define ARDUINO_PIN_2 GPIO_PIN(PORT_D, 2)
# define ARDUINO_PIN_3 GPIO_PIN(PORT_D, 3)
# define ARDUINO_PIN_4 GPIO_PIN(PORT_D, 4)
# define ARDUINO_PIN_5 GPIO_PIN(PORT_D, 5)
# define ARDUINO_PIN_6 GPIO_PIN(PORT_D, 6)
# define ARDUINO_PIN_7 GPIO_PIN(PORT_D, 7)
# define ARDUINO_PIN_8 GPIO_PIN(PORT_B, 0)
# define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 1)
# define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 2)
# define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 3)
# define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 4)
# define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 5)
/* Analog pins as digital pins: */
# define ARDUINO_PIN_14 GPIO_PIN(PORT_C, 0)
# define ARDUINO_PIN_15 GPIO_PIN(PORT_C, 1)
# define ARDUINO_PIN_16 GPIO_PIN(PORT_C, 2)
# define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 3)
# define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 4)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 5)
# define ARDUINO_PIN_LAST 19
/* Analog aliases */
# define ARDUINO_PIN_A0 ARDUINO_PIN_14
# define ARDUINO_PIN_A1 ARDUINO_PIN_15
# define ARDUINO_PIN_A2 ARDUINO_PIN_16
# define ARDUINO_PIN_A3 ARDUINO_PIN_17
# define ARDUINO_PIN_A4 ARDUINO_PIN_18
# define ARDUINO_PIN_A5 ARDUINO_PIN_19
#endif
#ifdef CPU_ATMEGA32U4
/* Digital pins */
# define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 2)
# define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 3)
# define ARDUINO_PIN_2 GPIO_PIN(PORT_D, 1)
# define ARDUINO_PIN_3 GPIO_PIN(PORT_D, 0)
# define ARDUINO_PIN_5 GPIO_PIN(PORT_C, 6)
# define ARDUINO_PIN_7 GPIO_PIN(PORT_E, 6)
# define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 7)
# define ARDUINO_PIN_13 GPIO_PIN(PORT_C, 7)
# define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 3)
# define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 1)
# define ARDUINO_PIN_16 GPIO_PIN(PORT_B, 2)
# define ARDUINO_PIN_17 GPIO_PIN(PORT_B, 0)
# define ARDUINO_PIN_30 GPIO_PIN(PORT_D, 5)
/* Analog pins as digital pins: */
# define ARDUINO_PIN_4 GPIO_PIN(PORT_D, 4)
# define ARDUINO_PIN_6 GPIO_PIN(PORT_D, 7)
# define ARDUINO_PIN_8 GPIO_PIN(PORT_B, 4)
# define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 5)
# define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 6)
# define ARDUINO_PIN_12 GPIO_PIN(PORT_D, 6)
# define ARDUINO_PIN_18 GPIO_PIN(PORT_F, 7)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 6)
# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5)
# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 4)
# define ARDUINO_PIN_22 GPIO_PIN(PORT_F, 3)
# define ARDUINO_PIN_23 GPIO_PIN(PORT_F, 2)
# define ARDUINO_PIN_LAST 23
/* Analog aliases */
# define ARDUINO_PIN_A0 ARDUINO_PIN_18
# define ARDUINO_PIN_A1 ARDUINO_PIN_19
# define ARDUINO_PIN_A2 ARDUINO_PIN_20
# define ARDUINO_PIN_A3 ARDUINO_PIN_21
# define ARDUINO_PIN_A4 ARDUINO_PIN_22
# define ARDUINO_PIN_A5 ARDUINO_PIN_23
# define ARDUINO_PIN_A6 ARDUINO_PIN_4
# define ARDUINO_PIN_A7 ARDUINO_PIN_6
# define ARDUINO_PIN_A8 ARDUINO_PIN_8
# define ARDUINO_PIN_A9 ARDUINO_PIN_9
# define ARDUINO_PIN_A10 ARDUINO_PIN_10
# define ARDUINO_PIN_A11 ARDUINO_PIN_12
#endif
#ifdef CPU_ATMEGA2560
/* Digital pins */
# define ARDUINO_PIN_0 GPIO_PIN(PORT_E, 0)
# define ARDUINO_PIN_1 GPIO_PIN(PORT_E, 1)
# define ARDUINO_PIN_2 GPIO_PIN(PORT_E, 4)
# define ARDUINO_PIN_3 GPIO_PIN(PORT_E, 5)
# define ARDUINO_PIN_4 GPIO_PIN(PORT_G, 5)
# define ARDUINO_PIN_5 GPIO_PIN(PORT_E, 3)
# define ARDUINO_PIN_6 GPIO_PIN(PORT_H, 3)
# define ARDUINO_PIN_7 GPIO_PIN(PORT_H, 4)
# define ARDUINO_PIN_8 GPIO_PIN(PORT_H, 5)
# define ARDUINO_PIN_9 GPIO_PIN(PORT_H, 6)
# define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 4)
# define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 5)
# define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 6)
# define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 7)
# define ARDUINO_PIN_14 GPIO_PIN(PORT_J, 1)
# define ARDUINO_PIN_15 GPIO_PIN(PORT_J, 0)
# define ARDUINO_PIN_16 GPIO_PIN(PORT_H, 1)
# define ARDUINO_PIN_17 GPIO_PIN(PORT_H, 0)
# define ARDUINO_PIN_18 GPIO_PIN(PORT_D, 3)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 2)
# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 1)
# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 0)
# define ARDUINO_PIN_22 GPIO_PIN(PORT_A, 0)
# define ARDUINO_PIN_23 GPIO_PIN(PORT_A, 1)
# define ARDUINO_PIN_24 GPIO_PIN(PORT_A, 2)
# define ARDUINO_PIN_25 GPIO_PIN(PORT_A, 3)
# define ARDUINO_PIN_26 GPIO_PIN(PORT_A, 4)
# define ARDUINO_PIN_27 GPIO_PIN(PORT_A, 5)
# define ARDUINO_PIN_28 GPIO_PIN(PORT_A, 6)
# define ARDUINO_PIN_29 GPIO_PIN(PORT_A, 7)
# define ARDUINO_PIN_30 GPIO_PIN(PORT_C, 7)
# define ARDUINO_PIN_31 GPIO_PIN(PORT_C, 6)
# define ARDUINO_PIN_32 GPIO_PIN(PORT_C, 5)
# define ARDUINO_PIN_33 GPIO_PIN(PORT_C, 4)
# define ARDUINO_PIN_34 GPIO_PIN(PORT_C, 3)
# define ARDUINO_PIN_35 GPIO_PIN(PORT_C, 2)
# define ARDUINO_PIN_36 GPIO_PIN(PORT_C, 1)
# define ARDUINO_PIN_37 GPIO_PIN(PORT_E, 0)
# define ARDUINO_PIN_38 GPIO_PIN(PORT_D, 7)
# define ARDUINO_PIN_39 GPIO_PIN(PORT_G, 2)
# define ARDUINO_PIN_40 GPIO_PIN(PORT_G, 1)
# define ARDUINO_PIN_41 GPIO_PIN(PORT_G, 0)
# define ARDUINO_PIN_42 GPIO_PIN(PORT_L, 7)
# define ARDUINO_PIN_43 GPIO_PIN(PORT_L, 6)
# define ARDUINO_PIN_44 GPIO_PIN(PORT_L, 5)
# define ARDUINO_PIN_45 GPIO_PIN(PORT_L, 4)
# define ARDUINO_PIN_46 GPIO_PIN(PORT_L, 3)
# define ARDUINO_PIN_47 GPIO_PIN(PORT_L, 2)
# define ARDUINO_PIN_48 GPIO_PIN(PORT_L, 1)
# define ARDUINO_PIN_49 GPIO_PIN(PORT_L, 0)
# define ARDUINO_PIN_50 GPIO_PIN(PORT_B, 3)
# define ARDUINO_PIN_51 GPIO_PIN(PORT_B, 2)
# define ARDUINO_PIN_52 GPIO_PIN(PORT_B, 1)
# define ARDUINO_PIN_53 GPIO_PIN(PORT_B, 0)
/* Analog pins as digital pins: */
# define ARDUINO_PIN_54 GPIO_PIN(PORT_F, 0)
# define ARDUINO_PIN_55 GPIO_PIN(PORT_F, 1)
# define ARDUINO_PIN_56 GPIO_PIN(PORT_F, 2)
# define ARDUINO_PIN_57 GPIO_PIN(PORT_F, 3)
# define ARDUINO_PIN_58 GPIO_PIN(PORT_F, 4)
# define ARDUINO_PIN_59 GPIO_PIN(PORT_F, 5)
# define ARDUINO_PIN_60 GPIO_PIN(PORT_F, 6)
# define ARDUINO_PIN_61 GPIO_PIN(PORT_F, 7)
# define ARDUINO_PIN_62 GPIO_PIN(PORT_K, 0)
# define ARDUINO_PIN_63 GPIO_PIN(PORT_K, 1)
# define ARDUINO_PIN_64 GPIO_PIN(PORT_K, 2)
# define ARDUINO_PIN_65 GPIO_PIN(PORT_K, 3)
# define ARDUINO_PIN_66 GPIO_PIN(PORT_K, 4)
# define ARDUINO_PIN_67 GPIO_PIN(PORT_K, 5)
# define ARDUINO_PIN_68 GPIO_PIN(PORT_K, 6)
# define ARDUINO_PIN_69 GPIO_PIN(PORT_K, 7)
# define ARDUINO_PIN_LAST 69
/* Analog aliases */
# define ARDUINO_PIN_A0 ARDUINO_PIN_54
# define ARDUINO_PIN_A1 ARDUINO_PIN_55
# define ARDUINO_PIN_A2 ARDUINO_PIN_56
# define ARDUINO_PIN_A3 ARDUINO_PIN_57
# define ARDUINO_PIN_A4 ARDUINO_PIN_58
# define ARDUINO_PIN_A5 ARDUINO_PIN_59
# define ARDUINO_PIN_A6 ARDUINO_PIN_60
# define ARDUINO_PIN_A7 ARDUINO_PIN_61
# define ARDUINO_PIN_A8 ARDUINO_PIN_62
# define ARDUINO_PIN_A9 ARDUINO_PIN_63
# define ARDUINO_PIN_A10 ARDUINO_PIN_64
# define ARDUINO_PIN_A11 ARDUINO_PIN_65
# define ARDUINO_PIN_A12 ARDUINO_PIN_66
# define ARDUINO_PIN_A13 ARDUINO_PIN_67
# define ARDUINO_PIN_A14 ARDUINO_PIN_68
# define ARDUINO_PIN_A15 ARDUINO_PIN_69
#endif
#if ADC_NUMOF >= 8
# define ARDUINO_A0 ADC_LINE(0)
# define ARDUINO_A1 ADC_LINE(1)
# define ARDUINO_A2 ADC_LINE(2)
# define ARDUINO_A3 ADC_LINE(3)
# define ARDUINO_A4 ADC_LINE(4)
# define ARDUINO_A5 ADC_LINE(5)
# define ARDUINO_A6 ADC_LINE(6)
# define ARDUINO_A7 ADC_LINE(7)
#endif
#if ADC_NUMOF >= 16
# define ARDUINO_A8 ADC_LINE(8)
# define ARDUINO_A9 ADC_LINE(9)
# define ARDUINO_A10 ADC_LINE(10)
# define ARDUINO_A11 ADC_LINE(11)
# define ARDUINO_A12 ADC_LINE(12)
# define ARDUINO_A13 ADC_LINE(13)
# define ARDUINO_A14 ADC_LINE(14)
# define ARDUINO_A15 ADC_LINE(15)
#endif
/* Either 8, 16 or 0 ADC lines are configured by all ATmega boards */
#if ADC_NUMOF == 8
# define ARDUINO_ANALOG_PIN_LAST 7
#elif ADC_NUMOF == 16
# define ARDUINO_ANALOG_PIN_LAST 15
#endif
/** @} */
/**
* @name Mapping of Arduino pins to RIOT PWM dev and channel pairs
* @{
*/
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (490U)
/* keep in sync with PWM config in boards/common/atmega/include/periph_conf_atmega_common.h */
#if defined(CPU_ATMEGA328P)
# define ARDUINO_PIN_6_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_6_PWM_CHAN 0
# define ARDUINO_PIN_5_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_5_PWM_CHAN 1
# define ARDUINO_PIN_11_PWM_DEV PWM_DEV(1)
# define ARDUINO_PIN_11_PWM_CHAN 0
# define ARDUINO_PIN_3_PWM_DEV PWM_DEV(1)
# define ARDUINO_PIN_3_PWM_CHAN 1
#elif defined(CPU_ATMEGA2560)
# define ARDUINO_PIN_13_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_13_PWM_CHAN 0
# define ARDUINO_PIN_4_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_4_PWM_CHAN 1
# define ARDUINO_PIN_10_PWM_DEV PWM_DEV(1)
# define ARDUINO_PIN_10_PWM_CHAN 0
# define ARDUINO_PIN_9_PWM_DEV PWM_DEV(1)
# define ARDUINO_PIN_9_PWM_CHAN 1
#elif defined(CPU_ATMEGA32U4)
# define ARDUINO_PIN_11_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_11_PWM_CHAN 0
# define ARDUINO_PIN_3_PWM_DEV PWM_DEV(0)
# define ARDUINO_PIN_3_PWM_CHAN 1
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,235 +0,0 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
* 2016 Laurent Navet <laurent.navet@gmail.com>
* 2017 Thomas Perrot <thomas.perrot@tupi.fr>
*
* 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_arduino-atmega
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins for Arduino Atmega boards
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Daniel Nordahl <nordahl.d@gmail.com>
* @author Laurent Navet <laurent.navet@gmail.com>
* @author Thomas Perrot <thomas.perrot@tupi.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
*
* @note ISCP pins are not mapped.
* @{
*/
/* Digital pins */
#ifdef CPU_ATMEGA328P
#define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 0)
#define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 1)
#define ARDUINO_PIN_2 GPIO_PIN(PORT_D, 2)
#define ARDUINO_PIN_3 GPIO_PIN(PORT_D, 3)
#define ARDUINO_PIN_4 GPIO_PIN(PORT_D, 4)
#define ARDUINO_PIN_5 GPIO_PIN(PORT_D, 5)
#define ARDUINO_PIN_6 GPIO_PIN(PORT_D, 6)
#define ARDUINO_PIN_7 GPIO_PIN(PORT_D, 7)
#define ARDUINO_PIN_8 GPIO_PIN(PORT_B, 0)
#define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 1)
#define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 2)
#define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 3)
#define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 4)
#define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 5)
/* Analog pins */
#define ARDUINO_PIN_14 GPIO_PIN(PORT_C, 0)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_C, 1)
#define ARDUINO_PIN_16 GPIO_PIN(PORT_C, 2)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 3)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 4)
#define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 5)
/* Analog input */
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
#endif
#ifdef CPU_ATMEGA32U4
/* Digital pins */
#define ARDUINO_PIN_0 GPIO_PIN(PORT_D, 2)
#define ARDUINO_PIN_1 GPIO_PIN(PORT_D, 3)
#define ARDUINO_PIN_2 GPIO_PIN(PORT_D, 1)
#define ARDUINO_PIN_3 GPIO_PIN(PORT_D, 0)
#define ARDUINO_PIN_5 GPIO_PIN(PORT_C, 6)
#define ARDUINO_PIN_7 GPIO_PIN(PORT_E, 6)
#define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 7)
#define ARDUINO_PIN_13 GPIO_PIN(PORT_C, 7)
#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 3)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 1)
#define ARDUINO_PIN_16 GPIO_PIN(PORT_B, 2)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_B, 0)
#define ARDUINO_PIN_30 GPIO_PIN(PORT_D, 5)
/* Analog pins */
#define ARDUINO_PIN_4 GPIO_PIN(PORT_D, 4)
#define ARDUINO_PIN_6 GPIO_PIN(PORT_D, 7)
#define ARDUINO_PIN_8 GPIO_PIN(PORT_B, 4)
#define ARDUINO_PIN_9 GPIO_PIN(PORT_B, 5)
#define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 6)
#define ARDUINO_PIN_12 GPIO_PIN(PORT_D, 6)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_F, 7)
#define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 6)
#define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5)
#define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 4)
#define ARDUINO_PIN_22 GPIO_PIN(PORT_F, 3)
#define ARDUINO_PIN_23 GPIO_PIN(PORT_F, 2)
/* Analog input */
#define ARDUINO_PIN_A0 ARDUINO_PIN_18
#define ARDUINO_PIN_A1 ARDUINO_PIN_19
#define ARDUINO_PIN_A2 ARDUINO_PIN_20
#define ARDUINO_PIN_A3 ARDUINO_PIN_21
#define ARDUINO_PIN_A4 ARDUINO_PIN_22
#define ARDUINO_PIN_A5 ARDUINO_PIN_23
#define ARDUINO_PIN_A6 ARDUINO_PIN_4
#define ARDUINO_PIN_A7 ARDUINO_PIN_6
#define ARDUINO_PIN_A8 ARDUINO_PIN_8
#define ARDUINO_PIN_A9 ARDUINO_PIN_9
#define ARDUINO_PIN_A10 ARDUINO_PIN_10
#define ARDUINO_PIN_A11 ARDUINO_PIN_12
#endif
#ifdef CPU_ATMEGA2560
#define ARDUINO_PIN_0 GPIO_PIN(PORT_E, 0)
#define ARDUINO_PIN_1 GPIO_PIN(PORT_E, 1)
#define ARDUINO_PIN_2 GPIO_PIN(PORT_E, 4)
#define ARDUINO_PIN_3 GPIO_PIN(PORT_E, 5)
#define ARDUINO_PIN_4 GPIO_PIN(PORT_G, 5)
#define ARDUINO_PIN_5 GPIO_PIN(PORT_E, 3)
#define ARDUINO_PIN_6 GPIO_PIN(PORT_H, 3)
#define ARDUINO_PIN_7 GPIO_PIN(PORT_H, 4)
#define ARDUINO_PIN_8 GPIO_PIN(PORT_H, 5)
#define ARDUINO_PIN_9 GPIO_PIN(PORT_H, 6)
#define ARDUINO_PIN_10 GPIO_PIN(PORT_B, 4)
#define ARDUINO_PIN_11 GPIO_PIN(PORT_B, 5)
#define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 6)
#define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 7)
#define ARDUINO_PIN_14 GPIO_PIN(PORT_J, 1)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_J, 0)
#define ARDUINO_PIN_16 GPIO_PIN(PORT_H, 1)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_H, 0)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_D, 3)
#define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 2)
#define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 1)
#define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 0)
#define ARDUINO_PIN_22 GPIO_PIN(PORT_A, 0)
#define ARDUINO_PIN_23 GPIO_PIN(PORT_A, 1)
#define ARDUINO_PIN_24 GPIO_PIN(PORT_A, 2)
#define ARDUINO_PIN_25 GPIO_PIN(PORT_A, 3)
#define ARDUINO_PIN_26 GPIO_PIN(PORT_A, 4)
#define ARDUINO_PIN_27 GPIO_PIN(PORT_A, 5)
#define ARDUINO_PIN_28 GPIO_PIN(PORT_A, 6)
#define ARDUINO_PIN_29 GPIO_PIN(PORT_A, 7)
#define ARDUINO_PIN_30 GPIO_PIN(PORT_C, 7)
#define ARDUINO_PIN_31 GPIO_PIN(PORT_C, 6)
#define ARDUINO_PIN_32 GPIO_PIN(PORT_C, 5)
#define ARDUINO_PIN_33 GPIO_PIN(PORT_C, 4)
#define ARDUINO_PIN_34 GPIO_PIN(PORT_C, 3)
#define ARDUINO_PIN_35 GPIO_PIN(PORT_C, 2)
#define ARDUINO_PIN_36 GPIO_PIN(PORT_C, 1)
#define ARDUINO_PIN_37 GPIO_PIN(PORT_E, 0)
#define ARDUINO_PIN_38 GPIO_PIN(PORT_D, 7)
#define ARDUINO_PIN_39 GPIO_PIN(PORT_G, 2)
#define ARDUINO_PIN_40 GPIO_PIN(PORT_G, 1)
#define ARDUINO_PIN_41 GPIO_PIN(PORT_G, 0)
#define ARDUINO_PIN_42 GPIO_PIN(PORT_L, 7)
#define ARDUINO_PIN_43 GPIO_PIN(PORT_L, 6)
#define ARDUINO_PIN_44 GPIO_PIN(PORT_L, 5)
#define ARDUINO_PIN_45 GPIO_PIN(PORT_L, 4)
#define ARDUINO_PIN_46 GPIO_PIN(PORT_L, 3)
#define ARDUINO_PIN_47 GPIO_PIN(PORT_L, 2)
#define ARDUINO_PIN_48 GPIO_PIN(PORT_L, 1)
#define ARDUINO_PIN_49 GPIO_PIN(PORT_L, 0)
#define ARDUINO_PIN_50 GPIO_PIN(PORT_B, 3)
#define ARDUINO_PIN_51 GPIO_PIN(PORT_B, 2)
#define ARDUINO_PIN_52 GPIO_PIN(PORT_B, 1)
#define ARDUINO_PIN_53 GPIO_PIN(PORT_B, 0)
#define ARDUINO_PIN_54 GPIO_PIN(PORT_F, 0)
#define ARDUINO_PIN_55 GPIO_PIN(PORT_F, 1)
#define ARDUINO_PIN_56 GPIO_PIN(PORT_F, 2)
#define ARDUINO_PIN_57 GPIO_PIN(PORT_F, 3)
#define ARDUINO_PIN_58 GPIO_PIN(PORT_F, 4)
#define ARDUINO_PIN_59 GPIO_PIN(PORT_F, 5)
#define ARDUINO_PIN_60 GPIO_PIN(PORT_F, 6)
#define ARDUINO_PIN_61 GPIO_PIN(PORT_F, 7)
#define ARDUINO_PIN_62 GPIO_PIN(PORT_K, 0)
#define ARDUINO_PIN_63 GPIO_PIN(PORT_K, 1)
#define ARDUINO_PIN_64 GPIO_PIN(PORT_K, 2)
#define ARDUINO_PIN_65 GPIO_PIN(PORT_K, 3)
#define ARDUINO_PIN_66 GPIO_PIN(PORT_K, 4)
#define ARDUINO_PIN_67 GPIO_PIN(PORT_K, 5)
#define ARDUINO_PIN_68 GPIO_PIN(PORT_K, 6)
#define ARDUINO_PIN_69 GPIO_PIN(PORT_K, 7)
#define ARDUINO_PIN_A0 ARDUINO_PIN_54
#define ARDUINO_PIN_A1 ARDUINO_PIN_55
#define ARDUINO_PIN_A2 ARDUINO_PIN_56
#define ARDUINO_PIN_A3 ARDUINO_PIN_57
#define ARDUINO_PIN_A4 ARDUINO_PIN_58
#define ARDUINO_PIN_A5 ARDUINO_PIN_59
#define ARDUINO_PIN_A6 ARDUINO_PIN_60
#define ARDUINO_PIN_A7 ARDUINO_PIN_61
#define ARDUINO_PIN_A8 ARDUINO_PIN_62
#define ARDUINO_PIN_A9 ARDUINO_PIN_63
#define ARDUINO_PIN_A10 ARDUINO_PIN_64
#define ARDUINO_PIN_A11 ARDUINO_PIN_65
#define ARDUINO_PIN_A12 ARDUINO_PIN_66
#define ARDUINO_PIN_A13 ARDUINO_PIN_67
#define ARDUINO_PIN_A14 ARDUINO_PIN_68
#define ARDUINO_PIN_A15 ARDUINO_PIN_69
#endif
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_A6 ADC_LINE(6)
#define ARDUINO_A7 ADC_LINE(7)
#ifdef CPU_ATMEGA2560
#define ARDUINO_A8 ADC_LINE(8)
#define ARDUINO_A9 ADC_LINE(9)
#define ARDUINO_A10 ADC_LINE(10)
#define ARDUINO_A11 ADC_LINE(11)
#define ARDUINO_A12 ADC_LINE(12)
#define ARDUINO_A13 ADC_LINE(13)
#define ARDUINO_A14 ADC_LINE(14)
#define ARDUINO_A15 ADC_LINE(15)
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -7,7 +7,15 @@
config BOARD_COMMON_ARDUINO_DUE
bool
select CPU_MODEL_SAM3X8E
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_DAC
select HAS_ARDUINO_I2C
select HAS_ARDUINO_PINS
select HAS_ARDUINO_SHIELD_ISP
select HAS_ARDUINO_SHIELD_MEGA
select HAS_ARDUINO_SHIELD_UNO
select HAS_ARDUINO_SPI
select HAS_ARDUINO_UART
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_GPIO

View File

@ -12,4 +12,12 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_dac
FEATURES_PROVIDED += arduino_i2c
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_shield_isp
FEATURES_PROVIDED += arduino_shield_mega
FEATURES_PROVIDED += arduino_shield_uno
FEATURES_PROVIDED += arduino_spi
FEATURES_PROVIDED += arduino_uart

View File

@ -1,141 +0,0 @@
/*
* Copyright (C) 2016,2017 Freie Universität Berlin
*
* 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_arduino_due
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 13 on this board
*/
#define ARDUINO_LED (13)
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_14,
ARDUINO_PIN_15,
ARDUINO_PIN_16,
ARDUINO_PIN_17,
ARDUINO_PIN_18,
ARDUINO_PIN_19,
ARDUINO_PIN_20,
ARDUINO_PIN_21,
ARDUINO_PIN_22,
ARDUINO_PIN_23,
ARDUINO_PIN_24,
ARDUINO_PIN_25,
ARDUINO_PIN_26,
ARDUINO_PIN_27,
ARDUINO_PIN_28,
ARDUINO_PIN_29,
ARDUINO_PIN_30,
ARDUINO_PIN_31,
ARDUINO_PIN_32,
ARDUINO_PIN_33,
ARDUINO_PIN_34,
ARDUINO_PIN_35,
ARDUINO_PIN_36,
ARDUINO_PIN_37,
ARDUINO_PIN_38,
ARDUINO_PIN_39,
ARDUINO_PIN_40,
ARDUINO_PIN_41,
ARDUINO_PIN_42,
ARDUINO_PIN_43,
ARDUINO_PIN_44,
ARDUINO_PIN_45,
ARDUINO_PIN_46,
ARDUINO_PIN_47,
ARDUINO_PIN_48,
ARDUINO_PIN_49,
ARDUINO_PIN_50,
ARDUINO_PIN_51,
ARDUINO_PIN_52,
ARDUINO_PIN_53,
ARDUINO_PIN_54,
ARDUINO_PIN_55,
ARDUINO_PIN_56,
ARDUINO_PIN_57,
ARDUINO_PIN_58,
ARDUINO_PIN_59,
ARDUINO_PIN_60,
ARDUINO_PIN_61,
ARDUINO_PIN_62,
ARDUINO_PIN_63,
ARDUINO_PIN_64,
ARDUINO_PIN_65,
ARDUINO_PIN_66,
ARDUINO_PIN_67,
ARDUINO_PIN_68,
ARDUINO_PIN_69,
ARDUINO_PIN_70,
ARDUINO_PIN_71,
ARDUINO_PIN_72,
ARDUINO_PIN_73,
ARDUINO_PIN_74,
ARDUINO_PIN_75,
ARDUINO_PIN_76,
ARDUINO_PIN_77,
ARDUINO_PIN_78,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
ARDUINO_A6,
ARDUINO_A7,
ARDUINO_A8,
ARDUINO_A9,
ARDUINO_A10,
ARDUINO_A11,
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -19,16 +19,46 @@
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#include "periph/gpio.h"
#include "periph/i2c.h"
#include "periph/spi.h"
#include "periph/uart.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Arduino's default UART device
* @{
*/
#define ARDUINO_UART_D0D1 UART_DEV(0)
/** @} */
/**
* @name Arduino's default SPI device
* @{
*/
/**
* @brief SPI_DEV(0) is connected to the ISP header
*/
#define ARDUINO_SPI_ISP SPI_DEV(0)
/** @} */
/**
* @name Arduino's I2C buses
* @{
*/
/**
* @brief The only configured I2C
*/
#define ARDUINO_I2C0 I2C_DEV(0)
/** @} */
/**
* @name Mapping of MCU pins to Arduino pins
* @{
@ -112,6 +142,28 @@ extern "C" {
#define ARDUINO_PIN_76 GPIO_PIN(PA, 27)
#define ARDUINO_PIN_77 GPIO_PIN(PA, 28)
#define ARDUINO_PIN_78 GPIO_PIN(PB, 23)
#define ARDUINO_PIN_LAST 78
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_54
#define ARDUINO_PIN_A1 ARDUINO_PIN_55
#define ARDUINO_PIN_A2 ARDUINO_PIN_56
#define ARDUINO_PIN_A3 ARDUINO_PIN_57
#define ARDUINO_PIN_A4 ARDUINO_PIN_58
#define ARDUINO_PIN_A5 ARDUINO_PIN_59
#define ARDUINO_PIN_A6 ARDUINO_PIN_60
#define ARDUINO_PIN_A7 ARDUINO_PIN_61
#define ARDUINO_PIN_A8 ARDUINO_PIN_62
#define ARDUINO_PIN_A9 ARDUINO_PIN_63
#define ARDUINO_PIN_A10 ARDUINO_PIN_64
#define ARDUINO_PIN_A11 ARDUINO_PIN_65
#define ARDUINO_PIN_DAC0 ARDUINO_PIN_66
#define ARDUINO_PIN_DAC1 ARDUINO_PIN_67
/** @} */
/**
@ -130,6 +182,8 @@ extern "C" {
#define ARDUINO_A9 ADC_LINE(11)
#define ARDUINO_A10 ADC_LINE(12)
#define ARDUINO_A11 ADC_LINE(13)
#define ARDUINO_ANALOG_PIN_LAST 11
/** @} */
/**
@ -138,11 +192,13 @@ extern "C" {
*/
#define ARDUINO_DAC0 DAC_LINE(0)
#define ARDUINO_DAC1 DAC_LINE(1)
#define ARDUINO_DAC_PIN_LAST 1 /**< DAC1 is the last DAC pin */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -16,7 +16,8 @@ config BOARD_COMMON_ARDUINO_MKR
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_ARDUINO_PWM
select HAS_HIGHLEVEL_STDIO

View File

@ -14,6 +14,7 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_pwm
FEATURES_PROVIDED += highlevel_stdio

View File

@ -1,97 +0,0 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
* 2016-2017 Inria
*
* 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_arduino-mkr
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#include "periph/pwm.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief On-board serial port mapping, stdio is used for Serial
*/
#ifndef ARDUINO_UART_DEV
#define ARDUINO_UART_DEV UART_UNDEF
#endif
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_14,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
ARDUINO_PIN_A6,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
ARDUINO_A6,
};
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (732U)
/**
* @brief List of PWM GPIO mappings
*/
static const arduino_pwm_t arduino_pwm_list[] = {
{ .pin = 2, .dev = PWM_DEV(0), .chan = 0 },
{ .pin = 3, .dev = PWM_DEV(0), .chan = 1 },
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,119 @@
/*
* Copyright (C) 2016-2017 Inria
*
* 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_arduino-mkr
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin D6 on Arduino MKR derivatives
*/
#define ARDUINO_LED (6U)
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO_PIN(PA, 22) /**< TC4-W0 */
#define ARDUINO_PIN_1 GPIO_PIN(PA, 23) /**< TC4-W1 */
#define ARDUINO_PIN_2 GPIO_PIN(PA, 10) /**< TCC0-W2 */
#define ARDUINO_PIN_3 GPIO_PIN(PA, 11) /**< TCC0-W3 */
#define ARDUINO_PIN_4 GPIO_PIN(PB, 10) /**< TCC0-W4 */
#define ARDUINO_PIN_5 GPIO_PIN(PB, 11) /**< TCC0-W5 */
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20) /**< TCC0-W6, on-board LED */
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21) /**< TCC0-W7 */
#define ARDUINO_PIN_8 GPIO_PIN(PA, 16) /**< SERCOM1-MOSI */
#define ARDUINO_PIN_9 GPIO_PIN(PA, 17) /**< SERCOM1-SCK */
#define ARDUINO_PIN_10 GPIO_PIN(PA, 19) /**< SERCOM1-MISO */
#define ARDUINO_PIN_11 GPIO_PIN(PA, 8) /**< SERCOM0-SDA, on-board pull-up */
#define ARDUINO_PIN_12 GPIO_PIN(PA, 9) /**< SERCOM0-SCL, on-board pull-up */
#define ARDUINO_PIN_13 GPIO_PIN(PB, 23) /**< SERCOM5-RX from MCU */
#define ARDUINO_PIN_14 GPIO_PIN(PB, 22) /**< SERCOM5-TX from MCU */
/* analog pins as digital pin: */
#define ARDUINO_PIN_15 GPIO_PIN(PA, 2) /**< AIN0, DAC0 */
#define ARDUINO_PIN_16 GPIO_PIN(PB, 2) /**< AIN10 */
#define ARDUINO_PIN_17 GPIO_PIN(PB, 3) /**< AIN11 */
#define ARDUINO_PIN_18 GPIO_PIN(PA, 4) /**< AIN4 */
#define ARDUINO_PIN_19 GPIO_PIN(PA, 5) /**< AIN5 */
#define ARDUINO_PIN_20 GPIO_PIN(PA, 6) /**< AIN6 */
#define ARDUINO_PIN_21 GPIO_PIN(PA, 7) /**< AIN7 */
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_15
#define ARDUINO_PIN_A1 ARDUINO_PIN_16
#define ARDUINO_PIN_A2 ARDUINO_PIN_17
#define ARDUINO_PIN_A3 ARDUINO_PIN_18
#define ARDUINO_PIN_A4 ARDUINO_PIN_19
#define ARDUINO_PIN_A5 ARDUINO_PIN_20
#define ARDUINO_PIN_A6 ARDUINO_PIN_21
/** @} */
/**
* @name Mapping of Arduino analog pins to RIOT ADC lines
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_A6 ADC_LINE(6)
#define ARDUINO_ANALOG_PIN_LAST 6
/** @} */
/**
* @name Mapping of Arduino pins to RIOT PWM dev and channel pairs
* @{
*/
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (732U)
#define ARDUINO_PIN_2_PWM_DEV PWM_DEV(0)
#define ARDUINO_PIN_2_PWM_CHAN 0
#define ARDUINO_PIN_3_PWM_DEV PWM_DEV(0)
#define ARDUINO_PIN_3_PWM_CHAN 1
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,80 +0,0 @@
/*
* Copyright (C) 2016-2017 Inria
*
* 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_arduino-mkr
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO_PIN(PA, 22) /* TC4-W0 */
#define ARDUINO_PIN_1 GPIO_PIN(PA, 23) /* TC4-W1 */
#define ARDUINO_PIN_2 GPIO_PIN(PA, 10) /* TCC0-W2 */
#define ARDUINO_PIN_3 GPIO_PIN(PA, 11) /* TCC0-W3 */
#define ARDUINO_PIN_4 GPIO_PIN(PB, 10) /* TCC0-W4 */
#define ARDUINO_PIN_5 GPIO_PIN(PB, 11) /* TCC0-W5 */
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20) /* TCC0-W6, on-board LED */
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21) /* TCC0-W7 */
#define ARDUINO_PIN_8 GPIO_PIN(PA, 16) /* SERCOM1-MOSI */
#define ARDUINO_PIN_9 GPIO_PIN(PA, 17) /* SERCOM1-SCK */
#define ARDUINO_PIN_10 GPIO_PIN(PA, 19) /* SERCOM1-MISO */
#define ARDUINO_PIN_11 GPIO_PIN(PA, 8) /* SERCOM0-SDA, on-board pull-up */
#define ARDUINO_PIN_12 GPIO_PIN(PA, 9) /* SERCOM0-SCL, on-board pull-up */
#define ARDUINO_PIN_13 GPIO_PIN(PB, 23) /* SERCOM5-RX from MCU */
#define ARDUINO_PIN_14 GPIO_PIN(PB, 22) /* SERCOM5-TX from MCU */
#define ARDUINO_PIN_A0 GPIO_PIN(PA, 2) /* AIN0, DAC0 */
#define ARDUINO_PIN_A1 GPIO_PIN(PB, 2) /* AIN10 */
#define ARDUINO_PIN_A2 GPIO_PIN(PB, 3) /* AIN11 */
#define ARDUINO_PIN_A3 GPIO_PIN(PA, 4) /* AIN4 */
#define ARDUINO_PIN_A4 GPIO_PIN(PA, 5) /* AIN5 */
#define ARDUINO_PIN_A5 GPIO_PIN(PA, 6) /* AIN6 */
#define ARDUINO_PIN_A6 GPIO_PIN(PA, 7) /* AIN7 */
/** @} */
/**
* @name Mapping of Arduino analog pins to RIOT ADC lines
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_A6 ADC_LINE(6)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -16,8 +16,14 @@ config BOARD_COMMON_ARDUINO_ZERO
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_I2C
select HAS_ARDUINO_PINS
select HAS_ARDUINO_PWM
select HAS_ARDUINO_SHIELD_ISP
select HAS_ARDUINO_SHIELD_UNO
select HAS_ARDUINO_SPI
select HAS_ARDUINO_UART
select HAVE_SAUL_GPIO

View File

@ -13,5 +13,11 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_i2c
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_pwm
FEATURES_PROVIDED += arduino_shield_isp
FEATURES_PROVIDED += arduino_shield_uno
FEATURES_PROVIDED += arduino_spi
FEATURES_PROVIDED += arduino_uart

View File

@ -1,94 +0,0 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
* 2016 Inria
*
* 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_arduino_zero
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#include "periph/pwm.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 13 on this board
*/
#define ARDUINO_LED (13)
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
};
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (732U)
/**
* @brief List of PWM GPIO mappings
*/
static const arduino_pwm_t arduino_pwm_list[] = {
{ .pin = 3, .dev = PWM_DEV(0), .chan = 1 },
{ .pin = 4, .dev = PWM_DEV(0), .chan = 0 },
{ .pin = 8, .dev = PWM_DEV(1), .chan = 0 },
{ .pin = 9, .dev = PWM_DEV(1), .chan = 1 },
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,147 @@
/*
* Copyright (C) 2016 Inria
*
* 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_arduino_zero
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/adc.h"
#include "periph/gpio.h"
#include "periph/i2c.h"
#include "periph/pwm.h"
#include "periph/spi.h"
#include "periph/uart.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Arduino's UART devices
* @{
*/
#define ARDUINO_UART_D0D1 UART_DEV(1)
/** @} */
/**
* @name Arduino's SPI buses
* @{
*/
/**
* @brief SPI_DEV(0) is connected to the ISP header
*/
#define ARDUINO_SPI_ISP SPI_DEV(0)
/** @} */
/**
* @name Arduino's I2C buses
* @{
*/
/**
* @brief The first I2C bus is next to the AREF pin
*/
#define ARDUINO_I2C_UNO I2C_DEV(0)
/** @} */
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO_PIN(PA, 11)
#define ARDUINO_PIN_1 GPIO_PIN(PA, 10)
#define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
#define ARDUINO_PIN_3 GPIO_PIN(PA, 9)
#define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#define ARDUINO_PIN_5 GPIO_PIN(PA, 15)
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20)
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21)
#define ARDUINO_PIN_8 GPIO_PIN(PA, 6)
#define ARDUINO_PIN_9 GPIO_PIN(PA, 7)
#define ARDUINO_PIN_10 GPIO_PIN(PA, 18)
#define ARDUINO_PIN_11 GPIO_PIN(PA, 16)
#define ARDUINO_PIN_12 GPIO_PIN(PA, 19)
#define ARDUINO_PIN_13 GPIO_PIN(PA, 17) /* on-board LED */
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO_PIN(PA, 2)
#define ARDUINO_PIN_15 GPIO_PIN(PB, 8)
#define ARDUINO_PIN_16 GPIO_PIN(PB, 9)
#define ARDUINO_PIN_17 GPIO_PIN(PA, 4)
#define ARDUINO_PIN_18 GPIO_PIN(PA, 5)
#define ARDUINO_PIN_19 GPIO_PIN(PB, 2)
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
/**
* @name Mapping of Arduino analog pins to RIOT ADC lines
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_ANALOG_PIN_LAST 5
/** @} */
/**
* @name Mapping of Arduino pins to RIOT PWM dev and channel pairs
* @{
*/
/**
* @brief PWM frequency
*/
#define ARDUINO_PWM_FREQU (732U)
#define ARDUINO_PIN_3_PWM_DEV PWM_DEV(0)
#define ARDUINO_PIN_3_PWM_CHAN 1
#define ARDUINO_PIN_4_PWM_DEV PWM_DEV(0)
#define ARDUINO_PIN_4_PWM_CHAN 0
#define ARDUINO_PIN_8_PWM_DEV PWM_DEV(1)
#define ARDUINO_PIN_8_PWM_CHAN 0
#define ARDUINO_PIN_9_PWM_DEV PWM_DEV(1)
#define ARDUINO_PIN_9_PWM_CHAN 1
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,77 +0,0 @@
/*
* Copyright (C) 2016 Inria
*
* 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_arduino_zero
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* You can use the defines in this file for simplified interaction with the
* Arduino specific pin numbers.
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO_PIN(PA, 11)
#define ARDUINO_PIN_1 GPIO_PIN(PA, 10)
#define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
#define ARDUINO_PIN_3 GPIO_PIN(PA, 9)
#define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#define ARDUINO_PIN_5 GPIO_PIN(PA, 15)
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20)
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21)
#define ARDUINO_PIN_8 GPIO_PIN(PA, 6)
#define ARDUINO_PIN_9 GPIO_PIN(PA, 7)
#define ARDUINO_PIN_10 GPIO_PIN(PA, 18)
#define ARDUINO_PIN_11 GPIO_PIN(PA, 16)
#define ARDUINO_PIN_12 GPIO_PIN(PA, 19)
#define ARDUINO_PIN_13 GPIO_PIN(PA, 17) /* on-board LED */
#define ARDUINO_PIN_A0 GPIO_PIN(PA, 2)
#define ARDUINO_PIN_A1 GPIO_PIN(PB, 8)
#define ARDUINO_PIN_A2 GPIO_PIN(PB, 9)
#define ARDUINO_PIN_A3 GPIO_PIN(PA, 4)
#define ARDUINO_PIN_A4 GPIO_PIN(PA, 5)
#define ARDUINO_PIN_A5 GPIO_PIN(PB, 2)
/** @} */
/**
* @name Mapping of Arduino analog pins to RIOT ADC lines
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A1 ADC_LINE(1)
#define ARDUINO_A2 ADC_LINE(2)
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -6,7 +6,7 @@
config BOARD_COMMON_ESP8266
bool
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM

View File

@ -8,4 +8,4 @@ FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -7,7 +7,10 @@
config BOARD_COMMON_NUCLEO144
bool
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_ARDUINO_SHIELD_MEGA
select HAS_ARDUINO_SHIELD_UNO
# Clock configuration
select BOARD_HAS_HSE if !CPU_FAM_L4 && !CPU_FAM_L5

View File

@ -1,2 +1,5 @@
# Various common features of Nucleo-144 boards
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_shield_mega
FEATURES_PROVIDED += arduino_shield_uno

View File

@ -1,73 +0,0 @@
/*
* Copyright (C) 2017 Inria
*
* 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_nucleo144
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_14,
ARDUINO_PIN_15,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -19,8 +19,8 @@
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
@ -57,23 +57,37 @@ extern "C" {
#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 8)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 9)
#define ARDUINO_PIN_A0 GPIO_PIN(PORT_A, 3)
#define ARDUINO_PIN_A1 GPIO_PIN(PORT_C, 0)
#define ARDUINO_PIN_A2 GPIO_PIN(PORT_C, 3)
#define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_C, 0)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_C, 3)
#if defined(CPU_MODEL_STM32F413ZH) || defined(CPU_MODEL_STM32F412ZG) || \
defined(CPU_MODEL_STM32L496ZG)
#define ARDUINO_PIN_A3 GPIO_PIN(PORT_C, 1)
#define ARDUINO_PIN_A4 GPIO_PIN(PORT_C, 4)
#define ARDUINO_PIN_A5 GPIO_PIN(PORT_C, 5)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_C, 1)
# define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 4)
# define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 5)
#elif defined(CPU_MODEL_STM32F303ZE)
#define ARDUINO_PIN_A3 GPIO_PIN(PORT_D, 11)
#define ARDUINO_PIN_A4 GPIO_PIN(PORT_D, 12)
#define ARDUINO_PIN_A5 GPIO_PIN(PORT_D, 13)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_D, 11)
# define ARDUINO_PIN_20 GPIO_PIN(PORT_D, 12)
# define ARDUINO_PIN_21 GPIO_PIN(PORT_D, 13)
#else
#define ARDUINO_PIN_A3 GPIO_PIN(PORT_F, 3)
#define ARDUINO_PIN_A4 GPIO_PIN(PORT_F, 5)
#define ARDUINO_PIN_A5 GPIO_PIN(PORT_F, 10)
# define ARDUINO_PIN_19 GPIO_PIN(PORT_F, 3)
# define ARDUINO_PIN_20 GPIO_PIN(PORT_F, 5)
# define ARDUINO_PIN_21 GPIO_PIN(PORT_F, 10)
#endif
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_16
#define ARDUINO_PIN_A1 ARDUINO_PIN_17
#define ARDUINO_PIN_A2 ARDUINO_PIN_18
#define ARDUINO_PIN_A3 ARDUINO_PIN_19
#define ARDUINO_PIN_A4 ARDUINO_PIN_20
#define ARDUINO_PIN_A5 ARDUINO_PIN_21
/** @} */
/**
@ -86,11 +100,13 @@ extern "C" {
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_ANALOG_PIN_LAST 5
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -7,7 +7,9 @@
config BOARD_COMMON_NUCLEO32
bool
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_ARDUINO_SHIELD_NANO
# Clock configuration
select BOARD_HAS_LSE if (CPU_FAM_L0 || CPU_FAM_L4) && !BOARD_NUCLEO_L011K4

View File

@ -1,2 +1,4 @@
# Various common features of Nucleo boards
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_shield_nano

View File

@ -1,80 +0,0 @@
/*
* Copyright (C) 2017 Inria
*
* 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_nucleo32
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 13 on this board
*/
#define ARDUINO_LED (13)
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
ARDUINO_PIN_A6,
ARDUINO_PIN_A7
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
ARDUINO_A6,
ARDUINO_A7,
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -19,8 +19,8 @@
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
@ -54,14 +54,31 @@ extern "C" {
#define ARDUINO_PIN_12 GPIO_PIN(PORT_B, 4)
#define ARDUINO_PIN_13 GPIO_PIN(PORT_B, 3) /* on-board LED */
#define ARDUINO_PIN_A0 GPIO_PIN(PORT_A, 0)
#define ARDUINO_PIN_A1 GPIO_PIN(PORT_A, 1)
#define ARDUINO_PIN_A2 GPIO_PIN(PORT_A, 3)
#define ARDUINO_PIN_A3 GPIO_PIN(PORT_A, 4)
#define ARDUINO_PIN_A4 GPIO_PIN(PORT_A, 5)
#define ARDUINO_PIN_A5 GPIO_PIN(PORT_A, 6)
#define ARDUINO_PIN_A6 GPIO_PIN(PORT_A, 7)
#define ARDUINO_PIN_A7 GPIO_PIN(PORT_A, 2)
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO_PIN(PORT_A, 0)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_A, 1)
#define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 3)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_A, 4)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_A, 5)
#define ARDUINO_PIN_19 GPIO_PIN(PORT_A, 6)
#define ARDUINO_PIN_20 GPIO_PIN(PORT_A, 7)
#define ARDUINO_PIN_21 GPIO_PIN(PORT_A, 2)
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
#define ARDUINO_PIN_A6 ARDUINO_PIN_20
#define ARDUINO_PIN_A7 ARDUINO_PIN_21
/** @} */
/**
@ -76,11 +93,13 @@ extern "C" {
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_A6 ADC_LINE(6)
#define ARDUINO_A7 ADC_LINE(7)
#define ARDUINO_ANALOG_PIN_LAST 7
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -7,7 +7,12 @@
config BOARD_COMMON_NUCLEO64
bool
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_I2C
select HAS_ARDUINO_PINS
select HAS_ARDUINO_SHIELD_UNO
select HAS_ARDUINO_SPI
select HAS_ARDUINO_UART
# Clock configuration
select BOARD_HAS_HSE if !CPU_FAM_G0 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4

View File

@ -1,2 +1,7 @@
# Various common features of Nucleo boards
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_i2c
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += arduino_shield_uno
FEATURES_PROVIDED += arduino_spi
FEATURES_PROVIDED += arduino_uart

View File

@ -1,78 +0,0 @@
/*
* Copyright (C) 2016 Freie Universität Berlin
* 2016 Inria
*
* 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_nucleo64
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_pinmap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to pin 13 on this board
*/
#define ARDUINO_LED (13)
/**
* @brief Look-up table for the Arduino's digital pins
*/
static const gpio_t arduino_pinmap[] = {
ARDUINO_PIN_0,
ARDUINO_PIN_1,
ARDUINO_PIN_2,
ARDUINO_PIN_3,
ARDUINO_PIN_4,
ARDUINO_PIN_5,
ARDUINO_PIN_6,
ARDUINO_PIN_7,
ARDUINO_PIN_8,
ARDUINO_PIN_9,
ARDUINO_PIN_10,
ARDUINO_PIN_11,
ARDUINO_PIN_12,
ARDUINO_PIN_13,
ARDUINO_PIN_A0,
ARDUINO_PIN_A1,
ARDUINO_PIN_A2,
ARDUINO_PIN_A3,
ARDUINO_PIN_A4,
ARDUINO_PIN_A5,
};
/**
* @brief Look-up table for the Arduino's analog pins
*/
static const adc_t arduino_analog_map[] = {
ARDUINO_A0,
ARDUINO_A1,
ARDUINO_A2,
ARDUINO_A3,
ARDUINO_A4,
ARDUINO_A5,
};
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -19,8 +19,8 @@
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
@ -29,6 +29,33 @@
extern "C" {
#endif
/**
* @name Arduino's UART devices
* @{
*/
#define ARDUINO_UART_D0D1 UART_DEV(0)
/** @} */
/**
* @name Arduino's SPI buses
* @{
*/
/**
* @brief SPI_DEV(1) is connected to D11/D12/D13
*/
#define ARDUINO_SPI_D11D12D13 SPI_DEV(1)
/** @} */
/**
* @name Arduino's I2C buses
* @{
*/
/**
* @brief The first I2C bus is where shields for the Arduino UNO expect it
*/
#define ARDUINO_I2C_UNO I2C_DEV(0)
/** @} */
/**
* @brief Mapping of MCU pins to Arduino pins
* @{
@ -57,12 +84,27 @@ extern "C" {
#define ARDUINO_PIN_14 GPIO_PIN(PORT_B, 9)
#define ARDUINO_PIN_15 GPIO_PIN(PORT_B, 8)
#define ARDUINO_PIN_A0 GPIO_PIN(PORT_A, 0)
#define ARDUINO_PIN_A1 GPIO_PIN(PORT_A, 1)
#define ARDUINO_PIN_A2 GPIO_PIN(PORT_A, 4)
#define ARDUINO_PIN_A3 GPIO_PIN(PORT_B, 0)
#define ARDUINO_PIN_A4 GPIO_PIN(PORT_C, 1)
#define ARDUINO_PIN_A5 GPIO_PIN(PORT_C, 0)
/* analog pins as digital pins: */
#define ARDUINO_PIN_16 GPIO_PIN(PORT_A, 0)
#define ARDUINO_PIN_17 GPIO_PIN(PORT_A, 1)
#define ARDUINO_PIN_18 GPIO_PIN(PORT_A, 4)
#define ARDUINO_PIN_19 GPIO_PIN(PORT_B, 0)
#define ARDUINO_PIN_20 GPIO_PIN(PORT_C, 1)
#define ARDUINO_PIN_21 GPIO_PIN(PORT_C, 0)
#define ARDUINO_PIN_LAST 21
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_16
#define ARDUINO_PIN_A1 ARDUINO_PIN_17
#define ARDUINO_PIN_A2 ARDUINO_PIN_18
#define ARDUINO_PIN_A3 ARDUINO_PIN_19
#define ARDUINO_PIN_A4 ARDUINO_PIN_20
#define ARDUINO_PIN_A5 ARDUINO_PIN_21
/** @} */
/**
@ -75,11 +117,13 @@ extern "C" {
#define ARDUINO_A3 ADC_LINE(3)
#define ARDUINO_A4 ADC_LINE(4)
#define ARDUINO_A5 ADC_LINE(5)
#define ARDUINO_ANALOG_PIN_LAST 5
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -6,7 +6,8 @@
config BOARD_COMMON_SILABS
bool
select HAS_ARDUINO
select HAS_ARDUINO_ANALOG
select HAS_ARDUINO_PINS
select HAS_EFM32_CORETEMP
select HAS_RIOTBOOT

View File

@ -1,6 +1,7 @@
CPU = efm32
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_analog
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += efm32_coretemp
FEATURES_PROVIDED += riotboot

View File

@ -1,58 +0,0 @@
/*
* 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 */
/** @} */

View File

@ -14,8 +14,8 @@
* @{
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "board.h"
#include "periph_cpu.h"
@ -26,21 +26,29 @@ extern "C" {
#endif
/**
* @brief Arduino's digital pins mappings
* @name 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
#define ARDUINO_PIN_0 LED0_PIN
#define ARDUINO_PIN_1 LED1_PIN
#define ARDUINO_PIN_2 PB0_PIN
#define ARDUINO_PIN_3 PB1_PIN
#define ARDUINO_PIN_LAST 3
/** @} */
/**
* @brief Arduino's analog pins mappings
* @name Arduino's analog pins mappings
* @{
*/
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_A0 ADC_LINE(0)
#define ARDUINO_ANALOG_PIN_LAST 0
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -14,7 +14,7 @@ config BOARD_COMMON_SODAQ
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_HIGHLEVEL_STDIO
select HAVE_SAUL_GPIO

View File

@ -11,5 +11,5 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += highlevel_stdio

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_HELTEC_LORA32_V2
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_D0WD
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_RTC_TIMER_32K
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C

View File

@ -10,4 +10,4 @@ FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += esp_rtc_timer_32k
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2019 Gunar Schorcht
*
* 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_esp32_heltec-lora32-v2
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to Arduino pin 3 on this board
*/
#define ARDUINO_LED (3)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2019 Gunar Schorcht
*
* 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_esp32_heltec-lora32-v2
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO12 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO25 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO13 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO0 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO2 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO22 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO23 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO17 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO18 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO27 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO5 /**< Arduino pin 13 (SCK) */
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO36 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO39 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO37 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO38 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO4 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO15 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2019 Gunar Schorcht
*
* 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_esp32_heltec-lora32-v2
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO12 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO25 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO13 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO0 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO2 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO22 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO23 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO17 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO18 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO27 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO5 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO36 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO39 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO37 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO38 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO4 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO15 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_MH_ET_LIVE_MINIKIT
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROOM_32
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C

View File

@ -10,4 +10,4 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_mh-et-live-minikit
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to Arduino pin 3 on this board
*/
#define ARDUINO_LED (3)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_mh-et-live-minikit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO32 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO2 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO27 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO0 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO4 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO33 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO25 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO15 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino pin 13 (SCK) */
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO34 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO35 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO36 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO39 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO21 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO22 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_mh-et-live-minikit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO32 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO2 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO27 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO0 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO4 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO33 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO25 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO15 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO34 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO35 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO36 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO39 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO21 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO22 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_OLIMEX_EVB
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROOM_32
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_ETH
select HAS_PERIPH_ADC if USEMODULE_OLIMEX_ESP32_GATEWAY
select HAS_PERIPH_I2C

View File

@ -16,4 +16,4 @@ FEATURES_PROVIDED += esp_eth # Ethernet MAC (EMAC)
FEATURES_PROVIDED += periph_can # CAN peripheral interface
FEATURES_PROVIDED += periph_ir # IR peripheral interface
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_olimex-esp32-evb
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is not available
*/
#define ARDUINO_LED (0)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,77 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_olimex-esp32-evb
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO32 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO33 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO4 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO9 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO10 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO7 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO8 /**< Arduino pin 8 */
#define ARDUINO_PIN_10 GPIO17 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO15 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino pin 13 (SCK) */
#define ARDUINO_PIN_14 GPIO34 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO35 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO36 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO39 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO13 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO16 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_olimex-esp32-evb
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO32 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO33 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO4 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO9 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO10 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO7 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO8 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO_UNDEF /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO17 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO15 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO34 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO35 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO36 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO39 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO13 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO16 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_TTGO_T_BEAM
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_D0WD
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_SPI_RAM
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC

View File

@ -11,7 +11,7 @@ FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins
# unique features provided by the board
FEATURES_PROVIDED += esp_spi_ram

View File

@ -1,40 +0,0 @@
/*
* Copyright (C) 2019 Yegor Yefremov
*
* 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_esp32_ttgo-t-beam
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Yegor Yefremov <yegorslists@googlemail.com>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to Arduino pin 3 on this board
*/
#ifndef MODULE_ESP32_TTGO_T_BEAM_V1_0
#define ARDUINO_LED (3)
#endif
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,71 @@
/*
* Copyright (C) 2019 Yegor Yefremov
*
* 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_esp32_ttgo-t-beam
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Yegor Yefremov <yegorslists@googlemail.com>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO0 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO2 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO4 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO13 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO15 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO21 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO22 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO23 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino pin 13 (LED) */
#define ARDUINO_PIN_14 GPIO25 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO32 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO33 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO35 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO36 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO39 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,60 +0,0 @@
/*
* Copyright (C) 2019 Yegor Yefremov
*
* 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_esp32_ttgo-t-beam
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Yegor Yefremov <yegorslists@googlemail.com>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO0 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO2 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO4 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO13 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO15 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO21 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO22 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO23 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO_UNDEF /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO_UNDEF /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO_UNDEF /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino Uno pin 13 (LED) */
#define ARDUINO_PIN_A0 GPIO25 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO32 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO33 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO35 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO36 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO39 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_WEMOS_LOLIN_D32_PRO
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C

View File

@ -11,4 +11,4 @@ FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += sdcard_spi
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,41 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wemos-lolin-d32-pro
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is connected to Arduino pin 10 on this board
*/
#define ARDUINO_LED (10)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wemos-lolin-d32-pro
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO4 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO0 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO13 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO2 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO15 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO25 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO26 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO32 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino pin 13 (SCK) */
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO36 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO39 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO34 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO35 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO21 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO22 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wemos-lolin-d32-pro
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO4 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO0 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO13 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO2 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO15 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO25 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO26 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO32 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO36 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO39 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO34 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO35 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO21 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO22 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_WROOM_32
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROOM_32
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_PERIPH_ADC
select HAS_PERIPH_DAC
select HAS_PERIPH_I2C

View File

@ -10,4 +10,4 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wroom-32
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is not available
*/
#define ARDUINO_LED (0)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wroom-32
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO12 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO27 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO2 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO32 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO33 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO13 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO14 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO0 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino pin 13 (SCK) */
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO25 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO26 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO4 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO15 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO21 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO22 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_wroom-32
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO12 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO27 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO2 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO32 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO33 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO13 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO14 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO0 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO5 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO23 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO19 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO18 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO25 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO26 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO4 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO15 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO21 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO22 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -12,7 +12,7 @@ config BOARD_ESP32_WROVER_KIT
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_RTC_TIMER_32K
select HAS_ESP_JTAG
select HAS_PERIPH_ADC

View File

@ -14,4 +14,4 @@ FEATURES_PROVIDED += sdcard_spi
FEATURES_PROVIDED += esp_rtc_timer_32k
FEATURES_PROVIDED += esp_jtag
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_esp-wrover-kit
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is not available
*/
#define ARDUINO_LED (0)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_esp-wrover-kit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO19 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO0 /**< Arduino pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO22 /**< Arduino pin 4 */
#define ARDUINO_PIN_5 GPIO4 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO23 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO25 /**< Arduino pin 7 */
#define ARDUINO_PIN_8 GPIO9 /**< Arduino pin 8 */
#define ARDUINO_PIN_9 GPIO10 /**< Arduino pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO13 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO15 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino pin 13 (SCK) */
#define ARDUINO_PIN_14 GPIO34 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO35 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO36 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO39 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO26 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO27 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,64 +0,0 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32_esp-wrover-kit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO3 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO1 /**< Arduino Uno pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO19 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO0 /**< Arduino Uno pin 3 (PWM) */
#define ARDUINO_PIN_4 GPIO22 /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO4 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO23 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO25 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO9 /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO10 /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO13 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO15 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO14 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO34 /**< Arduino Uno pin A0 */
#define ARDUINO_PIN_A1 GPIO35 /**< Arduino Uno pin A1 */
#define ARDUINO_PIN_A2 GPIO36 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO39 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO26 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO27 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -13,7 +13,7 @@ config BOARD_ESP32C3_DEVKIT
default y
select BOARD_COMMON_ESP32C3
select CPU_MODEL_ESP32C3_MINI_1X
select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_JTAG
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C

View File

@ -12,4 +12,4 @@ FEATURES_PROVIDED += periph_spi
# unique features provided by the board
FEATURES_PROVIDED += esp_jtag
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* 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_esp32c3_devkit
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED is not available
*/
#define ARDUINO_LED (0)
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* 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_esp32c3_devkit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO20 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO21 /**< Arduino pin 1 (TxD) */
#if !defined(MODULE_ESP_RTC_TIMER_32K)
#define ARDUINO_PIN_2 GPIO0 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO1 /**< Arduino pin 3 (PWM) */
#endif
#define ARDUINO_PIN_5 GPIO3 /**< Arduino pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO4 /**< Arduino pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO8 /**< Arduino pin 7 */
#define ARDUINO_PIN_10 GPIO10 /**< Arduino pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO7 /**< Arduino pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO6 /**< Arduino pin 13 (SCK) */
/* analog pins as digital pins: */
#define ARDUINO_PIN_14 GPIO0 /**< Arduino pin A0 */
#if !defined(MODULE_ESP_RTC_TIMER_32K)
#define ARDUINO_PIN_15 GPIO1 /**< Arduino pin A1 */
#endif
#define ARDUINO_PIN_16 GPIO2 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO3 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO5 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO4 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

View File

@ -1,71 +0,0 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* 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_esp32c3_devkit
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_PINMAP_H
#define ARDUINO_PINMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO20 /**< Arduino Uno pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO21 /**< Arduino Uno pin 1 (TxD) */
#if !defined(MODULE_ESP_RTC_TIMER_32K)
#define ARDUINO_PIN_2 GPIO0 /**< Arduino Uno pin 2 */
#define ARDUINO_PIN_3 GPIO1 /**< Arduino Uno pin 3 (PWM) */
#else
#define ARDUINO_PIN_2 GPIO_UNDEF /**< Arduino Uno pin 2 */
#endif
#define ARDUINO_PIN_4 GPIO_UNDEF /**< Arduino Uno pin 4 */
#define ARDUINO_PIN_5 GPIO3 /**< Arduino Uno pin 5 (PWM) */
#define ARDUINO_PIN_6 GPIO4 /**< Arduino Uno pin 6 (PWM) */
#define ARDUINO_PIN_7 GPIO8 /**< Arduino Uno pin 7 */
#define ARDUINO_PIN_8 GPIO_UNDEF /**< Arduino Uno pin 8 */
#define ARDUINO_PIN_9 GPIO_UNDEF /**< Arduino Uno pin 9 (PWM) */
#define ARDUINO_PIN_10 GPIO10 /**< Arduino Uno pin 10 (CS0 / PWM) */
#define ARDUINO_PIN_11 GPIO7 /**< Arduino Uno pin 11 (MOSI / PWM) */
#define ARDUINO_PIN_12 GPIO2 /**< Arduino Uno pin 12 (MISO) */
#define ARDUINO_PIN_13 GPIO6 /**< Arduino Uno pin 13 (SCK) */
#define ARDUINO_PIN_A0 GPIO0 /**< Arduino Uno pin A0 */
#if !defined(MODULE_ESP_RTC_TIMER_32K)
#define ARDUINO_PIN_A1 GPIO1 /**< Arduino Uno pin A1 */
#else
#define ARDUINO_PIN_A1 GPIO_UNDEF /**< Arduino Uno pin A1 */
#endif
#define ARDUINO_PIN_A2 GPIO2 /**< Arduino Uno pin A2 */
#define ARDUINO_PIN_A3 GPIO3 /**< Arduino Uno pin A3 */
#define ARDUINO_PIN_A4 GPIO5 /**< Arduino Uno pin A4 (SDA) */
#define ARDUINO_PIN_A5 GPIO4 /**< Arduino Uno pin A5 (SCL) */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_PINMAP_H */
/** @} */

View File

@ -13,7 +13,7 @@ config BOARD_ESP32C3_WEMOS_MINI
default y
select BOARD_COMMON_ESP32C3
select CPU_MODEL_ESP32C3_FH4
# select HAS_ARDUINO
select HAS_ARDUINO_PINS
select HAS_ESP_JTAG
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C

View File

@ -12,4 +12,4 @@ FEATURES_PROVIDED += periph_spi
# unique features provided by the board
FEATURES_PROVIDED += esp_jtag
#FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += arduino_pins

View File

@ -1,42 +0,0 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* 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_esp32c3_wemos_mini
* @{
*
* @file
* @brief Board specific configuration for the Arduino API
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_BOARD_H
#define ARDUINO_BOARD_H
#include "arduino_board_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The on-board LED (not available on board version 2.1.0)
*/
#ifdef MODULE_ESP32C3_WEMOS_MINI_V1_0_0
#define ARDUINO_LED (5)
#else /* MODULE_ESP32C3_WEMOS_MINI_V2_1_0 */
#define ARDUINO_LED (0)
#endif
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_BOARD_H */
/** @} */

View File

@ -0,0 +1,87 @@
/*
* Copyright (C) 2022 Gunar Schorcht
*
* 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_esp32c3_wemos_mini
* @{
*
* @file
* @brief Mapping from MCU pins to Arduino pins
*
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#ifndef ARDUINO_IOMAP_H
#define ARDUINO_IOMAP_H
#include "periph/gpio.h"
#include "periph/adc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Mapping of MCU pins to Arduino pins
* @{
*/
#define ARDUINO_PIN_0 GPIO20 /**< Arduino pin 0 (RxD) */
#define ARDUINO_PIN_1 GPIO21 /**< Arduino pin 1 (TxD) */
#define ARDUINO_PIN_2 GPIO9 /**< Arduino pin 2 */
#define ARDUINO_PIN_3 GPIO6 /**< Arduino pin 3 (PWM) */
#ifdef MODULE_ESP32C3_WEMOS_MINI_V1_0_0
# define ARDUINO_PIN_5 GPIO7 /**< Arduino pin 5 (PWM) */
# define ARDUINO_PIN_6 GPIO1 /**< Arduino pin 6 (PWM) */
# define ARDUINO_PIN_7 GPIO0 /**< Arduino pin 7 */
#else /* MODULE_ESP32C3_WEMOS_MINI_V2_1_0 */
# define ARDUINO_PIN_6 GPIO2 /**< Arduino pin 6 (PWM) */
# define ARDUINO_PIN_7 GPIO3 /**< Arduino pin 7 */
#endif
#ifdef MODULE_ESP32C3_WEMOS_MINI_V1_0_0
# define ARDUINO_PIN_10 GPIO5 /**< Arduino pin 10 (CS0 / PWM) */
# define ARDUINO_PIN_11 GPIO4 /**< Arduino pin 11 (MOSI / PWM) */
# define ARDUINO_PIN_12 GPIO3 /**< Arduino pin 12 (MISO) */
# define ARDUINO_PIN_13 GPIO2 /**< Arduino pin 13 (SCK) */
#else /* MODULE_ESP32C3_WEMOS_MINI_V2_1_0 */
# define ARDUINO_PIN_10 GPIO5 /**< Arduino pin 10 (CS0 / PWM) */
# define ARDUINO_PIN_11 GPIO4 /**< Arduino pin 11 (MOSI / PWM) */
# define ARDUINO_PIN_12 GPIO0 /**< Arduino pin 12 (MISO) */
# define ARDUINO_PIN_13 GPIO1 /**< Arduino pin 13 (SCK) */
#endif
/* analog pins as digital pin: */
#define ARDUINO_PIN_14 GPIO0 /**< Arduino pin A0 */
#define ARDUINO_PIN_15 GPIO1 /**< Arduino pin A1 */
#define ARDUINO_PIN_16 GPIO2 /**< Arduino pin A2 */
#define ARDUINO_PIN_17 GPIO3 /**< Arduino pin A3 */
#define ARDUINO_PIN_18 GPIO4 /**< Arduino pin A4 (SDA) */
#define ARDUINO_PIN_19 GPIO5 /**< Arduino pin A5 (SCL) */
#define ARDUINO_PIN_LAST 19
/** @} */
/**
* @name Aliases for analog pins
* @{
*/
#define ARDUINO_PIN_A0 ARDUINO_PIN_14
#define ARDUINO_PIN_A1 ARDUINO_PIN_15
#define ARDUINO_PIN_A2 ARDUINO_PIN_16
#define ARDUINO_PIN_A3 ARDUINO_PIN_17
#define ARDUINO_PIN_A4 ARDUINO_PIN_18
#define ARDUINO_PIN_A5 ARDUINO_PIN_19
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_IOMAP_H */
/** @} */

Some files were not shown because too many files have changed in this diff Show More