1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-07 00:04:36 +03:00

[sam] fixing last stupid commit

This commit is contained in:
Thibaut VIARD
2011-09-06 21:05:41 +02:00
parent 8f01f92e87
commit a5d2349761
550 changed files with 16866 additions and 17198 deletions

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file
@@ -96,7 +71,7 @@
#define ADC_EnableChannel( pAdc, channel ) {\
assert( channel < 16 ) ;\
assert( (channel) < 16 ) ;\
(pAdc)->ADC_CHER = (1 << (channel));\
}
@@ -114,7 +89,7 @@
}
#define ADC_EnableTS(pAdc,dwMode) {\
(pAdc)->ADC_ACR |= dwMode;\
(pAdc)->ADC_ACR |= (dwMode);\
}
#define ADC_EnableDataReadyIt(pAdc) ((pAdc)->ADC_IER = AT91C_ADC_DRDY)

View File

@@ -1,113 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/**
* \file
*
* \section Purpose
*
* Interface for configuration the Enhanced Embedded Flash Controller (EEFC) peripheral.
*
* \section Usage
*
* -# Enable/disable %flash ready interrupt sources using EFC_EnableFrdyIt()
* and EFC_DisableFrdyIt().
* -# Translates the given address into which EEFC, page and offset values
* for difference density %flash memory using EFC_TranslateAddress().
* -# Computes the address of a %flash access given the EFC, page and offset
* for difference density %flash memory using EFC_ComputeAddress().
* -# Start the executing command with EFC_StartCommand()
* -# Retrieve the current status of the EFC using EFC_GetStatus().
* -# Retrieve the result of the last executed command with EFC_GetResult().
*/
#ifndef _EEFC_
#define _EEFC_
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "../chip.h"
#include <stdint.h>
/*----------------------------------------------------------------------------
* Definitions
*----------------------------------------------------------------------------*/
/* EFC command */
#define EFC_FCMD_GETD 0x00
#define EFC_FCMD_WP 0x01
#define EFC_FCMD_WPL 0x02
#define EFC_FCMD_EWP 0x03
#define EFC_FCMD_EWPL 0x04
#define EFC_FCMD_EA 0x05
#define EFC_FCMD_SLB 0x08
#define EFC_FCMD_CLB 0x09
#define EFC_FCMD_GLB 0x0A
#define EFC_FCMD_SFB 0x0B
#define EFC_FCMD_CFB 0x0C
#define EFC_FCMD_GFB 0x0D
#define EFC_FCMD_STUI 0x0E /* Start unique ID */
#define EFC_FCMD_SPUI 0x0F /* Stop unique ID */
/* The IAP function entry addreass */
#define CHIP_FLASH_IAP_ADDRESS (0x00800008)
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------------------------
* Exported functions
*----------------------------------------------------------------------------*/
extern void EFC_EnableFrdyIt( Efc* efc ) ;
extern void EFC_DisableFrdyIt( Efc* efc ) ;
extern void EFC_SetWaitState( Efc* efc, uint8_t cycles ) ;
extern void EFC_TranslateAddress( Efc** pEfc, uint32_t dwAddress, uint16_t *pwPage, uint16_t *pwOffset ) ;
extern void EFC_ComputeAddress( Efc* efc, uint16_t wPage, uint16_t wOffset, uint32_t *pdwAddress ) ;
extern void EFC_StartCommand( Efc* efc, uint32_t dwCommand, uint32_t dwArgument ) ;
extern uint32_t EFC_PerformCommand( Efc* efc, uint32_t dwCommand, uint32_t dwArgument, uint32_t dwUseIAP ) ;
extern uint32_t EFC_GetStatus( Efc* efc ) ;
extern uint32_t EFC_GetResult( Efc* efc ) ;
#ifdef __cplusplus
}
#endif
#endif /* #ifndef _EEFC_ */

View File

