1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/adafruit-metro-m4-express/include/board.h
Marian Buschsieweke d9863c6b3c
boards/adafruit-metro-m4-express: initial port
This adds the board specification of the Adafruit Metro M4 Express [1].
The significance of this board is that it is compatible with both
classical SPI Arduino Shields using the ISP header for SPI
(such as `shield_w5100`) and more recent shields using D11/D12/D13 as
SPI (such as `shield_llcc68`).

[1]: https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51/overview
2024-10-22 15:54:45 +02:00

79 lines
2.5 KiB
C

/*
* Copyright (C) 2024 ML!PA Consulting GmbH
*
* 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_adafruit-metro-m4-express
* @{
*
* @file
* @brief Board specific definitions for the Adafruit Metro M4 Express
*
* @author Marian Buschsieweke <marian.buschsieweke@posteo.net>
*/
#ifndef BOARD_H
#define BOARD_H
#include "arduino_iomap.h"
#include "cpu.h"
#include "periph/gpio.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name LED pin definitions and handlers
* @{
*/
#define LED0_PIN GPIO_PIN(PA, 16) /**< User LED red (D13) */
#define LED1_PIN GPIO_PIN(PA, 27) /**< TX LED yellow */
#define LED2_PIN GPIO_PIN(PB, 6) /**< RX LED yellow */
#define LED0_PORT PORT->Group[PA] /**< Port of User LED red (D13) */
#define LED0_MASK (1U << 16) /**< Mask of User LED red (D13) */
#define LED1_PORT PORT->Group[PA] /**< Port of TX LED yellow */
#define LED1_MASK (1U << 27) /**< Mask of TX LED yellow */
#define LED2_PORT PORT->Group[PB] /**< Port of RX LED yellow */
#define LED2_MASK (1U << 6) /**< Mask of RX LED yellow */
#define LED0_ON (LED0_PORT.OUTSET.reg = LED0_MASK) /**< Switch on User LED red (D13) */
#define LED0_OFF (LED0_PORT.OUTCLR.reg = LED0_MASK) /**< Switch off User LED red (D13) */
#define LED0_TOGGLE (LED0_PORT.OUTTGL.reg = LED0_MASK) /**< Toggle User LED red (D13) */
#define LED1_ON (LED1_PORT.OUTCLR.reg = LED1_MASK) /**< Switch on TX LED yellow */
#define LED1_OFF (LED1_PORT.OUTSET.reg = LED1_MASK) /**< Switch off TX LED yellow */
#define LED1_TOGGLE (LED1_PORT.OUTTGL.reg = LED1_MASK) /**< Toggle TX LED yellow */
#define LED2_ON (LED2_PORT.OUTCLR.reg = LED2_MASK) /**< Switch on RX LED yellow */
#define LED2_OFF (LED2_PORT.OUTSET.reg = LED2_MASK) /**< Switch off RX LED yellow */
#define LED2_TOGGLE (LED2_PORT.OUTTGL.reg = LED2_MASK) /**< Toggle User RX LED yellow */
#ifndef WS281X_PARAM_PIN
#define WS281X_PARAM_PIN GPIO_PIN(PB, 22) /**< GPIO pin connected to the data pin */
#endif
#ifndef WS281X_PARAM_NUMOF
#define WS281X_PARAM_NUMOF (1U) /**< Number of LEDs chained */
#endif
/** @} */
/**
* @name MTD configuration
* @{
*/
#define MTD_0 mtd_dev_get(0) /**< MTD device for the 8 MiB QSPI Flash */
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */