mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu, sam_common: add basic common files
This commit is contained in:
parent
f1087d4e44
commit
9737225d88
1
cpu/sam_common/Makefile
Normal file
1
cpu/sam_common/Makefile
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
11
cpu/sam_common/Makefile.include
Normal file
11
cpu/sam_common/Makefile.include
Normal file
@ -0,0 +1,11 @@
|
||||
# Define the CPU family so we can differentiate between them in the code
|
||||
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)/sam_common/ldscripts
|
||||
|
||||
# export the common include directory
|
||||
export INCLUDES += -I$(RIOTCPU)/sam_common/include
|
8
cpu/sam_common/doc.txt
Normal file
8
cpu/sam_common/doc.txt
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @defgroup cpu_sam_common Atmel SAM common
|
||||
* @ingroup cpu
|
||||
* @brief Atmel SAM common
|
||||
*
|
||||
* This module contains all common code and definition to all Atmel SAM cpu
|
||||
* families supported by RIOT: @ref cpu_sam3, and cpu_sam4s.
|
||||
*/
|
44
cpu/sam_common/include/cpu_conf.h
Normal file
44
cpu/sam_common/include/cpu_conf.h
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2017 HAW Hamburg
|
||||
*
|
||||
* 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 cpu_sam_common
|
||||
* @brief Implementation specific CPU configuration options
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Implementation specific CPU configuration options
|
||||
*
|
||||
* @author Sebastian Meiling <s@mlng.net>
|
||||
*/
|
||||
|
||||
#ifndef CPU_CONF_H
|
||||
#define CPU_CONF_H
|
||||
|
||||
#include "cpu_conf_common.h"
|
||||
#include "vendor/sam.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 IFLASH0_ADDR
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CPU_CONF_H */
|
||||
/** @} */
|
42
cpu/sam_common/include/vendor/README.md
vendored
Normal file
42
cpu/sam_common/include/vendor/README.md
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# CMSIS from Atmel Software Foundation (ASF)
|
||||
|
||||
The include files in the directory tree are copied from ASF (verion 3.35.1).
|
||||
|
||||
The directory tree was copied "as is" from ASF path `sam/utils/cmsis/` and its
|
||||
structure is as follows:
|
||||
|
||||
cmsis
|
||||
├── sam3x
|
||||
│ ├── include
|
||||
│ │ ├── component
|
||||
│ │ ├── instance
|
||||
│ │ └── pio
|
||||
│ └── source
|
||||
│ ├── gcc
|
||||
│ └── iar
|
||||
.
|
||||
.
|
||||
.
|
||||
├── sam4s
|
||||
│ ├── include
|
||||
│ │ ├── component
|
||||
│ │ ├── instance
|
||||
│ │ └── pio
|
||||
. └── source
|
||||
. ├── gcc
|
||||
. └── iar
|
||||
|
||||
However, as only the header files in `include` and its subfolders are required,
|
||||
all `source` folders are removed.
|
||||
|
||||
Be aware that if you want to make changes to any file in this tree that the
|
||||
changes will be lost when a new ASF release is going to be used.
|
||||
|
||||
# Usage and porting for SAM based CPUs
|
||||
|
||||
SAM based CPU should include `sam.h` in this directory, which will resolve any
|
||||
CPU family specific includes required.
|
||||
|
||||
Currently only SAM3X and SAM4S based CPUs are supported, i.e., only their CMSIS
|
||||
header files are copied from the ASF. If other CPUs are needed copy CMSIS files
|
||||
from the ASF for the respective CPU family here and adapt `sam.h` accordingly.
|
90
cpu/sam_common/include/vendor/sam.h
vendored
Normal file
90
cpu/sam_common/include/vendor/sam.h
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (C) 2017 HAW Hamburg
|
||||
*
|
||||
* 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 cpu_sam_common
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Wrapper include file for specific SAM vendor headers
|
||||
*
|
||||
* @author Sebastian Meiling <s@mlng.net>
|
||||
*/
|
||||
|
||||
#ifndef SAM_H
|
||||
#define SAM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(CPU_FAM_SAM3) && !defined(PERIPH_COUNT_IRQn)
|
||||
/**
|
||||
* @brief Number of periphical IRQs for SAM3 CPUs
|
||||
*/
|
||||
#define PERIPH_COUNT_IRQn (45U)
|
||||
#endif
|
||||
|
||||
#if defined(CPU_MODEL_SAM3A4C)
|
||||
#include "vendor/sam3x/include/sam3a4c.h"
|
||||
#elif defined(CPU_MODEL_SAM3A8C)
|
||||
#include "vendor/sam3x/include/sam3a8c.h"
|
||||
#elif defined(CPU_MODEL_SAM3X4C)
|
||||
#include "vendor/sam3x/include/sam3x4c.h"
|
||||
#elif defined(CPU_MODEL_SAM3X4E)
|
||||
#include "vendor/sam3x/include/sam3x4e.h"
|
||||
#elif defined(CPU_MODEL_SAM3X8C)
|
||||
#include "vendor/sam3x/include/sam3x8c.h"
|
||||
#elif defined(CPU_MODEL_SAM3X8E)
|
||||
#include "vendor/sam3x/include/sam3x8e.h"
|
||||
#elif defined(CPU_MODEL_SAM3X8H)
|
||||
#include "vendor/sam3x/include/sam3x8h.h"
|
||||
|
||||
#elif defined(CPU_MODEL_SAM4S2A)
|
||||
#include "vendor/sam4s/include/sam4s2a.h"
|
||||
#elif defined(CPU_MODEL_SAM4S2B)
|
||||
#include "vendor/sam4s/include/sam4s2b.h"
|
||||
#elif defined(CPU_MODEL_SAM4S2C)
|
||||
#include "vendor/sam4s/include/sam4s2c.h"
|
||||
#elif defined(CPU_MODEL_SAM4S4A)
|
||||
#include "vendor/sam4s/include/sam4s4a.h"
|
||||
#elif defined(CPU_MODEL_SAM4S4B)
|
||||
#include "vendor/sam4s/include/sam4s4b.h"
|
||||
#elif defined(CPU_MODEL_SAM4S4C)
|
||||
#include "vendor/sam4s/include/sam4s4c.h"
|
||||
#elif defined(CPU_MODEL_SAM4S8B)
|
||||
#include "vendor/sam4s/include/sam4s8b.h"
|
||||
#elif defined(CPU_MODEL_SAM4S8C)
|
||||
#include "vendor/sam4s/include/sam4s8c.h"
|
||||
#elif defined(CPU_MODEL_SAM4S16B)
|
||||
#include "vendor/sam4s/include/sam4s16b.h"
|
||||
#elif defined(CPU_MODEL_SAM4S16C)
|
||||
#include "vendor/sam4s/include/sam4s16c.h"
|
||||
#elif defined(CPU_MODEL_SAM4SA16B)
|
||||
#include "vendor/sam4s/include/sam4sa16b.h"
|
||||
#elif defined(CPU_MODEL_SAM4SA16C)
|
||||
#include "vendor/sam4s/include/sam4sa16c.h"
|
||||
#elif defined(CPU_MODEL_SAM4SD16B)
|
||||
#include "vendor/sam4s/include/sam4sd16b.h"
|
||||
#elif defined(CPU_MODEL_SAM4SD16C)
|
||||
#include "vendor/sam4s/include/sam4sd16c.h"
|
||||
#elif defined(CPU_MODEL_SAM4SD32B)
|
||||
#include "vendor/sam4s/include/sam4sd32b.h"
|
||||
#elif defined(CPU_MODEL_SAM4SD32C)
|
||||
#include "vendor/sam4s/include/sam4sd32c.h"
|
||||
|
||||
#else
|
||||
#error "Unsupported Atmel SAM variant."
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SAM0_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user