From 07e1e8b40bacc6423dc26a5781b29a32f6568752 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 17 May 2015 15:34:51 -0600 Subject: [PATCH] SAMD/L: Move content of chip/sam_memorymap.h to chip.h; move chip/sam_pinmap. to sam_pinmap.h for consistency with other header files --- arch/arm/src/samdl/chip.h | 8 ++- arch/arm/src/samdl/chip/sam_memorymap.h | 54 ------------------- arch/arm/src/samdl/{chip => }/sam_pinmap.h | 13 +++-- arch/arm/src/samdl/sam_spi.c | 2 +- arch/arm/src/samdl/sam_usart.c | 3 +- configs/samd20-xplained/src/samd20-xplained.h | 2 +- 6 files changed, 16 insertions(+), 66 deletions(-) delete mode 100644 arch/arm/src/samdl/chip/sam_memorymap.h rename arch/arm/src/samdl/{chip => }/sam_pinmap.h (89%) diff --git a/arch/arm/src/samdl/chip.h b/arch/arm/src/samdl/chip.h index 697cc957bb..db94326c8f 100644 --- a/arch/arm/src/samdl/chip.h +++ b/arch/arm/src/samdl/chip.h @@ -54,7 +54,13 @@ * this file for the proper setup. */ -#include "chip/sam_memorymap.h" +#if defined(CONFIG_ARCH_FAMILY_SAMD20) +# include "chip/samd20_memorymap.h" +#elif defined(CONFIG_ARCH_FAMILY_SAML21) +# include "chip/saml21_memorymap.h" +#else +# error Unrecognized SAMD/L architecture +#endif /************************************************************************************ * Pre-processor Definitions diff --git a/arch/arm/src/samdl/chip/sam_memorymap.h b/arch/arm/src/samdl/chip/sam_memorymap.h deleted file mode 100644 index 155e139d47..0000000000 --- a/arch/arm/src/samdl/chip/sam_memorymap.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************************ - * arch/arm/src/samdl/chip/sam_memorymap.h - * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS 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. - * - ************************************************************************************/ - -#ifndef __ARCH_ARM_SRC_SAMDL_CHIP_SAM_MEMORYMAP_H -#define __ARCH_ARM_SRC_SAMDL_CHIP_SAM_MEMORYMAP_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#include - -#if defined(SAMD20) -# include "chip/samd20_memorymap.h" -#elif defined(SAML21) -# include "chip/saml21_memorymap.h" -#else -# error Unrecognized SAMD/L architecture -#endif - -#endif /* __ARCH_ARM_SRC_SAMDL_CHIP_SAM_MEMORYMAP_H */ diff --git a/arch/arm/src/samdl/chip/sam_pinmap.h b/arch/arm/src/samdl/sam_pinmap.h similarity index 89% rename from arch/arm/src/samdl/chip/sam_pinmap.h rename to arch/arm/src/samdl/sam_pinmap.h index 3383b606b1..d272b67136 100644 --- a/arch/arm/src/samdl/chip/sam_pinmap.h +++ b/arch/arm/src/samdl/sam_pinmap.h @@ -1,5 +1,5 @@ /************************************************************************************ - * arch/arm/src/samdl/chip/sam_pinmap.h + * arch/arm/src/samdl/sam_pinmap.h * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,22 +33,21 @@ * ************************************************************************************/ -#ifndef __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PINMAP_H -#define __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PINMAP_H +#ifndef __ARCH_ARM_SRC_SAMDL_SAM_PINMAP_H +#define __ARCH_ARM_SRC_SAMDL_SAM_PINMAP_H /************************************************************************************ * Included Files ************************************************************************************/ #include -#include -#if defined(SAMD20) +#if defined(CONFIG_ARCH_FAMILY_SAMD20) # include "chip/samd20_pinmap.h" -#elif defined(SAML21) +#elif defined(CONFIG_ARCH_FAMILY_SAML21) # include "chip/saml21_pinmap.h" #else # error Unrecognized SAMD/L architecture #endif -#endif /* __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PINMAP_H */ +#endif /* __ARCH_ARM_SRC_SAMDL_SAM_PINMAP_H */ diff --git a/arch/arm/src/samdl/sam_spi.c b/arch/arm/src/samdl/sam_spi.c index d45c41e72b..d66d9864b1 100644 --- a/arch/arm/src/samdl/sam_spi.c +++ b/arch/arm/src/samdl/sam_spi.c @@ -63,10 +63,10 @@ #include "chip.h" #include "chip/sam_port.h" -#include "chip/sam_pinmap.h" #include +#include "sam_pinmap.h" #include "sam_gclk.h" #include "sam_port.h" #include "sam_sercom.h" diff --git a/arch/arm/src/samdl/sam_usart.c b/arch/arm/src/samdl/sam_usart.c index e495429588..a9957c939a 100644 --- a/arch/arm/src/samdl/sam_usart.c +++ b/arch/arm/src/samdl/sam_usart.c @@ -42,8 +42,7 @@ #include #include -#include "chip/sam_pinmap.h" - +#include "sam_pinmap.h" #include "sam_gclk.h" #include "sam_usart.h" diff --git a/configs/samd20-xplained/src/samd20-xplained.h b/configs/samd20-xplained/src/samd20-xplained.h index 74f9445291..8c1f49353a 100644 --- a/configs/samd20-xplained/src/samd20-xplained.h +++ b/configs/samd20-xplained/src/samd20-xplained.h @@ -49,7 +49,7 @@ #include #include "sam_config.h" -#include "chip/sam_pinmap.h" +#include "sam_pinmap.h" /************************************************************************************ * Pre-processor Definitions