1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

[sam] UART/USART write(char) working and cmsis update

This commit is contained in:
Thibaut VIARD
2011-09-16 23:07:44 +02:00
parent d1d60447e9
commit 04432caacd
52 changed files with 602 additions and 364 deletions

View File

@ -1,31 +1,16 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2010, Atmel Corporation
/*! \file *********************************************************************
*
* All rights reserved.
* \brief Startup file for SAM3S8/SAM3SD.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* This file defines common SAM series.
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Compiler: ARMGCC
* - Supported devices: All SAM3S8/SAM3SD devices can be used.
* - AppNote:
*
* 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.
* ----------------------------------------------------------------------------
*/
******************************************************************************/
/* $asf_license$ */
/*----------------------------------------------------------------------------
* Headers
@ -39,10 +24,10 @@
* Exported variables
*----------------------------------------------------------------------------*/
/* Stack Configuration */
/* Stack Configuration */
#define STACK_SIZE 0x900 /** Stack size (in DWords) */
__attribute__ ((aligned(8),section(".stack")))
uint32_t pdwStack[STACK_SIZE] ;
uint32_t pdwStack[STACK_SIZE] ;
/* Initialize segments */
extern uint32_t _sfixed;
@ -64,9 +49,9 @@ extern int main( void ) ;
void ResetException( void ) ;
extern void __libc_init_array( void ) ;
/*------------------------------------------------------------------------------
/*----------------------------------------------------------------------------
* Exception Table
*------------------------------------------------------------------------------*/
*----------------------------------------------------------------------------*/
__attribute__((section(".vectors")))
IntFunc exception_table[] = {
@ -159,7 +144,7 @@ void ResetException( void )
/* Set the vector table base address */
pSrc = (uint32_t *)&_sfixed;
SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ;
if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) )
{
SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ;

View File

@ -1,27 +1,27 @@
/*! \file *********************************************************************
*
* \brief Startup file for SAM3S.
* \brief Startup file for SAM3S8/SAM3SD.
*
* This file defines common SAM series.
*
* - Compiler: IAR EWARM
* - Supported devices: All SAM3S devices can be used.
* - Supported devices: All SAM3S8/SAM3SD devices can be used.
* - AppNote:
*
******************************************************************************/
// $asf_license$
/* $asf_license$ */
/*------------------------------------------------------------------------------
* Headers
*------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "exceptions.h"
#include "sam3s8.h"
#include "system_sam3sd8.h"
/*----------------------------------------------------------------------------
* Definitions
* Exported variables
*----------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
@ -114,7 +114,7 @@ extern int __low_level_init( void )
uint32_t* pSrc = __section_begin( ".intvec" ) ;
SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ;
if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) )
{
SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ;

View File

@ -134,7 +134,7 @@ extern void SystemCoreClockUpdate( void )
break;
}
}
if (PMC->PMC_MCKR & PMC_MCKR_CSS_Msk == PMC_MCKR_CSS_PLLA_CLK) {
if ((PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) == PMC_MCKR_CSS_PLLA_CLK) {
SystemCoreClock *= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_MULA_Pos) & 0x7FF) + 1);
SystemCoreClock /= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_DIVA_Pos) & 0x0FF));
}

View File

@ -5,7 +5,7 @@
*
* \par Purpose
*
* This file provides basic support for Cortex-M processor based
* This file provides basic support for Cortex-M processor based
* microcontrollers.
*
* \author Atmel Corporation: http://www.atmel.com \n
@ -28,19 +28,19 @@ extern "C" {
#include <stdint.h>
extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */
extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */
/**
* @brief Setup the microcontroller system.
* Initialize the System and update the SystemCoreClock variable.
*/
extern void SystemInit (void);
extern void SystemInit(void);
/**
* @brief Updates the SystemCoreClock with current core Clock
* @brief Updates the SystemCoreClock with current core Clock
* retrieved from cpu registers.
*/
extern void SystemCoreClockUpdate (void);
extern void SystemCoreClockUpdate(void);
/* @cond 0 */
/**INDENT-OFF**/