@@ -1,97 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/**
* \file
* Interface for default exception handlers.
*/
#ifndef _EXCEPTIONS_
#define _EXCEPTIONS_
/*----------------------------------------------------------------------------
* Types
*----------------------------------------------------------------------------*/
/* Function prototype for exception table items (interrupt handler). */
typedef void( *IntFunc )( void ) ;
/*----------------------------------------------------------------------------
* Exported functions
*----------------------------------------------------------------------------*/
/* Default empty handler */
extern void Dummy_Handler( void ) ;
/* Cortex-M3 core handlers */
extern void NMI_Handler( void ) ;
extern void HardFault_Handler( void ) ;
extern void MemManage_Handler( void ) ;
extern void BusFault_Handler( void ) ;
extern void UsageFault_Handler( void ) ;
extern void SVC_Handler( void ) ;
extern void DebugMon_Handler( void ) ;
extern void PendSV_Handler( void ) ;
extern void SysTick_Handler( void ) ;
/* Peripherals handlers */
extern void ACC_IrqHandler( void ) ;
extern void ADC_IrqHandler( void ) ;
extern void CRCCU_IrqHandler( void ) ;
extern void DAC_IrqHandler( void ) ;
extern void EEFC_IrqHandler( void ) ;
extern void MCI_IrqHandler( void ) ;
extern void PIOA_IrqHandler( void ) ;
extern void PIOB_IrqHandler( void ) ;
extern void PIOC_IrqHandler( void ) ;
extern void PMC_IrqHandler( void ) ;
extern void PWM_IrqHandler( void ) ;
extern void RSTC_IrqHandler( void ) ;
extern void RTC_IrqHandler( void ) ;
extern void RTT_IrqHandler( void ) ;
extern void SMC_IrqHandler( void ) ;
extern void SPI_IrqHandler( void ) ;
extern void SSC_IrqHandler( void ) ;
extern void SUPC_IrqHandler( void ) ;
extern void TC0_IrqHandler( void ) ;
extern void TC1_IrqHandler( void ) ;
extern void TC2_IrqHandler( void ) ;
extern void TC3_IrqHandler( void ) ;
extern void TC4_IrqHandler( void ) ;
extern void TC5_IrqHandler( void ) ;
extern void TWI0_IrqHandler( void ) ;
extern void TWI1_IrqHandler( void ) ;
extern void UART0_IrqHandler( void ) ;
extern void UART1_IrqHandler( void ) ;
extern void USART0_IrqHandler( void ) ;
extern void USART1_IrqHandler( void ) ;
extern void USBD_IrqHandler( void ) ;
extern void WDT_IrqHandler( void ) ;
#endif /* _EXCEPTIONS_ */

View File

@@ -1,79 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/**
* \file
*
* The flash driver provides the unified interface for flash program operations.
*
*/
#ifndef _FLASHD_
#define _FLASHD_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------------------------
* Exported functions
*----------------------------------------------------------------------------*/
extern void FLASHD_Initialize( uint32_t dwMCk, uint32_t dwUseIAP ) ;
extern uint32_t FLASHD_Erase( uint32_t dwAddress ) ;
extern uint32_t FLASHD_Write( uint32_t dwAddress, const void *pvBuffer, uint32_t dwSize ) ;
extern uint32_t FLASHD_Lock( uint32_t dwStart, uint32_t dwEnd, uint32_t *pdwActualStart, uint32_t *pdwActualEnd ) ;
extern uint32_t FLASHD_Unlock( uint32_t dwStart, uint32_t dwEnd, uint32_t *pdwActualStart, uint32_t *pdwActualEnd ) ;
extern uint32_t FLASHD_IsLocked( uint32_t dwStart, uint32_t dwEnd ) ;
extern uint32_t FLASHD_SetGPNVM( uint8_t gpnvm ) ;
extern uint32_t FLASHD_ClearGPNVM( uint8_t gpnvm ) ;
extern uint32_t FLASHD_IsGPNVMSet( uint8_t gpnvm ) ;
#define FLASHD_IsSecurityBitSet() FLASHD_IsGPNVMSet( 0 )
#define FLASHD_SetSecurityBit() FLASHD_SetGPNVM( 0 )
extern uint32_t FLASHD_ReadUniqueID( uint32_t* pdwUniqueID ) ;
#ifdef __cplusplus
}
#endif
#endif /* #ifndef _FLASHD_ */

View File

@@ -1,3 +1,7 @@
/*
%atmel_license%
*/
#ifndef _PIO_
#define _PIO_
@@ -21,7 +25,7 @@ typedef enum _EPioType
PIO_PERIPH_D, /* The pin is controlled by the associated signal of peripheral D. */
PIO_INPUT, /* The pin is an input. */
PIO_OUTPUT_0, /* The pin is an output and has a default level of 0. */
PIO_OUTPUT_1, /* The pin is an output and has a default level of 1. */
PIO_OUTPUT_1 /* The pin is an output and has a default level of 1. */
} EPioType ;

