mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/udoo: used shared board files
This commit is contained in:
parent
25589a1978
commit
69c824534c
@ -1,3 +1,4 @@
|
||||
MODULE = board
|
||||
DIRS = $(RIOTBOARD)/common/arduino-due
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
1
boards/udoo/Makefile.dep
Normal file
1
boards/udoo/Makefile.dep
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTBOARD)/common/arduino-due/Makefile.dep
|
@ -1,10 +1 @@
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m3_2
|
||||
|
||||
-include $(RIOTCPU)/sam3/Makefile.features
|
||||
include $(RIOTBOARD)/common/arduino-due/Makefile.features
|
||||
|
@ -1,14 +1 @@
|
||||
# define the cpu used by the udoo board
|
||||
export CPU = sam3
|
||||
export CPU_MODEL = sam3x8e
|
||||
|
||||
# define the default port depending on host OS
|
||||
PORT_LINUX ?= /dev/ttyACM0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup the flash tool (BOSSA)
|
||||
export BOSSA_ARDUINO_PREFLASH = yes
|
||||
include $(RIOTMAKE)/tools/bossa.inc.mk
|
||||
include $(RIOTBOARD)/common/arduino-due/Makefile.include
|
||||
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2016 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_udoo
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific implementations for the UDOO board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "cpu.h"
|
||||
#include "board.h"
|
||||
#include "periph/gpio.h"
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the on-board Amber "L" LED @ pin PB27 */
|
||||
gpio_init(LED0_PIN, GPIO_OUT);
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
}
|
13
boards/udoo/doc.txt
Normal file
13
boards/udoo/doc.txt
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup boards_udoo UDOO
|
||||
* @ingroup boards
|
||||
* @brief Support for the UDOO board
|
||||
*/
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup boards_udoo UDOO
|
||||
* @ingroup boards
|
||||
* @brief Support for the UDOO board.
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific definitions for the UDOO board.
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef BOARD_H
|
||||
#define BOARD_H
|
||||
|
||||
#include "cpu.h"
|
||||
#include "cpu_conf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name LED pin definitions and handlers
|
||||
* @{
|
||||
*/
|
||||
#define LED0_PIN GPIO_PIN(PB, 27)
|
||||
|
||||
#define LED_PORT PIOB
|
||||
#define LED0_MASK PIO_PB27
|
||||
|
||||
#define LED0_ON (LED_PORT->PIO_SODR = LED0_MASK)
|
||||
#define LED0_OFF (LED_PORT->PIO_CODR = LED0_MASK)
|
||||
#define LED0_TOGGLE ((PIOB->PIO_ODSR & LED0_MASK) ? LED0_OFF : LED0_ON)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
|
||||
*/
|
||||
void board_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BOARD_H */
|
||||
/** @} */
|
@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2015 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_udoo
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Peripheral MCU configuration for the UDOO board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_H
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Clock configuration
|
||||
* @{
|
||||
*/
|
||||
/* targeted system core clock */
|
||||
#define CLOCK_CORECLOCK (84000000UL)
|
||||
/* external oscillator clock */
|
||||
#define CLOCK_EXT_OSC (12000000UL)
|
||||
/* define PLL configuration
|
||||
*
|
||||
* The values must fulfill this equation:
|
||||
* CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1)
|
||||
*/
|
||||
#define CLOCK_PLL_MUL (83)
|
||||
#define CLOCK_PLL_DIV (12)
|
||||
|
||||
/* number of wait states before flash read and write operations */
|
||||
#define CLOCK_FWS (4) /* 4 is save for 84MHz */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Timer peripheral configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
/* dev, channel 0 ID */
|
||||
{ TC0, ID_TC0 },
|
||||
{ TC1, ID_TC3 },
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_tc0
|
||||
#define TIMER_1_ISR isr_tc3
|
||||
|
||||
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
static const uart_conf_t uart_config[] = {
|
||||
{
|
||||
.dev = (Uart *)UART,
|
||||
.rx_pin = GPIO_PIN(PA, 8),
|
||||
.tx_pin = GPIO_PIN(PA, 9),
|
||||
.mux = GPIO_MUX_A,
|
||||
.pmc_id = ID_UART,
|
||||
.irqn = UART_IRQn
|
||||
},
|
||||
{
|
||||
.dev = (Uart *)USART0,
|
||||
.rx_pin = GPIO_PIN(PA, 10),
|
||||
.tx_pin = GPIO_PIN(PA, 11),
|
||||
.mux = GPIO_MUX_A,
|
||||
.pmc_id = ID_USART0,
|
||||
.irqn = USART0_IRQn
|
||||
},
|
||||
{
|
||||
.dev = (Uart *)USART1,
|
||||
.rx_pin = GPIO_PIN(PA, 12),
|
||||
.tx_pin = GPIO_PIN(PA, 13),
|
||||
.mux = GPIO_MUX_A,
|
||||
.pmc_id = ID_USART1,
|
||||
.irqn = USART1_IRQn
|
||||
},
|
||||
{
|
||||
.dev = (Uart *)USART3,
|
||||
.rx_pin = GPIO_PIN(PD, 5),
|
||||
.tx_pin = GPIO_PIN(PD, 4),
|
||||
.mux = GPIO_MUX_B,
|
||||
.pmc_id = ID_USART3,
|
||||
.irqn = USART3_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
/* define interrupt vectors */
|
||||
#define UART_0_ISR isr_uart
|
||||
#define UART_1_ISR isr_usart0
|
||||
#define UART_2_ISR isr_usart1
|
||||
#define UART_3_ISR isr_usart3
|
||||
|
||||
#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name SPI configuration
|
||||
* @{
|
||||
*/
|
||||
static const spi_conf_t spi_config[] = {
|
||||
{
|
||||
.dev = SPI0,
|
||||
.id = ID_SPI0,
|
||||
.clk = GPIO_PIN(PA, 25),
|
||||
.mosi = GPIO_PIN(PA, 26),
|
||||
.miso = GPIO_PIN(PA, 27),
|
||||
.mux = GPIO_MUX_A
|
||||
}
|
||||
};
|
||||
|
||||
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PERIPH_CONF_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user