1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

cpu/sam21: unified structure for sam[drl]21 CPUs

This commit is contained in:
Hauke Petersen 2016-12-15 11:39:19 +01:00
parent 0bab8c0d61
commit bfb52afde9
100 changed files with 124 additions and 136 deletions

View File

@ -1,7 +1,6 @@
# define the cpu used by Arduino/Genuino Zero board
export CPU = samd21
export CPU_MODEL = samd21g18a
export CFLAGS += -D__SAMD21G18A__
# set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0

View File

@ -1,7 +1,6 @@
# define the cpu used by SAMR21 Xplained Pro board
export CPU = samd21
export CPU_MODEL = samr21x18a
CFLAGS += -D__SAMR21G18A__
export CPU_MODEL = samr21g18a
# set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0

View File

@ -1,7 +1,6 @@
# define the cpu used by SODAQ Autonomo board
export CPU = samd21
export CPU_MODEL = samd21j18a
CFLAGS += -D__SAMD21J18A__
# set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0

View File

@ -4,6 +4,9 @@ CFLAGS += -DCPU_FAM_$(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
# this CPU implementation doesn't use CMSIS initialization
export CFLAGS += -DDONT_USE_CMSIS_INIT
# for the sam[drl] CPUs we hold all linkerscripts in the sam0 common folder
export LINKFLAGS += -L$(RIOTCPU)/sam21_common/ldscripts
# use common periph functions
USEMODULE += periph_common

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
* 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
@ -7,19 +7,20 @@
*/
/**
* @ingroup cpu_sam21_common
* @{
*
* @file
* @brief Implementation specific CPU configuration options
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef CPU_CONF_H
#define CPU_CONF_H
#include "cpu_conf_common.h"
#include "sam0.h"
#ifdef __cplusplus

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 Kees Bakker
* 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
@ -11,9 +12,11 @@
* @{
*
* @file
* @brief Wrapper include file for samd21.h, samr21.h, etc
* @brief Wrapper include file for including the specific SAM0 vendor
* header
*
* @author Kees Bakker <kees@sodaq.com>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef SAM0_H
@ -23,14 +26,91 @@
extern "C" {
#endif
#if defined(__SAMR21G18A__) || defined(__ATSAMR21G18A__)
#include "cmsis/samr21/include/samr21g18a.h"
#elif defined(__SAMR21E18A__) || defined(__ATSAMR21E18A__)
#include "cmsis/samr21/include/samr21e18a.h"
#elif defined(__SAMD21J18A__) || defined(__ATSAMD21J18A__)
#include "cmsis/samd21/include/samd21j18a.h"
#elif defined(__SAMD21G18A__) || defined(__ATSAMD21G18A__)
#include "cmsis/samd21/include/samd21g18a.h"
#if defined(CPU_MODEL_SAML21E15A)
#include "cmsis/saml21/include/saml21e15a.h"
#elif defined(CPU_MODEL_SAML21E16A)
#include "cmsis/saml21/include/saml21e16a.h"
#elif defined(CPU_MODEL_SAML21E17A)
#include "cmsis/saml21/include/saml21e17a.h"
#elif defined(CPU_MODEL_SAML21G16A)
#include "cmsis/saml21/include/saml21g16a.h"
#elif defined(CPU_MODEL_SAML21G17A)
#include "cmsis/saml21/include/saml21g17a.h"
#elif defined(CPU_MODEL_SAML21G18A)
#include "cmsis/saml21/include/saml21g18a.h"
#elif defined(CPU_MODEL_SAML21J16A)
#include "cmsis/saml21/include/saml21j16a.h"
#elif defined(CPU_MODEL_SAML21J17A)
#include "cmsis/saml21/include/saml21j17a.h"
#elif defined(CPU_MODEL_SAML21J18A)
#include "cmsis/saml21/include/saml21j18a.h"
#elif defined(CPU_MODEL_SAMR21E16A)
#include "cmsis/samr21/include/samr21e16a.h"
#elif defined(CPU_MODEL_SAMR21E17A)
#include "cmsis/samr21/include/samr21e17a.h"
#elif defined(CPU_MODEL_SAMR21E18A)
#include "cmsis/samr21/include/samr21e18a.h"
#elif defined(CPU_MODEL_SAMR21G16A)
#include "cmsis/samr21/include/samr21g16a.h"
#elif defined(CPU_MODEL_SAMR21G17A)
#include "cmsis/samr21/include/samr21g17a.h"
#elif defined(CPU_MODEL_SAMR21G18A)
#include "cmsis/samr21/include/samr21g18a.h"
#elif defined(CPU_MODEL_SAMD21E15A)
#include "cmsis/samd21/include/samd21e15a.h"
#elif defined(CPU_MODEL_SAMD21E16A)
#include "cmsis/samd21/include/samd21e16a.h"
#elif defined(CPU_MODEL_SAMD21E17A)
#include "cmsis/samd21/include/samd21e17a.h"
#elif defined(CPU_MODEL_SAMD21E18A)
#include "cmsis/samd21/include/samd21e18a.h"
#elif defined(CPU_MODEL_SAMD21G15A)
#include "cmsis/samd21/include/samd21g15a.h"
#elif defined(CPU_MODEL_SAMD21G16A)
#include "cmsis/samd21/include/samd21g16a.h"
#elif defined(CPU_MODEL_SAMD21G17A)
#include "cmsis/samd21/include/samd21g17a.h"
#elif defined(CPU_MODEL_SAMD21G17AU)
#include "cmsis/samd21/include/samd21g17au.h"
#elif defined(CPU_MODEL_SAMD21G18A)
#include "cmsis/samd21/include/samd21g18a.h"
#elif defined(CPU_MODEL_SAMD21G18AU)
#include "cmsis/samd21/include/samd21g18au.h"
#elif defined(CPU_MODEL_SAMD21J15A)
#include "cmsis/samd21/include/samd21j15a.h"
#elif defined(CPU_MODEL_SAMD21J16A)
#include "cmsis/samd21/include/samd21j16a.h"
#elif defined(CPU_MODEL_SAMD21J17A)
#include "cmsis/samd21/include/samd21j17a.h"
#elif defined(CPU_MODEL_SAMD21J18A)
#include "cmsis/samd21/include/samd21j18a.h"
#elif defined(CPU_MODEL_SAMD21E15B)
#include "cmsis/samd21/include/samd21e15b.h"
#elif defined(CPU_MODEL_SAMD21E15BU)
#include "cmsis/samd21/include/samd21e15bu.h"
#elif defined(CPU_MODEL_SAMD21E15L)
#include "cmsis/samd21/include/samd21e15l.h"
#elif defined(CPU_MODEL_SAMD21E16B)
#include "cmsis/samd21/include/samd21e16b.h"
#elif defined(CPU_MODEL_SAMD21E16BU)
#include "cmsis/samd21/include/samd21e16bu.h"
#elif defined(CPU_MODEL_SAMD21E16L)
#include "cmsis/samd21/include/samd21e16l.h"
#elif defined(CPU_MODEL_SAMD21G15B)
#include "cmsis/samd21/include/samd21g15b.h"
#elif defined(CPU_MODEL_SAMD21G15L)
#include "cmsis/samd21/include/samd21g15l.h"
#elif defined(CPU_MODEL_SAMD21G16B)
#include "cmsis/samd21/include/samd21g16b.h"
#elif defined(CPU_MODEL_SAMD21G16L)
#include "cmsis/samd21/include/samd21g16l.h"
#elif defined(CPU_MODEL_SAMD21J15B)
#include "cmsis/samd21/include/samd21j15b.h"
#elif defined(CPU_MODEL_SAMD21J16B)
#include "cmsis/samd21/include/samd21j16b.h"
#else
#error "Unsupported SAM0 variant."
#endif

View File

@ -11,7 +11,7 @@
* @{
*
* @file
* @brief Memory definitions for the SAMR21E18A and SAMR21G18A
* @brief Memory definitions for the SAMR21E18A
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*

View File

@ -0,0 +1,27 @@
/*
* Copyright (C) 2015, 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.
*/
/**
* @addtogroup cpu_samd21
* @{
*
* @file
* @brief Memory definitions for the SAMR21G18A
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
}
INCLUDE cortexm_base.ld

View File

@ -1,77 +0,0 @@
/**
* \file
*
* \brief Top header file for SAML21
*
* Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SAML21_
#define _SAML21_
/**
* \defgroup SAML21_definitions SAML21 Device Definitions
* \brief SAML21 CMSIS Definitions.
*/
#if defined(__SAML21E15A__) || defined(__ATSAML21E15A__)
#include "saml21e15a.h"
#elif defined(__SAML21E16A__) || defined(__ATSAML21E16A__)
#include "saml21e16a.h"
#elif defined(__SAML21E17A__) || defined(__ATSAML21E17A__)
#include "saml21e17a.h"
#elif defined(__SAML21G16A__) || defined(__ATSAML21G16A__)
#include "saml21g16a.h"
#elif defined(__SAML21G17A__) || defined(__ATSAML21G17A__)
#include "saml21g17a.h"
#elif defined(__SAML21G18A__) || defined(__ATSAML21G18A__)
#include "saml21g18a.h"
#elif defined(__SAML21J16A__) || defined(__ATSAML21J16A__)
#include "saml21j16a.h"
#elif defined(__SAML21J17A__) || defined(__ATSAML21J17A__)
#include "saml21j17a.h"
#elif defined(__SAML21J18A__) || defined(__ATSAML21J18A__)
#include "saml21j18a.h"
#else
#error Library does not support the specified device.
#endif
#endif /* _SAML21_ */

View File

@ -1,43 +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.
*/
/**
* @{
*
* @file
* @brief Implementation specific CPU configuration options
*
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
*/
#ifndef CPU_CONF_H
#define CPU_CONF_H
#include "cpu_conf_common.h"
#include "atmel/saml21.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief ARM Cortex-M specific CPU configuration
* @{
*/
#define CPU_DEFAULT_IRQ_PRIO (1U)
#define CPU_IRQ_NUMOF PERIPH_COUNT_IRQn
#define CPU_FLASH_BASE FLASH_ADDR
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* CPU_CONF_H */
/** @} */