View File

@@ -1,3 +1,7 @@
/*
%atmel_license%
*/
/**
* \file
*

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
#ifndef _PMC_
#define _PMC_

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -5,51 +5,72 @@
#ifndef _SAM3_
#define _SAM3_
#if (defined __sam3s8a__) || (defined __sam3s8b__) || (defined __sam3s8c__) /* SAM3S8 */
#if (defined __SAM3S8A__) || (defined __SAM3S8B__) || (defined __SAM3S8C__) /* SAM3S8 */
#include "cmsis/sam3s8/include/sam3s8.h"
#include "cmsis/sam3s/include/system_sam3s8.h"
#elif (defined __sam3sd8a__) || (defined __sam3sd8b__) || (defined __sam3sd8c__) /* SAM3SD8 */
#include "cmsis/sam3s8/source/templates/system_sam3s8.h"
#include "cmsis/sam3s8/source/templates/exceptions.h"
#elif (defined __SAM3SD8A__) || (defined __SAM3SD8B__) || (defined __SAM3SD8C__) /* SAM3SD8 */
#include "cmsis/sam3s8/include/sam3s8.h"
#include "cmsis/sam3s/include/system_sam3s8.h"
#elif (defined __sam3s4c__) || (defined __sam3s4b__) || (defined __sam3s4a__) /* SAM3S4 */
#include "cmsis/sam3s8/source/templates/system_sam3s8.h"
#include "cmsis/sam3s8/source/templates/exceptions.h"
#elif (defined __SAM3S4C__) || (defined __SAM3S4B__) || (defined __SAM3S4A__) /* SAM3S4 */
#include "cmsis/sam3s/include/sam3s.h"
#include "cmsis/sam3s/include/system_sam3s.h"
#elif (defined __sam3s2c__) || (defined __sam3s2b__) || (defined __sam3s2a__) /* SAM3S2 */
#include "cmsis/sam3s/source/templates/system_sam3s.h"
#include "cmsis/sam3s/source/templates/exceptions.h"
#elif (defined __SAM3S2C__) || (defined __SAM3S2B__) || (defined __SAM3S2A__) /* SAM3S2 */
#include "cmsis/sam3s/include/sam3s.h"
#include "cmsis/sam3s/include/system_sam3s.h"
#elif (defined __sam3s1c__) || (defined __sam3s1b__) || (defined __sam3s1a__) /* SAM3S1 */
#include "cmsis/sam3s/source/templates/system_sam3s.h"
#include "cmsis/sam3s/source/templates/exceptions.h"
#elif (defined __SAM3S1C__) || (defined __SAM3S1B__) || (defined __SAM3S1A__) /* SAM3S1 */
#include "cmsis/sam3s/include/sam3s.h"
#include "cmsis/sam3s/include/system_sam3s.h"
#elif (defined __sam3u4c__) || (defined __sam3u4e__) /* SAM3U4 */
#include "cmsis/sam3s/source/templates/system_sam3s.h"
#include "cmsis/sam3s/source/templates/exceptions.h"
#elif (defined __SAM3U4C__) || (defined __SAM3U4E__) /* SAM3U4 */
#include "cmsis/sam3u/include/sam3u.h"
#include "cmsis/sam3s/include/system_sam3u.h"
#elif (defined __sam3u2c__) || (defined __sam3u2e__) /* SAM3U2 */
#include "cmsis/sam3u/source/templates/system_sam3u.h"
#include "cmsis/sam3u/source/templates/exceptions.h"
#elif (defined __SAM3U2C__) || (defined __SAM3U2E__) /* SAM3U2 */
#include "cmsis/sam3u/include/sam3u.h"
#include "cmsis/sam3s/include/system_sam3u.h"
#elif (defined __sam3u1c__) || (defined __sam3u1e__) /* SAM3U1 */
#include "cmsis/sam3u/source/templates/system_sam3u.h"
#include "cmsis/sam3u/source/templates/exceptions.h"
#elif (defined __SAM3U1C__) || (defined __SAM3U1E__) /* SAM3U1 */
#include "cmsis/sam3u/include/sam3u.h"
#include "cmsis/sam3s/include/system_sam3u.h"
#elif (defined __sam3n4c__) || (defined __sam3n4b__) || (defined __sam3n4a__) /* SAM3N4 */
#include "cmsis/sam3u/source/templates/system_sam3u.h"
#include "cmsis/sam3u/source/templates/exceptions.h"
#elif (defined __SAM3N4C__) || (defined __SAM3N4B__) || (defined __SAM3N4A__) /* SAM3N4 */
#include "cmsis/sam3n/include/sam3n.h"
#include "cmsis/sam3s/include/system_sam3n.h"
#elif (defined __sam3n2c__) || (defined __sam3n2b__) || (defined __sam3n2a__) /* SAM3N2 */
#include "cmsis/sam3n/source/templates/system_sam3n.h"
#include "cmsis/sam3n/source/templates/exceptions.h"
#elif (defined __SAM3N2C__) || (defined __SAM3N2B__) || (defined __SAM3N2A__) /* SAM3N2 */
#include "cmsis/sam3n/include/sam3n.h"
#include "cmsis/sam3s/include/system_sam3n.h"
#elif (defined __sam3n1c__) || (defined __sam3n1b__) || (defined __sam3n1a__) /* SAM3N1 */
#include "cmsis/sam3n/source/templates/system_sam3n.h"
#include "cmsis/sam3n/source/templates/exceptions.h"
#elif (defined __SAM3N1C__) || (defined __SAM3N1B__) || (defined __SAM3N1A__) /* SAM3N1 */
#include "cmsis/sam3n/include/sam3n.h"
#include "cmsis/sam3s/include/system_sam3n.h"
#elif (defined __sam3a8c__) || (defined __sam3a4c__) || (defined __sam3a2c__) /* SAM3A */
#include "cmsis/sam3n/source/templates/system_sam3n.h"
#include "cmsis/sam3n/source/templates/exceptions.h"
#elif (defined __SAM3A8C__) || (defined __SAM3A4C__) || (defined __SAM3A2C__) /* SAM3A */
#include "cmsis/sam3xa/include/sam3xa.h"
#include "cmsis/sam3s/include/system_sam3xa.h"
#elif (defined __sam3x8c__) || (defined __sam3x8e__) || (defined __sam3x8g__) || (defined __sam3x8h__) /* SAM3X8 */
#include "cmsis/sam3xa/source/templates/system_sam3xa.h"
#include "cmsis/sam3xa/source/templates/exceptions.h"
#elif (defined __SAM3X8C__) || (defined __SAM3X8E__) || (defined __SAM3X8G__) || (defined __SAM3X8H__) /* SAM3X8 */
#include "cmsis/sam3xa/include/sam3xa.h"
#include "cmsis/sam3s/include/system_sam3xa.h"
#elif (defined __sam3x4c__) || (defined __sam3x4e__) || (defined __sam3x4g__) || (defined __sam3x4h__) /* SAM3X4 */
#include "cmsis/sam3xa/source/templates/system_sam3xa.h"
#include "cmsis/sam3xa/source/templates/exceptions.h"
#elif (defined __SAM3X4C__) || (defined __SAM3X4E__) || (defined __SAM3X4G__) || (defined __SAM3X4H__) /* SAM3X4 */
#include "cmsis/sam3xa/include/sam3xa.h"
#include "cmsis/sam3s/include/system_sam3xa.h"
#elif (defined __sam3x2c__) || (defined __sam3x2e__) || (defined __sam3x2g__) || (defined __sam3x2h__) /* SAM3X2 */
#include "cmsis/sam3xa/source/templates/system_sam3xa.h"
#include "cmsis/sam3xa/source/templates/exceptions.h"
#elif (defined __SAM3X2C__) || (defined __SAM3X2E__) || (defined __SAM3X2G__) || (defined __SAM3X2H__) /* SAM3X2 */
#include "cmsis/sam3xa/include/sam3xa.h"
#include "cmsis/sam3s/include/system_sam3xa.h"
#include "cmsis/sam3xa/source/templates/system_sam3xa.h"
#include "cmsis/sam3xa/source/templates/exceptions.h"
#else
#error Library does not support the specified device.
#endif

