From 3d89476aa21a988878fa15fdad754a13343be7c3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 17 May 2015 09:18:36 -0600 Subject: [PATCH] SAML21: Rename chip/sam_pm.h to chip/samd_pm.h --- .../src/samdl/chip/{sam_pm.h => samd_pm.h} | 13 +-- arch/arm/src/samdl/sam_gclk.h | 85 +++++++++++++++++++ arch/arm/src/samdl/sam_lowputc.c | 8 +- arch/arm/src/samdl/sam_pm.h | 85 +++++++++++++++++++ arch/arm/src/samdl/sam_sercom.c | 4 +- arch/arm/src/samdl/sam_sercom.h | 4 +- arch/arm/src/samdl/samd_clockconfig.c | 2 +- 7 files changed, 187 insertions(+), 14 deletions(-) rename arch/arm/src/samdl/chip/{sam_pm.h => samd_pm.h} (97%) create mode 100644 arch/arm/src/samdl/sam_gclk.h create mode 100644 arch/arm/src/samdl/sam_pm.h diff --git a/arch/arm/src/samdl/chip/sam_pm.h b/arch/arm/src/samdl/chip/samd_pm.h similarity index 97% rename from arch/arm/src/samdl/chip/sam_pm.h rename to arch/arm/src/samdl/chip/samd_pm.h index dbe0ad02b5..36c82fe0c1 100644 --- a/arch/arm/src/samdl/chip/sam_pm.h +++ b/arch/arm/src/samdl/chip/samd_pm.h @@ -1,7 +1,7 @@ /******************************************************************************************** - * arch/arm/src/samdl/chip/sam_pm.h + * arch/arm/src/samdl/chip/samd_pm.h * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -37,8 +37,8 @@ * ********************************************************************************************/ -#ifndef __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PM_H -#define __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PM_H +#ifndef __ARCH_ARM_SRC_SAMDL_CHIP_SAMD_PM_H +#define __ARCH_ARM_SRC_SAMDL_CHIP_SAMD_PM_H /******************************************************************************************** * Included Files @@ -48,6 +48,8 @@ #include "chip.h" +#ifdef CONFIG_ARCH_FAMILY_SAMD20 + /******************************************************************************************** * Pre-processor Definitions ********************************************************************************************/ @@ -227,4 +229,5 @@ * Public Functions ********************************************************************************************/ -#endif /* __ARCH_ARM_SRC_SAMDL_CHIP_SAM_PM_H */ +#endif /* CONFIG_ARCH_FAMILY_SAMD20 */ +#endif /* __ARCH_ARM_SRC_SAMDL_CHIP_SAMD_PM_H */ diff --git a/arch/arm/src/samdl/sam_gclk.h b/arch/arm/src/samdl/sam_gclk.h new file mode 100644 index 0000000000..95bbc19f02 --- /dev/null +++ b/arch/arm/src/samdl/sam_gclk.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * arch/arm/src/samdl/sam_gclk.h + * + * Copyright (C) 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_SAM_GCLK_H +#define __ARCH_ARM_SRC_SAMDL_SAM_GCLK_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "sam_config.h" + +#if defined(CONFIG_ARCH_FAMILY_SAMD20) +# include "chip/samd_gclk.h" +#elif defined(CONFIG_ARCH_FAMILY_SAML21) +# include "chip/saml_gclk.h" +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_SAMDL_SAM_GCLK_H */ diff --git a/arch/arm/src/samdl/sam_lowputc.c b/arch/arm/src/samdl/sam_lowputc.c index ada594fc4f..4794c23fa1 100644 --- a/arch/arm/src/samdl/sam_lowputc.c +++ b/arch/arm/src/samdl/sam_lowputc.c @@ -56,15 +56,15 @@ #include "sam_config.h" -#include - -#include "chip/sam_pm.h" #include "chip/sam_usart.h" -#include "sam_usart.h" #include "sam_gclk.h" +#include "sam_pm.h" +#include "sam_usart.h" #include "sam_lowputc.h" +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/arch/arm/src/samdl/sam_pm.h b/arch/arm/src/samdl/sam_pm.h new file mode 100644 index 0000000000..e86186bdd4 --- /dev/null +++ b/arch/arm/src/samdl/sam_pm.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * arch/arm/src/samdl/sam_pm.h + * + * Copyright (C) 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_SAM_PM_H +#define __ARCH_ARM_SRC_SAMDL_SAM_PM_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "sam_config.h" + +#if defined(CONFIG_ARCH_FAMILY_SAMD20) +# include "chip/samd_pm.h" +#elif defined(CONFIG_ARCH_FAMILY_SAML21) +# include "chip/saml_pm.h" +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_SAMDL_SAM_PM_H */ diff --git a/arch/arm/src/samdl/sam_sercom.c b/arch/arm/src/samdl/sam_sercom.c index ca3f6b7f09..a4e22d2cee 100644 --- a/arch/arm/src/samdl/sam_sercom.c +++ b/arch/arm/src/samdl/sam_sercom.c @@ -50,9 +50,7 @@ #include "sam_config.h" -#include "chip/sam_pm.h" -#include "chip/sam_sercom.h" - +#include "sam_pm.h" #include "sam_gclk.h" #include "sam_sercom.h" diff --git a/arch/arm/src/samdl/sam_sercom.h b/arch/arm/src/samdl/sam_sercom.h index 9511dfb359..de5f149fdd 100644 --- a/arch/arm/src/samdl/sam_sercom.h +++ b/arch/arm/src/samdl/sam_sercom.h @@ -44,9 +44,11 @@ #include +#include "chip/sam_sercom.h" + #include "up_arch.h" #include "sam_config.h" -#include "chip/sam_pm.h" +#include "sam_pm.h" /**************************************************************************** * Pre-processor Definitions diff --git a/arch/arm/src/samdl/samd_clockconfig.c b/arch/arm/src/samdl/samd_clockconfig.c index 6ac485d49f..85e815c96a 100644 --- a/arch/arm/src/samdl/samd_clockconfig.c +++ b/arch/arm/src/samdl/samd_clockconfig.c @@ -54,7 +54,7 @@ #include "up_arch.h" -#include "chip/sam_pm.h" +#include "chip/samd_pm.h" #include "chip/samd_sysctrl.h" #include "chip/samd_gclk.h" #include "chip/sam_nvmctrl.h"