You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/03/04 01:40:16 UTC

[36/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
deleted file mode 100755
index cf1c436..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * \file
- *
- * \brief SAM SERCOM I2C Slave Interrupt Driver
- *
- * Copyright (C) 2013-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 I2C_SLAVE_INTERRUPT_H_INCLUDED
-#define I2C_SLAVE_INTERRUPT_H_INCLUDED
-
-#include "i2c_slave.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \addtogroup asfdoc_sam0_sercom_i2c_group
- * @{
- *
- */
-
-/**
- * \name Address Match Functionality
- * @{
- */
-
-void i2c_slave_enable_nack_on_address(
-		struct i2c_slave_module *const module);
-void i2c_slave_disable_nack_on_address(
-		struct i2c_slave_module *const module);
-
-/** @} */
-
-/**
- * \name Callbacks
- * @{
- */
-#if !defined(__DOXYGEN__)
-void _i2c_slave_interrupt_handler(uint8_t instance);
-#endif
-
-void i2c_slave_register_callback(
-		struct i2c_slave_module *const module,
-		i2c_slave_callback_t callback,
-		enum i2c_slave_callback callback_type);
-
-void i2c_slave_unregister_callback(
-		struct i2c_slave_module *const module,
-		enum i2c_slave_callback callback_type);
-
-/**
- * \brief Enables callback
- *
- * Enables the callback specified by the callback_type.
- *
- * \param[in,out]  module         Pointer to the software module struct
- * \param[in]      callback_type  Callback type to enable
- */
-static inline void i2c_slave_enable_callback(
-		struct i2c_slave_module *const module,
-		enum i2c_slave_callback callback_type)
-{
-	/* Sanity check */
-	Assert(module);
-	Assert(module->hw);
-
-	/* Mark callback as enabled */
-	module->enabled_callback |= (1 << callback_type);
-
-	/* Enable address callback */
-	SercomI2cs *const i2c_hw = &(module->hw->I2CS);
-	if (callback_type == I2C_SLAVE_CALLBACK_READ_REQUEST ||
-			callback_type == I2C_SLAVE_CALLBACK_WRITE_REQUEST) {
-		i2c_hw->INTENSET.reg = SERCOM_I2CS_INTFLAG_AMATCH;
-	}
-}
-
-/**
- * \brief Disables callback
- *
- * Disables the callback specified by the callback_type.
- *
- * \param[in,out]  module         Pointer to the software module struct
- * \param[in]      callback_type  Callback type to disable
- */
-static inline void i2c_slave_disable_callback(
-		struct i2c_slave_module *const module,
-		enum i2c_slave_callback callback_type)
-{
-	/* Sanity check */
-	Assert(module);
-	Assert(module->hw);
-
-	/* Mark callback as disabled */
-	module->enabled_callback &= ~(1 << callback_type);
-	SercomI2cs *const i2c_hw = &(module->hw->I2CS);
-	if (callback_type == I2C_SLAVE_CALLBACK_READ_REQUEST ||
-			callback_type == I2C_SLAVE_CALLBACK_WRITE_REQUEST ||
-			module->status != STATUS_BUSY) {
-		i2c_hw->INTENCLR.reg = SERCOM_I2CS_INTFLAG_AMATCH;
-	}
-}
-
-/** @} */
-
-/**
- * \name Read and Write, Interrupt-Driven
- * @{
- */
-
-
-enum status_code i2c_slave_read_packet_job(
-		struct i2c_slave_module *const module,
-		struct i2c_slave_packet *const packet);
-
-enum status_code i2c_slave_write_packet_job(
-		struct i2c_slave_module *const module,
-		struct i2c_slave_packet *const packet);
-
-/**
- * \brief Cancels any currently ongoing operation
- *
- * Terminates the running transfer operation.
- *
- * \param[in,out] module  Pointer to software module structure
- */
-static inline void i2c_slave_cancel_job(
-		struct i2c_slave_module *const module)
-{
-	/* Sanity check. */
-	Assert(module);
-	Assert(module->hw);
-
-	/* Set buffer to 0. */
-	module->buffer_remaining = 0;
-	module->buffer_length = 0;
-}
-
-/**
- * \brief Gets status of ongoing job
- *
- * Will return the status of the ongoing job, or the error that occurred
- * in the last transfer operation.
- * The status will be cleared when starting a new job.
- *
- * \param[in,out] module Pointer to software module structure
- *
- * \return                      Status of job.
- * \retval STATUS_OK            No error has occurred
- * \retval STATUS_BUSY          Transfer is in progress
- * \retval STATUS_ERR_IO        A collision, timeout or bus error happened in
- *                              the last transfer
- * \retval STATUS_ERR_TIMEOUT   A timeout occurred
- * \retval STATUS_ERR_OVERFLOW  Data from master overflows receive buffer
- */
-static inline enum status_code i2c_slave_get_job_status(
-		struct i2c_slave_module *const module)
-{
-	/* Check sanity. */
-	Assert(module);
-	Assert(module->hw);
-
-	/* Return current status code. */
-	return module->status;
-}
-
-/** @} */
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* I2C_SLAVE_INTERRUPT_H_INCLUDED */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.c
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.c b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.c
deleted file mode 100755
index 637f394..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-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>
- */
-#include "sercom.h"
-
-#define SHIFT 32
-#define BAUD_INT_MAX   8192
-#define BAUD_FP_MAX     8
-
-#if !defined(__DOXYGEN__)
-/**
- * \internal Configuration structure to save current gclk status.
- */
-struct _sercom_conf {
-	/* Status of gclk generator initialization */
-	bool generator_is_set;
-	/* Sercom gclk generator used */
-	enum gclk_generator generator_source;
-};
-
-static struct _sercom_conf _sercom_config;
-
-
-/**
- * \internal Calculate 64 bit division, ref can be found in
- * http://en.wikipedia.org/wiki/Division_algorithm#Long_division
- */
-static uint64_t long_division(uint64_t n, uint64_t d)
-{
-	int32_t i;
-	uint64_t q = 0, r = 0, bit_shift;
-	for (i = 63; i >= 0; i--) {
-		bit_shift = (uint64_t)1 << i;
-
-		r = r << 1;
-
-		if (n & bit_shift) {
-			r |= 0x01;
-		}
-
-		if (r >= d) {
-			r = r - d;
-			q |= bit_shift;
-		}
-	}
-
-	return q;
-}
-
-/**
- * \internal Calculate synchronous baudrate value (SPI/UART)
- */
-enum status_code _sercom_get_sync_baud_val(
-		const uint32_t baudrate,
-		const uint32_t external_clock,
-		uint16_t *const baudvalue)
-{
-	/* Baud value variable */
-	uint16_t baud_calculated = 0;
-	uint32_t clock_value = external_clock;
-
-
-	/* Check if baudrate is outside of valid range */
-	if (baudrate > (external_clock / 2)) {
-		/* Return with error code */
-		return STATUS_ERR_BAUDRATE_UNAVAILABLE;
-	}
-
-	/* Calculate BAUD value from clock frequency and baudrate */
-	clock_value = external_clock / 2;
-	while (clock_value >= baudrate) {
-		clock_value = clock_value - baudrate;
-		baud_calculated++;
-	}
-	baud_calculated = baud_calculated - 1;
-
-	/* Check if BAUD value is more than 255, which is maximum
-	 * for synchronous mode */
-	if (baud_calculated > 0xFF) {
-		/* Return with an error code */
-		return STATUS_ERR_BAUDRATE_UNAVAILABLE;
-	} else {
-		*baudvalue = baud_calculated;
-		return STATUS_OK;
-	}
-}
-
-/**
- * \internal Calculate asynchronous baudrate value (UART)
-*/
-enum status_code _sercom_get_async_baud_val(
-		const uint32_t baudrate,
-		const uint32_t peripheral_clock,
-		uint16_t *const baudval,
-		enum sercom_asynchronous_operation_mode mode,
-		enum sercom_asynchronous_sample_num sample_num)
-{
-	/* Temporary variables  */
-	uint64_t ratio = 0;
-	uint64_t scale = 0;
-	uint64_t baud_calculated = 0;
-	uint8_t baud_fp;
-	uint32_t baud_int = 0;
-	uint64_t temp1, temp2;
-
-	/* Check if the baudrate is outside of valid range */
-	if ((baudrate * sample_num) > peripheral_clock) {
-		/* Return with error code */
-		return STATUS_ERR_BAUDRATE_UNAVAILABLE;
-	}
-
-	if(mode == SERCOM_ASYNC_OPERATION_MODE_ARITHMETIC) {
-		/* Calculate the BAUD value */
-		temp1 = ((sample_num * (uint64_t)baudrate) << SHIFT);
-		ratio = long_division(temp1, peripheral_clock);
-		scale = ((uint64_t)1 << SHIFT) - ratio;
-		baud_calculated = (65536 * scale) >> SHIFT;
-	} else if(mode == SERCOM_ASYNC_OPERATION_MODE_FRACTIONAL) {
-		for(baud_fp = 0; baud_fp < BAUD_FP_MAX; baud_fp++) {
-			temp1 = BAUD_FP_MAX * (uint64_t)peripheral_clock;
-			temp2 = ((uint64_t)baudrate * sample_num);
-			baud_int = long_division(temp1, temp2);
-			baud_int -= baud_fp;
-			baud_int = baud_int / BAUD_FP_MAX;
-			if(baud_int < BAUD_INT_MAX) {
-				break;
-			}
-		}
-		if(baud_fp == BAUD_FP_MAX) {
-			return STATUS_ERR_BAUDRATE_UNAVAILABLE;
-		}
-		baud_calculated = baud_int | (baud_fp << 13);
-	}
-
-	*baudval = baud_calculated;
-	return STATUS_OK;
-}
-#endif
-
-/**
- * \brief Set GCLK channel to generator.
- *
- * This will set the appropriate GCLK channel to the requested GCLK generator.
- * This will set the generator for all SERCOM instances, and the user will thus
- * only be able to set the same generator that has previously been set, if any.
- *
- * After the generator has been set the first time, the generator can be changed
- * using the \c force_change flag.
- *
- * \param[in]  generator_source The generator to use for SERCOM.
- * \param[in]  force_change     Force change the generator.
- *
- * \return Status code indicating the GCLK generator change operation.
- * \retval STATUS_OK                       If the generator update request was
- *                                         successful.
- * \retval STATUS_ERR_ALREADY_INITIALIZED  If a generator was already configured
- *                                         and the new configuration was not
- *                                         forced.
- */
-enum status_code sercom_set_gclk_generator(
-		const enum gclk_generator generator_source,
-		const bool force_change)
-{
-	/* Check if valid option */
-	if (!_sercom_config.generator_is_set || force_change) {
-		/* Create and fill a GCLK configuration structure for the new config */
-		struct system_gclk_chan_config gclk_chan_conf;
-		system_gclk_chan_get_config_defaults(&gclk_chan_conf);
-		gclk_chan_conf.source_generator = generator_source;
-		system_gclk_chan_set_config(SERCOM_GCLK_ID, &gclk_chan_conf);
-		system_gclk_chan_enable(SERCOM_GCLK_ID);
-
-		/* Save config */
-		_sercom_config.generator_source = generator_source;
-		_sercom_config.generator_is_set = true;
-
-		return STATUS_OK;
-	} else if (generator_source == _sercom_config.generator_source) {
-		/* Return status OK if same config */
-		return STATUS_OK;
-	}
-
-	/* Return invalid config to already initialized GCLK */
-	return STATUS_ERR_ALREADY_INITIALIZED;
-}
-
-/** \internal
- * Creates a switch statement case entry to convert a SERCOM instance and pad
- * index to the default SERCOM pad MUX setting.
- */
-#define _SERCOM_PAD_DEFAULTS_CASE(n, pad) \
-		case (uintptr_t)SERCOM##n: \
-			switch (pad) { \
-				case 0: \
-					return SERCOM##n##_PAD0_DEFAULT; \
-				case 1: \
-					return SERCOM##n##_PAD1_DEFAULT; \
-				case 2: \
-					return SERCOM##n##_PAD2_DEFAULT; \
-				case 3: \
-					return SERCOM##n##_PAD3_DEFAULT; \
-			} \
-			break;
-
-/**
- * \internal Gets the default PAD pinout for a given SERCOM.
- *
- * Returns the pinmux settings for the given SERCOM and pad. This is used
- * for default configuration of pins.
- *
- * \param[in]  sercom_module   Pointer to the SERCOM module
- * \param[in]  pad             PAD to get default pinout for
- *
- * \returns The default pinmux for the given SERCOM instance and PAD
- *
- */
-uint32_t _sercom_get_default_pad(
-		Sercom *const sercom_module,
-		const uint8_t pad)
-{
-	switch ((uintptr_t)sercom_module) {
-		/* Auto-generate a lookup table for the default SERCOM pad defaults */
-		MREPEAT(SERCOM_INST_NUM, _SERCOM_PAD_DEFAULTS_CASE, pad)
-	}
-
-	Assert(false);
-	return 0;
-}
-
-/**
- * \internal
- * Find index of given instance.
- *
- * \param[in] sercom_instance  Instance pointer.
- *
- * \return Index of given instance.
- */
-uint8_t _sercom_get_sercom_inst_index(
-		Sercom *const sercom_instance)
-{
-	/* Save all available SERCOM instances for compare */
-	Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS;
-
-	/* Find index for sercom instance */
-	for (uint32_t i = 0; i < SERCOM_INST_NUM; i++) {
-		if ((uintptr_t)sercom_instance == (uintptr_t)sercom_instances[i]) {
-			return i;
-		}
-	}
-
-	/* Invalid data given */
-	Assert(false);
-	return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.h
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.h b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.h
deleted file mode 100755
index 60ce6f8..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-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 SERCOM_H_INCLUDED
-#define SERCOM_H_INCLUDED
-
-#include <compiler.h>
-#include <system.h>
-#include <clock.h>
-#include <system_interrupt.h>
-#include "sercom_pinout.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* SERCOM modules should share  same slow GCLK channel ID */
-#define SERCOM_GCLK_ID SERCOM0_GCLK_ID_SLOW
-
-#if (0x1ff >= REV_SERCOM)
-#  define FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_1
-#elif (0x400 >= REV_SERCOM)
-#  define FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_2
-#else
-#  error "Unknown SYNCBUSY scheme for this SERCOM revision"
-#endif
-
-/**
- * \brief sercom asynchronous operation mode
- *
- * Select sercom asynchronous operation mode
- */
-enum sercom_asynchronous_operation_mode {
-	SERCOM_ASYNC_OPERATION_MODE_ARITHMETIC = 0,
-	SERCOM_ASYNC_OPERATION_MODE_FRACTIONAL,
-};
-
-/**
- * \brief sercom asynchronous samples per bit
- *
- * Select number of samples per bit
- */
-enum sercom_asynchronous_sample_num {
-	SERCOM_ASYNC_SAMPLE_NUM_3 = 3,
-	SERCOM_ASYNC_SAMPLE_NUM_8 = 8,
-	SERCOM_ASYNC_SAMPLE_NUM_16 = 16,
-};
-
-enum status_code sercom_set_gclk_generator(
-		const enum gclk_generator generator_source,
-		const bool force_change);
-
-enum status_code _sercom_get_sync_baud_val(
-		const uint32_t baudrate,
-		const uint32_t external_clock,
-		uint16_t *const baudval);
-
-enum status_code _sercom_get_async_baud_val(
-		const uint32_t baudrate,
-		const uint32_t peripheral_clock,
-		uint16_t *const baudval,
-		enum sercom_asynchronous_operation_mode mode,
-		enum sercom_asynchronous_sample_num sample_num);
-
-uint32_t _sercom_get_default_pad(
-		Sercom *const sercom_module,
-		const uint8_t pad);
-
-uint8_t _sercom_get_sercom_inst_index(
-		Sercom *const sercom_instance);
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__SERCOM_H_INCLUDED

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.c
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.c b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.c
deleted file mode 100755
index 24dd33d..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-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>
- */
-#include "sercom_interrupt.h"
-#include "bsp/cmsis_nvic.h"
-
-void *_sercom_instances[SERCOM_INST_NUM];
-
-/** Save status of initialized handlers */
-static bool _handler_table_initialized = false;
-
-/** Void pointers for saving device instance structures */
-static void (*_sercom_interrupt_handlers[SERCOM_INST_NUM])(const uint8_t instance);
-
-/**
- * \internal
- * Default interrupt handler.
- *
- * \param[in] instance SERCOM instance used.
- */
-static void _sercom_default_handler(
-		const uint8_t instance)
-{
-	Assert(false);
-}
-
-
-
-/** \internal
- * Converts a given SERCOM index to its interrupt vector index.
- */
-#define _SERCOM_INTERRUPT_VECT_NUM(n, unused) \
-		SYSTEM_INTERRUPT_MODULE_SERCOM##n,
-
-/** \internal
- * Generates a SERCOM interrupt handler function for a given SERCOM index.
- */
-#define _SERCOM_INTERRUPT_HANDLER(n, unused) \
-		void SERCOM##n##_Handler(void) \
-		{ \
-			_sercom_interrupt_handlers[n](n); \
-		}
-
-/**
- * \internal
- * Returns the system interrupt vector.
- *
- * \param[in]  sercom_instance  Instance pointer
- *
- * \return Enum of system interrupt vector
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM0
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM1
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM2
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM3
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM4
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM5
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM6
- * \retval SYSTEM_INTERRUPT_MODULE_SERCOM7
- */
-enum system_interrupt_vector _sercom_get_interrupt_vector(
-		Sercom *const sercom_instance)
-{
-	const uint8_t sercom_int_vectors[SERCOM_INST_NUM] =
-		{
-			MREPEAT(SERCOM_INST_NUM, _SERCOM_INTERRUPT_VECT_NUM, ~)
-		};
-
-	/* Retrieve the index of the SERCOM being requested */
-	uint8_t instance_index = _sercom_get_sercom_inst_index(sercom_instance);
-
-	/* Get the vector number from the lookup table for the requested SERCOM */
-	return (enum system_interrupt_vector)sercom_int_vectors[instance_index];
-}
-
-/** Auto-generate a set of interrupt handlers for each SERCOM in the device */
-MREPEAT(SERCOM_INST_NUM, _SERCOM_INTERRUPT_HANDLER, ~)
-
-        
-        /**
- * \internal
- * Saves the given callback handler.
- *
- * \param[in]  instance           Instance index.
- * \param[in]  interrupt_handler  Pointer to instance callback handler.
- */
-void _sercom_set_handler(
-		const uint8_t instance,
-		const sercom_handler_t interrupt_handler)
-{
-    
-	/* Initialize handlers with default handler and device instances with 0 */
-	if (_handler_table_initialized == false) {
-		for (uint32_t i = 0; i < SERCOM_INST_NUM; i++) {
-			_sercom_interrupt_handlers[i] = &_sercom_default_handler;
-			_sercom_instances[i] = NULL;
-		}
-
-		_handler_table_initialized = true;
-	}
-
-	/* Save interrupt handler */
-	_sercom_interrupt_handlers[instance] = interrupt_handler;  
-        
-        /* install the interrupt handler in the proper spot in the 
-         * vector table. */
-        
-        /* specific to SAMD21G since we are trying to add interrupts here to
-         * the ram based NVIC controller */
-        switch(instance) {
-                case 0:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM0, 
-                            (uint32_t) SERCOM0_Handler);
-                    break;
-                case 1:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM1, 
-                            (uint32_t) SERCOM1_Handler);
-                    break;
-                case 2:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM2, 
-                            (uint32_t) SERCOM2_Handler);
-                    break;                    
-                case 3:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM3, 
-                            (uint32_t) SERCOM3_Handler);
-                    break;
-                case 4:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM4, 
-                            (uint32_t) SERCOM4_Handler);
-                    break;
-                case 5:
-                    NVIC_SetVector(SYSTEM_INTERRUPT_MODULE_SERCOM5, 
-                            (uint32_t) SERCOM5_Handler);
-                    break;                                        
-        }
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.h
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.h b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.h
deleted file mode 100755
index 18945f5..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_interrupt.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-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 SERCOM_INTERRUPT_H_INCLUDED
-#define SERCOM_INTERRUPT_H_INCLUDED
-
-#include "sercom.h"
-#include <system_interrupt.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Look-up table for device instances */
-extern void *_sercom_instances[SERCOM_INST_NUM];
-
-typedef void (*sercom_handler_t)(uint8_t instance);
-
-enum system_interrupt_vector _sercom_get_interrupt_vector(
-		Sercom *const sercom_instance);
-
-void _sercom_set_handler(
-		const uint8_t instance,
-		const sercom_handler_t interrupt_handler);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SERCOM_INTERRUPT_H_INCLUDED */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_pinout.h
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_pinout.h b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_pinout.h
deleted file mode 100755
index 628d2dd..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/sercom_pinout.h
+++ /dev/null
@@ -1,526 +0,0 @@
-/**
- * \file
- *
- * \brief SAM SERCOM Module Pinout Definitions
- *
- * Copyright (C) 2012-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 SERCOM_PINOUT_H_INCLUDED
-#define SERCOM_PINOUT_H_INCLUDED
-
-#include <compiler.h>
-
-#if SAMR21E
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA08C_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA09C_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA14C_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA15C_SERCOM2_PAD3
-
-	/* SERCOM3 */
-# if SAM_PART_IS_DEFINED(SAMR21E19A)
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA16D_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA17D_SERCOM3_PAD1
-# else
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA27F_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA28F_SERCOM3_PAD1
-#endif
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA24C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA25C_SERCOM3_PAD3
-
-	/* SERCOM4 */
-# if SAM_PART_IS_DEFINED(SAMR21E19A)
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PB08D_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PB09D_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15D_SERCOM4_PAD3
-# else
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PC19F_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PB31F_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PB30F_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PC18F_SERCOM4_PAD3
-# endif
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PB30D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PB31D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PA24D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PA25D_SERCOM5_PAD3
-
-#elif SAMR21G
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA00D_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA01D_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA12C_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA13C_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA14C_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA15C_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA16D_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA17D_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA18D_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA19D_SERCOM3_PAD3
-
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PC19F_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PB31F_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PB30F_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PC18F_SERCOM4_PAD3
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PA22D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PA23D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PA24D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PA25D_SERCOM5_PAD3
-
-#elif (SAMD09)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA08D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA09D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA30C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA31C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA24C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA25C_SERCOM1_PAD3
-
-#elif (SAMD10DS) || (SAMD10DM) || (SAMD10DU) || (SAMD11DS) || (SAMD11DM) || (SAMD11DU) 
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA22C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA23C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA22D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA23D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA16D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA25D_SERCOM2_PAD3
-
-#elif (SAMD10C) || (SAMD11C)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA08D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA09D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA30C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA31C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA24C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA25C_SERCOM1_PAD3
-
-#elif SAM_PART_IS_DEFINED(SAMD21E15L) || SAM_PART_IS_DEFINED(SAMD21E16L)
-
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA10D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA11D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA22C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA23C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA24C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA25C_SERCOM3_PAD3
-
-#elif (SAML22N)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA08C_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA09C_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA10C_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA11C_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA22D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA23D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA20D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA21D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PB02C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PB21C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PB00C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PB01C_SERCOM3_PAD3
-
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PA12C_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PA13C_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14C_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15C_SERCOM4_PAD3
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PB30D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PB31D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PB22D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PB23D_SERCOM5_PAD3
-#elif (SAML22J)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA08C_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA09C_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA10C_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA11C_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA22D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA23D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA20D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA21D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PB02C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PB13C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PB00C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PB01C_SERCOM3_PAD3
-#elif (SAML22G)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA08C_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA09C_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA10C_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA11C_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA22D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA23D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA20D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA21D_SERCOM2_PAD3
-#elif (SAMC20E) || (SAMC21E)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA10D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA11D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA22C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA23C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA24C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA25C_SERCOM3_PAD3
-
-#elif (SAMC20G) || (SAMC21G)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA12C_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA13C_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA14C_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA15C_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA22C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA23C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA24C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA25C_SERCOM3_PAD3
-
-  #ifdef ID_SERCOM4
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PB08D_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PB09D_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PB10D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PB11D_SERCOM4_PAD3
-  #endif
-
-  #ifdef ID_SERCOM5
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PB02D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PB03D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PB22D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PB23D_SERCOM5_PAD3
-  #endif
-
-#elif (SAMC20J) || (SAMC21J)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA12C_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA13C_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA14C_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA15C_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA22C_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA23C_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA24C_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA25C_SERCOM3_PAD3
-
-  #ifdef ID_SERCOM4
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PB08D_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PB09D_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PB10D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PB11D_SERCOM4_PAD3
-  #endif
-
-  #ifdef ID_SERCOM5
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PB02D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PB03D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PB00D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PB01D_SERCOM5_PAD3
-  #endif
-
-#elif (SAMDA1)
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA00D_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA01D_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA10D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA11D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA16D_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA17D_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA18D_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA19D_SERCOM3_PAD3
-
-  #if (SAMDA1E)
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      0 /* No available pin */
-	#define SERCOM4_PAD1_DEFAULT      0 /* No available pin */
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15D_SERCOM4_PAD3
-  #else
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PA12D_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PA13D_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15D_SERCOM4_PAD3
-  #endif
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PA22D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PA23D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PA24D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PA25D_SERCOM5_PAD3
-
-#elif (SAML21E)
-
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA00D_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA01D_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA10D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA11D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA16D_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA17D_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA18D_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA19D_SERCOM3_PAD3
-
-  #if !SAM_PART_IS_DEFINED(SAML21E18A)
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      0 /* No available pin */
-	#define SERCOM4_PAD1_DEFAULT      0 /* No available pin */
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15D_SERCOM4_PAD3
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PA22D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PA23D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PA24D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PA25D_SERCOM5_PAD3
-  #endif
-
-#else
-	/* SERCOM0 */
-	#define SERCOM0_PAD0_DEFAULT      PINMUX_PA04D_SERCOM0_PAD0
-	#define SERCOM0_PAD1_DEFAULT      PINMUX_PA05D_SERCOM0_PAD1
-	#define SERCOM0_PAD2_DEFAULT      PINMUX_PA06D_SERCOM0_PAD2
-	#define SERCOM0_PAD3_DEFAULT      PINMUX_PA07D_SERCOM0_PAD3
-
-	/* SERCOM1 */
-#if SAM_PART_IS_DEFINED(SAMD21G15L) || SAM_PART_IS_DEFINED(SAMD21G16L)
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA16C_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA17C_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA18C_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA19C_SERCOM1_PAD3
-#else
-	#define SERCOM1_PAD0_DEFAULT      PINMUX_PA00D_SERCOM1_PAD0
-	#define SERCOM1_PAD1_DEFAULT      PINMUX_PA01D_SERCOM1_PAD1
-	#define SERCOM1_PAD2_DEFAULT      PINMUX_PA30D_SERCOM1_PAD2
-	#define SERCOM1_PAD3_DEFAULT      PINMUX_PA31D_SERCOM1_PAD3
-#endif
-
-	/* SERCOM2 */
-	#define SERCOM2_PAD0_DEFAULT      PINMUX_PA08D_SERCOM2_PAD0
-	#define SERCOM2_PAD1_DEFAULT      PINMUX_PA09D_SERCOM2_PAD1
-	#define SERCOM2_PAD2_DEFAULT      PINMUX_PA10D_SERCOM2_PAD2
-	#define SERCOM2_PAD3_DEFAULT      PINMUX_PA11D_SERCOM2_PAD3
-
-	/* SERCOM3 */
-	#define SERCOM3_PAD0_DEFAULT      PINMUX_PA16D_SERCOM3_PAD0
-	#define SERCOM3_PAD1_DEFAULT      PINMUX_PA17D_SERCOM3_PAD1
-	#define SERCOM3_PAD2_DEFAULT      PINMUX_PA18D_SERCOM3_PAD2
-	#define SERCOM3_PAD3_DEFAULT      PINMUX_PA19D_SERCOM3_PAD3
-
-  #if !(SAMD20E ||SAMD21E)
-	/* SERCOM4 */
-	#define SERCOM4_PAD0_DEFAULT      PINMUX_PA12D_SERCOM4_PAD0
-	#define SERCOM4_PAD1_DEFAULT      PINMUX_PA13D_SERCOM4_PAD1
-	#define SERCOM4_PAD2_DEFAULT      PINMUX_PA14D_SERCOM4_PAD2
-	#define SERCOM4_PAD3_DEFAULT      PINMUX_PA15D_SERCOM4_PAD3
-
-	/* SERCOM5 */
-	#define SERCOM5_PAD0_DEFAULT      PINMUX_PA22D_SERCOM5_PAD0
-	#define SERCOM5_PAD1_DEFAULT      PINMUX_PA23D_SERCOM5_PAD1
-	#define SERCOM5_PAD2_DEFAULT      PINMUX_PA24D_SERCOM5_PAD2
-	#define SERCOM5_PAD3_DEFAULT      PINMUX_PA25D_SERCOM5_PAD3
-  #endif
-
-#endif
-
-#endif /* SERCOM_PINOUT_H_INCLUDED */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/module_config/conf_spi.h
----------------------------------------------------------------------
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/module_config/conf_spi.h b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/module_config/conf_spi.h
deleted file mode 100755
index e1ec6dc..0000000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/module_config/conf_spi.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * \file
- *
- * \brief SAM SPI configuration
- *
- * Copyright (C) 2013-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 CONF_SPI_H_INCLUDED
-#  define CONF_SPI_H_INCLUDED
-
-#  define CONF_SPI_MASTER_ENABLE     true
-#  define CONF_SPI_SLAVE_ENABLE      true
-#  define CONF_SPI_TIMEOUT           10000
-
-#endif /* CONF_SPI_H_INCLUDED */
-