View File

@@ -14,7 +14,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#endif
#ifndef __ASSEMBLY__
#include <stdint.h>
@@ -25,10 +25,8 @@ typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile
#endif
typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */
typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */
#define CAST(type, value) (((type)*)(value))
#define REG_ACCESS(type, address) (*((type)*)(address)) /**< C code: Register value */
#else
#define CAST(type, value) (value)
#define REG_ACCESS(type, address) (address) /**< Assembly code: Register address */
#endif
@@ -51,7 +49,7 @@ typedef enum IRQn
PendSV_IRQn = -2, /**< 14 Cortex-M3 Pend SV Interrupt */
SysTick_IRQn = -1, /**< 15 Cortex-M3 System Tick Interrupt */
/****** SAM3S4C specific Interrupt Numbers *********************************/
SUPC_IRQn = 0, /**< 0 SAM3S4C Supply Controller (SUPC) */
RSTC_IRQn = 1, /**< 1 SAM3S4C Reset Controller (RSTC) */
RTC_IRQn = 2, /**< 2 SAM3S4C Real Time Clock (RTC) */
@@ -87,7 +85,7 @@ typedef enum IRQn
} IRQn_Type;
/**
* \brief Configuration of the Cortex-M3 Processor and Core Peripherals
* \brief Configuration of the Cortex-M3 Processor and Core Peripherals
*/
#define __MPU_PRESENT 1 /**< SAM3S4C does provide a MPU */
@@ -221,50 +219,97 @@ typedef enum IRQn
/** \addtogroup SAM3S4C_base Peripheral Base Address Definitions */
/*@{*/
#define HSMCI CAST(Hsmci , 0x40000000U) /**< \brief (HSMCI ) Base Address */
#define PDC_HSMCI CAST(Pdc , 0x40000100U) /**< \brief (PDC_HSMCI ) Base Address */
#define SSC CAST(Ssc , 0x40004000U) /**< \brief (SSC ) Base Address */
#define PDC_SSC CAST(Pdc , 0x40004100U) /**< \brief (PDC_SSC ) Base Address */
#define SPI CAST(Spi , 0x40008000U) /**< \brief (SPI ) Base Address */
#define PDC_SPI CAST(Pdc , 0x40008100U) /**< \brief (PDC_SPI ) Base Address */
#define TC0 CAST(Tc , 0x40010000U) /**< \brief (TC0 ) Base Address */
#define TC1 CAST(Tc , 0x40014000U) /**< \brief (TC1 ) Base Address */
#define TWI0 CAST(Twi , 0x40018000U) /**< \brief (TWI0 ) Base Address */
#define PDC_TWI0 CAST(Pdc , 0x40018100U) /**< \brief (PDC_TWI0 ) Base Address */
#define TWI1 CAST(Twi , 0x4001C000U) /**< \brief (TWI1 ) Base Address */
#define PDC_TWI1 CAST(Pdc , 0x4001C100U) /**< \brief (PDC_TWI1 ) Base Address */
#define PWM CAST(Pwm , 0x40020000U) /**< \brief (PWM ) Base Address */
#define PDC_PWM CAST(Pdc , 0x40020100U) /**< \brief (PDC_PWM ) Base Address */
#define USART0 CAST(Usart , 0x40024000U) /**< \brief (USART0 ) Base Address */
#define PDC_USART0 CAST(Pdc , 0x40024100U) /**< \brief (PDC_USART0) Base Address */
#define USART1 CAST(Usart , 0x40028000U) /**< \brief (USART1 ) Base Address */
#define PDC_USART1 CAST(Pdc , 0x40028100U) /**< \brief (PDC_USART1) Base Address */
#define UDP CAST(Udp , 0x40034000U) /**< \brief (UDP ) Base Address */
#define ADC CAST(Adc , 0x40038000U) /**< \brief (ADC ) Base Address */
#define PDC_ADC CAST(Pdc , 0x40038100U) /**< \brief (PDC_ADC ) Base Address */
#define DACC CAST(Dacc , 0x4003C000U) /**< \brief (DACC ) Base Address */
#define PDC_DACC CAST(Pdc , 0x4003C100U) /**< \brief (PDC_DACC ) Base Address */
#define ACC CAST(Acc , 0x40040000U) /**< \brief (ACC ) Base Address */
#define CRCCU CAST(Crccu , 0x40044000U) /**< \brief (CRCCU ) Base Address */
#define SMC CAST(Smc , 0x400E0000U) /**< \brief (SMC ) Base Address */
#define MATRIX CAST(Matrix , 0x400E0200U) /**< \brief (MATRIX ) Base Address */
#define PMC CAST(Pmc , 0x400E0400U) /**< \brief (PMC ) Base Address */
#define UART0 CAST(Uart , 0x400E0600U) /**< \brief (UART0 ) Base Address */
#define PDC_UART0 CAST(Pdc , 0x400E0700U) /**< \brief (PDC_UART0 ) Base Address */
#define CHIPID CAST(Chipid , 0x400E0740U) /**< \brief (CHIPID ) Base Address */
#define UART1 CAST(Uart , 0x400E0800U) /**< \brief (UART1 ) Base Address */
#define PDC_UART1 CAST(Pdc , 0x400E0900U) /**< \brief (PDC_UART1 ) Base Address */
#define EFC CAST(Efc , 0x400E0A00U) /**< \brief (EFC ) Base Address */
#define PIOA CAST(Pio , 0x400E0E00U) /**< \brief (PIOA ) Base Address */
#define PDC_PIOA CAST(Pdc , 0x400E0F68U) /**< \brief (PDC_PIOA ) Base Address */
#define PIOB CAST(Pio , 0x400E1000U) /**< \brief (PIOB ) Base Address */
#define PIOC CAST(Pio , 0x400E1200U) /**< \brief (PIOC ) Base Address */
#define RSTC CAST(Rstc , 0x400E1400U) /**< \brief (RSTC ) Base Address */
#define SUPC CAST(Supc , 0x400E1410U) /**< \brief (SUPC ) Base Address */
#define RTT CAST(Rtt , 0x400E1430U) /**< \brief (RTT ) Base Address */
#define WDT CAST(Wdt , 0x400E1450U) /**< \brief (WDT ) Base Address */
#define RTC CAST(Rtc , 0x400E1460U) /**< \brief (RTC ) Base Address */
#define GPBR CAST(Gpbr , 0x400E1490U) /**< \brief (GPBR ) Base Address */
#ifdef __ASSEMBLY__
#define HSMCI 0x40000000U /**< \brief (HSMCI ) Base Address */
#define PDC_HSMCI 0x40000100U /**< \brief (PDC_HSMCI ) Base Address */
#define SSC 0x40004000U /**< \brief (SSC ) Base Address */
#define PDC_SSC 0x40004100U /**< \brief (PDC_SSC ) Base Address */
#define SPI 0x40008000U /**< \brief (SPI ) Base Address */
#define PDC_SPI 0x40008100U /**< \brief (PDC_SPI ) Base Address */
#define TC0 0x40010000U /**< \brief (TC0 ) Base Address */
#define TC1 0x40014000U /**< \brief (TC1 ) Base Address */
#define TWI0 0x40018000U /**< \brief (TWI0 ) Base Address */
#define PDC_TWI0 0x40018100U /**< \brief (PDC_TWI0 ) Base Address */
#define TWI1 0x4001C000U /**< \brief (TWI1 ) Base Address */
#define PDC_TWI1 0x4001C100U /**< \brief (PDC_TWI1 ) Base Address */
#define PWM 0x40020000U /**< \brief (PWM ) Base Address */
#define PDC_PWM 0x40020100U /**< \brief (PDC_PWM ) Base Address */
#define USART0 0x40024000U /**< \brief (USART0 ) Base Address */
#define PDC_USART0 0x40024100U /**< \brief (PDC_USART0) Base Address */
#define USART1 0x40028000U /**< \brief (USART1 ) Base Address */
#define PDC_USART1 0x40028100U /**< \brief (PDC_USART1) Base Address */
#define UDP 0x40034000U /**< \brief (UDP ) Base Address */
#define ADC 0x40038000U /**< \brief (ADC ) Base Address */
#define PDC_ADC 0x40038100U /**< \brief (PDC_ADC ) Base Address */
#define DACC 0x4003C000U /**< \brief (DACC ) Base Address */
#define PDC_DACC 0x4003C100U /**< \brief (PDC_DACC ) Base Address */
#define ACC 0x40040000U /**< \brief (ACC ) Base Address */
#define CRCCU 0x40044000U /**< \brief (CRCCU ) Base Address */
#define SMC 0x400E0000U /**< \brief (SMC ) Base Address */
#define MATRIX 0x400E0200U /**< \brief (MATRIX ) Base Address */
#define PMC 0x400E0400U /**< \brief (PMC ) Base Address */
#define UART0 0x400E0600U /**< \brief (UART0 ) Base Address */
#define PDC_UART0 0x400E0700U /**< \brief (PDC_UART0 ) Base Address */
#define CHIPID 0x400E0740U /**< \brief (CHIPID ) Base Address */
#define UART1 0x400E0800U /**< \brief (UART1 ) Base Address */
#define PDC_UART1 0x400E0900U /**< \brief (PDC_UART1 ) Base Address */
#define EFC 0x400E0A00U /**< \brief (EFC ) Base Address */
#define PIOA 0x400E0E00U /**< \brief (PIOA ) Base Address */
#define PDC_PIOA 0x400E0F68U /**< \brief (PDC_PIOA ) Base Address */
#define PIOB 0x400E1000U /**< \brief (PIOB ) Base Address */
#define PIOC 0x400E1200U /**< \brief (PIOC ) Base Address */
#define RSTC 0x400E1400U /**< \brief (RSTC ) Base Address */
#define SUPC 0x400E1410U /**< \brief (SUPC ) Base Address */
#define RTT 0x400E1430U /**< \brief (RTT ) Base Address */
#define WDT 0x400E1450U /**< \brief (WDT ) Base Address */
#define RTC 0x400E1460U /**< \brief (RTC ) Base Address */
#define GPBR 0x400E1490U /**< \brief (GPBR ) Base Address */
#else
#define HSMCI ((Hsmci*)0x40000000U) /**< \brief (HSMCI ) Base Address */
#define PDC_HSMCI ((Pdc*)0x40000100U) /**< \brief (PDC_HSMCI ) Base Address */
#define SSC ((Ssc*)0x40004000U) /**< \brief (SSC ) Base Address */
#define PDC_SSC ((Pdc*)0x40004100U) /**< \brief (PDC_SSC ) Base Address */
#define SPI ((Spi*)0x40008000U) /**< \brief (SPI ) Base Address */
#define PDC_SPI ((Pdc*)0x40008100U) /**< \brief (PDC_SPI ) Base Address */
#define TC0 ((Tc*)0x40010000U) /**< \brief (TC0 ) Base Address */
#define TC1 ((Tc*)0x40014000U) /**< \brief (TC1 ) Base Address */
#define TWI0 ((Twi*)0x40018000U) /**< \brief (TWI0 ) Base Address */
#define PDC_TWI0 ((Pdc*)0x40018100U) /**< \brief (PDC_TWI0 ) Base Address */
#define TWI1 ((Twi*)0x4001C000U) /**< \brief (TWI1 ) Base Address */
#define PDC_TWI1 ((Pdc*)0x4001C100U) /**< \brief (PDC_TWI1 ) Base Address */
#define PWM ((Pwm*)0x40020000U) /**< \brief (PWM ) Base Address */
#define PDC_PWM ((Pdc*)0x40020100U) /**< \brief (PDC_PWM ) Base Address */
#define USART0 ((Usart*)0x40024000U) /**< \brief (USART0 ) Base Address */
#define PDC_USART0 ((Pdc*)0x40024100U) /**< \brief (PDC_USART0) Base Address */
#define USART1 ((Usart*)0x40028000U) /**< \brief (USART1 ) Base Address */
#define PDC_USART1 ((Pdc*)0x40028100U) /**< \brief (PDC_USART1) Base Address */
#define UDP ((Udp*)0x40034000U) /**< \brief (UDP ) Base Address */
#define ADC ((Adc*)0x40038000U) /**< \brief (ADC ) Base Address */
#define PDC_ADC ((Pdc*)0x40038100U) /**< \brief (PDC_ADC ) Base Address */
#define DACC ((Dacc*)0x4003C000U) /**< \brief (DACC ) Base Address */
#define PDC_DACC ((Pdc*)0x4003C100U) /**< \brief (PDC_DACC ) Base Address */
#define ACC ((Acc*)0x40040000U) /**< \brief (ACC ) Base Address */
#define CRCCU ((Crccu*)0x40044000U) /**< \brief (CRCCU ) Base Address */
#define SMC ((Smc*)0x400E0000U) /**< \brief (SMC ) Base Address */
#define MATRIX ((Matrix*)0x400E0200U) /**< \brief (MATRIX ) Base Address */
#define PMC ((Pmc*)0x400E0400U) /**< \brief (PMC ) Base Address */
#define UART0 ((Uart*)0x400E0600U) /**< \brief (UART0 ) Base Address */
#define PDC_UART0 ((Pdc*)0x400E0700U) /**< \brief (PDC_UART0 ) Base Address */
#define CHIPID ((Chipid*)0x400E0740U) /**< \brief (CHIPID ) Base Address */
#define UART1 ((Uart*)0x400E0800U) /**< \brief (UART1 ) Base Address */
#define PDC_UART1 ((Pdc*)0x400E0900U) /**< \brief (PDC_UART1 ) Base Address */
#define EFC ((Efc*)0x400E0A00U) /**< \brief (EFC ) Base Address */
#define PIOA ((Pio*)0x400E0E00U) /**< \brief (PIOA ) Base Address */
#define PDC_PIOA ((Pdc*)0x400E0F68U) /**< \brief (PDC_PIOA ) Base Address */
#define PIOB ((Pio*)0x400E1000U) /**< \brief (PIOB ) Base Address */
#define PIOC ((Pio*)0x400E1200U) /**< \brief (PIOC ) Base Address */
#define RSTC ((Rstc*)0x400E1400U) /**< \brief (RSTC ) Base Address */
#define SUPC ((Supc*)0x400E1410U) /**< \brief (SUPC ) Base Address */
#define RTT ((Rtt*)0x400E1430U) /**< \brief (RTT ) Base Address */
#define WDT ((Wdt*)0x400E1450U) /**< \brief (WDT ) Base Address */
#define RTC ((Rtc*)0x400E1460U) /**< \brief (RTC ) Base Address */
#define GPBR ((Gpbr*)0x400E1490U) /**< \brief (GPBR ) Base Address */
#endif /* __ASSEMBLY__ */
/*@}*/
/* ************************************************************************** */

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file
@@ -60,16 +35,16 @@
*/
/** Calculate the PCS field value given the chip select NPCS value */
#define SPI_PCS(npcs) ((~(1 << npcs) & 0xF) << 16)
#define SPI_PCS(npcs) ((~(1 << (npcs)) & 0xF) << 16)
/** Calculates the value of the CSR SCBR field given the baudrate and MCK. */
#define SPI_SCBR(baudrate, masterClock) ((uint32_t) (masterClock / baudrate) << 8)
#define SPI_SCBR(baudrate, masterClock) ((uint32_t) ((masterClock) / (baudrate)) << 8)
/** Calculates the value of the CSR DLYBS field given the desired delay (in ns) */
#define SPI_DLYBS(delay, masterClock) ((uint32_t) (((masterClock / 1000000) * delay) / 1000) << 16)
#define SPI_DLYBS(delay, masterClock) ((uint32_t) ((((masterClock) / 1000000) * (delay)) / 1000) << 16)
/** Calculates the value of the CSR DLYBCT field given the desired delay (in ns) */
#define SPI_DLYBCT(delay, masterClock) ((uint32_t) (((masterClock / 1000000) * delay) / 32000) << 24)
#define SPI_DLYBCT(delay, masterClock) ((uint32_t) ((((masterClock) / 1000000) * (delay)) / 32000) << 24)
/*------------------------------------------------------------------------------ */

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file
@@ -49,13 +24,13 @@
* Macros
*----------------------------------------------------------------------------*/
/* Returns 1 if the TXRDY bit (ready to transmit data) is set in the given status register value.*/
#define TWI_STATUS_TXRDY(status) ((status & TWI_SR_TXRDY) == TWI_SR_TXRDY)
#define TWI_STATUS_TXRDY(status) (((status) & TWI_SR_TXRDY) == TWI_SR_TXRDY)
/* Returns 1 if the RXRDY bit (ready to receive data) is set in the given status register value.*/
#define TWI_STATUS_RXRDY(status) ((status & TWI_SR_RXRDY) == TWI_SR_RXRDY)
#define TWI_STATUS_RXRDY(status) (((status) & TWI_SR_RXRDY) == TWI_SR_RXRDY)
/* Returns 1 if the TXCOMP bit (transfer complete) is set in the given status register value.*/
#define TWI_STATUS_TXCOMP(status) ((status & TWI_SR_TXCOMP) == TWI_SR_TXCOMP)
#define TWI_STATUS_TXCOMP(status) (((status) & TWI_SR_TXCOMP) == TWI_SR_TXCOMP)
#ifdef __cplusplus
extern "C" {

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file

View File

@@ -1,31 +1,6 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: 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
* 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.
* ----------------------------------------------------------------------------
*/
/*
%atmel_license%
*/
/**
* \file