From fca1f9e183b3eea0c78786491f1018851cedbd4e Mon Sep 17 00:00:00 2001 From: richardbarry Date: Tue, 10 Sep 2013 12:24:55 +0000 Subject: [PATCH] Finalise XMC1000 IAR demos. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2033 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../IAR_Specific/XMC1100.h | 4243 ++++++++++ .../{ => IAR_Specific}/XMC1200.h | 0 .../IAR_Specific/XMC1300.h | 6849 +++++++++++++++++ .../IAR_Specific/startup_XMC1100.s | 333 + .../IAR_Specific/startup_XMC1200.s | 8 +- .../IAR_Specific/startup_XMC1300.s | 390 + .../IAR_Specific/system_XMC1100.c | 130 + .../IAR_Specific/system_XMC1100.h | 55 + .../{ => IAR_Specific}/system_XMC1200.c | 26 +- .../{ => IAR_Specific}/system_XMC1200.h | 0 .../IAR_Specific/system_XMC1300.c | 130 + .../IAR_Specific/system_XMC1300.h | 54 + .../ParTest_XMC1100.c | 2 +- .../ParTest_XMC1300.c | 2 +- .../RTOSDemo.ewd | 1297 ++++ .../RTOSDemo.ewp | 994 ++- .../RTOSDemo.uvopt | 78 +- .../RTOSDemo.uvproj | 62 +- .../main.c | 2 +- .../settings/RTOSDemo.dni | 2 +- .../settings/RTOSDemo.wsdt | 6 +- 21 files changed, 14564 insertions(+), 99 deletions(-) create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/XMC1100.h rename FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/{ => IAR_Specific}/XMC1200.h (100%) create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/XMC1300.h create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/startup_XMC1100.s create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/startup_XMC1300.s create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1100.c create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1100.h rename FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/{ => IAR_Specific}/system_XMC1200.c (91%) rename FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/{ => IAR_Specific}/system_XMC1200.h (100%) create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.c create mode 100644 FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.h diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/XMC1100.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/XMC1100.h new file mode 100644 index 000000000..64bf7cc27 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/XMC1100.h @@ -0,0 +1,4243 @@ + +/****************************************************************************************************//** + * @file XMC1100.h + * + * @brief CMSIS Cortex-M0 Peripheral Access Layer Header File for + * XMC1100 from Infineon. + * + * @version V1.0.6 (Reference Manual v1.0) + * @date 26. March 2013 + * + * @note Generated with SVDConv V2.78b + * from CMSIS SVD File 'XMC1100_Processed_SVD.xml' Version 1.0.6 (Reference Manual v1.0), + *******************************************************************************************************/ + + + +/** @addtogroup Infineon + * @{ + */ + +/** @addtogroup XMC1100 + * @{ + */ + +#ifndef XMC1100_H +#define XMC1100_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* ------------------------- Interrupt Number Definition ------------------------ */ + +typedef enum { +/* ------------------- Cortex-M0 Processor Exceptions Numbers ------------------- */ + Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */ + NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */ + HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */ + SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */ + DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */ + PendSV_IRQn = -2, /*!< 14 Pendable request for system service */ + SysTick_IRQn = -1, /*!< 15 System Tick Timer */ +/* --------------------- XMC1100 Specific Interrupt Numbers --------------------- */ + SCU_0_IRQn = 0, /*!< SCU SR0 Interrupt */ + SCU_1_IRQn = 1, /*!< SCU SR1 Interrupt */ + SCU_2_IRQn = 2, /*!< SCU SR2 Interrupt */ + ERU0_0_IRQn = 3, /*!< ERU0 SR0 Interrupt */ + ERU0_1_IRQn = 4, /*!< ERU0 SR1 Interrupt */ + ERU0_2_IRQn = 5, /*!< ERU0 SR2 Interrupt */ + ERU0_3_IRQn = 6, /*!< ERU0 SR3 Interrupt */ + + USIC0_0_IRQn = 9, /*!< USIC SR0 Interrupt */ + USIC0_1_IRQn = 10, /*!< USIC SR1 Interrupt */ + USIC0_2_IRQn = 11, /*!< USIC SR2 Interrupt */ + USIC0_3_IRQn = 12, /*!< USIC SR3 Interrupt */ + USIC0_4_IRQn = 13, /*!< USIC SR4 Interrupt */ + USIC0_5_IRQn = 14, /*!< USIC SR5 Interrupt */ + + VADC0_C0_0_IRQn = 15, /*!< VADC SR0 Interrupt */ + VADC0_C0_1_IRQn = 16, /*!< VADC SR1 Interrupt */ + + CCU40_0_IRQn = 21, /*!< CCU40 SR0 Interrupt */ + CCU40_1_IRQn = 22, /*!< CCU40 SR1 Interrupt */ + CCU40_2_IRQn = 23, /*!< CCU40 SR2 Interrupt */ + CCU40_3_IRQn = 24, /*!< CCU40 SR3 Interrupt */ + +} IRQn_Type; + + +/** @addtogroup Configuration_of_CMSIS + * @{ + */ + + +/* ================================================================================ */ +/* ================ Processor and Core Peripheral Section ================ */ +/* ================================================================================ */ + +/* ----------------Configuration of the Cortex-M0 Processor and Core Peripherals---------------- */ +#define __CM0_REV 0x0000 /*!< Cortex-M0 Core Revision */ +#define __MPU_PRESENT 0 /*!< MPU present or not */ +#define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */ +#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ +/** @} */ /* End of group Configuration_of_CMSIS */ + +#include /*!< Cortex-M0 processor and core peripherals */ +#include "system_XMC1100.h" /*!< XMC1100 System */ + + +/* ================================================================================ */ +/* ================ Device Specific Peripheral Section ================ */ +/* ================================================================================ */ +/* Macro to modify desired bitfields of a register */ +#define WR_REG(reg, mask, pos, val) reg = (((uint32_t)val << pos) & \ + ((uint32_t)mask)) | \ + (reg & ((uint32_t)~((uint32_t)mask))) + +/* Macro to modify desired bitfields of a register */ +#define WR_REG_SIZE(reg, mask, pos, val, size) { \ +uint##size##_t VAL1 = (uint##size##_t)((uint##size##_t)val << pos); \ +uint##size##_t VAL2 = (uint##size##_t) (VAL1 & (uint##size##_t)mask); \ +uint##size##_t VAL3 = (uint##size##_t)~((uint##size##_t)mask); \ +uint##size##_t VAL4 = (uint##size##_t) ((uint##size##_t)reg & VAL3); \ +reg = (uint##size##_t) (VAL2 | VAL4);\ +} + +/** Macro to read bitfields from a register */ +#define RD_REG(reg, mask, pos) (((uint32_t)reg & (uint32_t)mask) >> pos) + +/** Macro to read bitfields from a register */ +#define RD_REG_SIZE(reg, mask, pos,size) ((uint##size##_t)(((uint32_t)reg & \ + (uint32_t)mask) >> pos) ) + +/** Macro to set a bit in register */ +#define SET_BIT(reg, pos) (reg |= ((uint32_t)1< /*!< Cortex-M0 processor and core peripherals */ +#include "system_XMC1300.h" /*!< XMC1300 System */ + + +/* ================================================================================ */ +/* ================ Device Specific Peripheral Section ================ */ +/* ================================================================================ */ +/* Macro to modify desired bitfields of a register */ +#define WR_REG(reg, mask, pos, val) reg = (((uint32_t)val << pos) & \ + ((uint32_t)mask)) | \ + (reg & ((uint32_t)~((uint32_t)mask))) + +/* Macro to modify desired bitfields of a register */ +#define WR_REG_SIZE(reg, mask, pos, val, size) { \ +uint##size##_t VAL1 = (uint##size##_t)((uint##size##_t)val << pos); \ +uint##size##_t VAL2 = (uint##size##_t) (VAL1 & (uint##size##_t)mask); \ +uint##size##_t VAL3 = (uint##size##_t)~((uint##size##_t)mask); \ +uint##size##_t VAL4 = (uint##size##_t) ((uint##size##_t)reg & VAL3); \ +reg = (uint##size##_t) (VAL2 | VAL4);\ +} + +/** Macro to read bitfields from a register */ +#define RD_REG(reg, mask, pos) (((uint32_t)reg & (uint32_t)mask) >> pos) + +/** Macro to read bitfields from a register */ +#define RD_REG_SIZE(reg, mask, pos,size) ((uint##size##_t)(((uint32_t)reg & \ + (uint32_t)mask) >> pos) ) + +/** Macro to set a bit in register */ +#define SET_BIT(reg, pos) (reg |= ((uint32_t)1< SCU_CLK + */ + +#include "system_XMC1100.h" +#include + +/*--------------------------------------------------------------------------- + Extern definitions + *--------------------------------------------------------------------------*/ +extern uint32_t AllowClkInitByStartup(void); + +/*---------------------------------------------------------------------------- + Clock Global defines + *----------------------------------------------------------------------------*/ +#define DCO_DCLK 64000000UL +#define DCO_DCLK_MULTIPLIER 16384000UL +#define DCO_DCLK_DIVIDER 9UL +#define MCLK_MHZ 32000000UL +#define KHZ_MULTIPLIER 1000UL +#define FRACBITS 8UL +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +/*!< System Clock Frequency (Core Clock) (MCLK on TIMM1) */ +uint32_t SystemCoreClock; + +/*---------------------------------------------------------------------------- + Fixed point math definitions + *----------------------------------------------------------------------------*/ +typedef int32_t Q_24_8; +typedef int32_t Q_15_0; + +/** + * @brief Setup the microcontroller system. + * @param None + * @retval None + */ +void SystemInit(void) +{ + + /* + * Clock tree setup by CMSIS routines is allowed only in the absence of DAVE + * Clock app. + */ + if(AllowClkInitByStartup()){ + /* Do not change default values of IDIV,FDIV and RTCCLKSEL */ + /* ====== Default configuration ======= */ + /* + * MCLK = DCO_DCLK + * PCLK = MCLK + * RTC CLK = Standby clock + */ + } +} + +/** + * @brief Update SystemCoreClock according to Clock Register Values + * @note - + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t IDIV, FDIV, CLKCR, Clock; + + CLKCR = SCU_CLK -> CLKCR; + IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos; + FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos; + + if(IDIV) + { + /* Divider is enabled and used */ + if(0 == FDIV) + { + /* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */ + Clock = MCLK_MHZ / IDIV; + } + else + { + /* Both integer and fractional divider must be considered */ + /* 1. IDIV + FDIV/256 */ + Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV; + + /* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */ + Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum; + Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER; + Clock = Clock >> DCO_DCLK_DIVIDER; + } + } + else + { + /* Divider bypassed. Simply divide DCO_DCLK by 2 */ + Clock = MCLK_MHZ; + } + + /* Finally with the math class over, update SystemCoreClock */ + SystemCoreClock = Clock; +} + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1100.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1100.h new file mode 100644 index 000000000..1759990c6 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1100.h @@ -0,0 +1,55 @@ +/****************************************************************************** + * @file system_XMC1100.h + * @brief Device specific initialization for the XMC1100-Series according + * to CMSIS + * @version V1.1 + * @date 13 Dec 2012 + * + * @note + * Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with + * InfineonÂ’s microcontrollers. + * + * This file can be freely distributed within development tools that are + * supporting such microcontrollers. + * + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, + * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ +/* + * *************************** Change history ******************************** + * V1.1, 13 Dec 2012, PKB : Created change history table, extern reference + */ +#include + +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +extern uint32_t SystemCoreClock; + +/** + * @brief Setup the microcontroller system. + * Initialize the PLL and update the + * SystemCoreClock variable. + * @param None + * @retval None + */ +void SystemInit(void); + +/** + * @brief Update SystemCoreClock according to Clock Register Values + * @note - + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void); + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/system_XMC1200.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1200.c similarity index 91% rename from FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/system_XMC1200.c rename to FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1200.c index 05934bb6f..9d559e7e9 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/system_XMC1200.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1200.c @@ -1,6 +1,6 @@ /****************************************************************************** * @file system_XMC1200.c - * @brief Device specific initialization for the XMC1200-Series according + * @brief Device specific initialization for the XMC1200-Series according * to CMSIS * @version V1.4 * @date 01 Feb 2013 @@ -10,12 +10,12 @@ * * @par - * Infineon Technologies AG (Infineon) is supplying this software for use with + * Infineon Technologies AG (Infineon) is supplying this software for use with * InfineonÂ’s microcontrollers. - * - * This file can be freely distributed within development tools that are + * + * This file can be freely distributed within development tools that are * supporting such microcontrollers. - * + * * * @par * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED @@ -36,7 +36,7 @@ #include /*--------------------------------------------------------------------------- - Extern definitions + Extern definitions *--------------------------------------------------------------------------*/ extern uint32_t AllowClkInitByStartup(void); @@ -67,13 +67,13 @@ typedef int32_t Q_15_0; * @retval None */ void SystemInit(void) -{ +{ /* * Clock tree setup by CMSIS routines is allowed only in the absence of DAVE * Clock app. - */ - if(AllowClkInitByStartup()){ + */ + if(AllowClkInitByStartup()){ /* Do not change default values of IDIV,FDIV and RTCCLKSEL */ /* ====== Default configuration ======= */ /* @@ -86,7 +86,7 @@ void SystemInit(void) /** * @brief Update SystemCoreClock according to Clock Register Values - * @note - + * @note - * @param None * @retval None */ @@ -97,7 +97,7 @@ void SystemCoreClockUpdate(void) CLKCR = SCU_CLK -> CLKCR; IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos; FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos; - + if(IDIV) { /* Divider is enabled and used */ @@ -110,7 +110,7 @@ void SystemCoreClockUpdate(void) { /* Both integer and fractional divider must be considered */ /* 1. IDIV + FDIV/256 */ - Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV; + Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV; /* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */ Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum; @@ -125,6 +125,6 @@ void SystemCoreClockUpdate(void) } /* Finally with the math class over, update SystemCoreClock */ - SystemCoreClock = Clock; + SystemCoreClock = Clock; } diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/system_XMC1200.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1200.h similarity index 100% rename from FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/system_XMC1200.h rename to FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1200.h diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.c new file mode 100644 index 000000000..44d0adc21 --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.c @@ -0,0 +1,130 @@ +/****************************************************************************** + * @file system_XMC1300.c + * @brief Device specific initialization for the XMC1300-Series according + * to CMSIS + * @version V1.4 + * @date 01 Feb 2013 + * + * @note + * Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with + * InfineonÂ’s microcontrollers. + * + * This file can be freely distributed within development tools that are + * supporting such microcontrollers. + * + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, + * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ +/* + * *************************** Change history ******************************** + * V1.2, 13 Dec 2012, PKB : Created change history table + * V1.3, 20 Dec 2012, PKB : Fixed SystemCoreClock computation + * V1.4, 02 Feb 2013, PKB : SCU_CLOCK -> SCU_CLK + */ + +#include "system_XMC1300.h" +#include + +/*--------------------------------------------------------------------------- + Extern definitions + *--------------------------------------------------------------------------*/ +extern uint32_t AllowClkInitByStartup(void); + +/*---------------------------------------------------------------------------- + Clock Global defines + *----------------------------------------------------------------------------*/ +#define DCO_DCLK 64000000UL +#define DCO_DCLK_MULTIPLIER 16384000UL +#define DCO_DCLK_DIVIDER 9UL +#define MCLK_MHZ 32000000UL +#define KHZ_MULTIPLIER 1000UL +#define FRACBITS 8UL +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +/*!< System Clock Frequency (Core Clock) (MCLK on TIMM1) */ +uint32_t SystemCoreClock; + +/*---------------------------------------------------------------------------- + Fixed point math definitions + *----------------------------------------------------------------------------*/ +typedef int32_t Q_24_8; +typedef int32_t Q_15_0; + +/** + * @brief Setup the microcontroller system. + * @param None + * @retval None + */ +void SystemInit(void) +{ + + /* + * Clock tree setup by CMSIS routines is allowed only in the absence of DAVE + * Clock app. + */ + if(AllowClkInitByStartup()){ + /* Do not change default values of IDIV,FDIV and RTCCLKSEL */ + /* ====== Default configuration ======= */ + /* + * MCLK = DCO_DCLK + * PCLK = MCLK + * RTC CLK = Standby clock + */ + } +} + +/** + * @brief Update SystemCoreClock according to Clock Register Values + * @note - + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t IDIV, FDIV, CLKCR, Clock; + + CLKCR = SCU_CLK -> CLKCR; + IDIV = (CLKCR & SCU_CLK_CLKCR_IDIV_Msk) >> SCU_CLK_CLKCR_IDIV_Pos; + FDIV = (CLKCR & SCU_CLK_CLKCR_FDIV_Msk) >> SCU_CLK_CLKCR_FDIV_Pos; + + if(IDIV) + { + /* Divider is enabled and used */ + if(0 == FDIV) + { + /* No fractional divider, so MCLK = DCO_Clk / (2 * IDIV) */ + Clock = MCLK_MHZ / IDIV; + } + else + { + /* Both integer and fractional divider must be considered */ + /* 1. IDIV + FDIV/256 */ + Q_24_8 FDiv_IDiv_Sum = (IDIV << FRACBITS) + FDIV; + + /* 2. Fixed point division Q24.8 / Q9.8 = Q15.0 */ + Q_15_0 ClockVal = (DCO_DCLK_MULTIPLIER << FRACBITS)/ FDiv_IDiv_Sum; + Clock = ((uint32_t)ClockVal) * KHZ_MULTIPLIER; + Clock = Clock >> DCO_DCLK_DIVIDER; + } + } + else + { + /* Divider bypassed. Simply divide DCO_DCLK by 2 */ + Clock = MCLK_MHZ; + } + + /* Finally with the math class over, update SystemCoreClock */ + SystemCoreClock = Clock; +} + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.h new file mode 100644 index 000000000..bead2ab3b --- /dev/null +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/system_XMC1300.h @@ -0,0 +1,54 @@ +/****************************************************************************** + * @file system_XMC1300.h + * @brief Device specific initialization for the XMC1300-Series according + * to CMSIS + * @version V1.1 + * @date 13 Dec 2012 + * + * @note + * Copyright (C) 2012-2013 Infineon Technologies AG. All rights reserved. + + * + * @par + * Infineon Technologies AG (Infineon) is supplying this software for use with + * InfineonÂ’s microcontrollers. + * + * This file can be freely distributed within development tools that are + * supporting such microcontrollers. + * + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, + * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ +/* + * *************************** Change history ********************************* + * V1.1, 13 Dec 2012, PKB, Created this table, added extern and stdint + */ +#include + +/*---------------------------------------------------------------------------- + Clock Variable definitions + *----------------------------------------------------------------------------*/ +extern uint32_t SystemCoreClock; +/** + * @brief Setup the microcontroller system. + * Initialize the PLL and update the + * SystemCoreClock variable. + * @param None + * @retval None + */ +void SystemInit(void); + +/** + * @brief Update SystemCoreClock according to Clock Register Values + * @note - + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void); + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1100.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1100.c index 2c0bda627..c749e6c2a 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1100.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1100.c @@ -71,7 +71,7 @@ #include "task.h" /* Hardware includes. */ -#include +#include /* Standard demo include. */ #include "partest.h" diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c index 7d64bfbb8..7e71d6ab4 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/ParTest_XMC1300.c @@ -71,7 +71,7 @@ #include "task.h" /* Hardware includes. */ -#include +#include /* Standard demo include. */ #include "partest.h" diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd index 6174b9139..928e2735a 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd @@ -2596,6 +2596,1303 @@ + + XMC1300 Boot Kit + + ARM + + 1 + + C-SPY + 2 + + 25 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp index dec3677b0..267716ef7 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp @@ -299,6 +299,7 @@ CCIncludePath2 $PROJ_DIR$\. $PROJ_DIR$\CMSIS + $PROJ_DIR$\IAR_Specific $PROJ_DIR$\..\common\include $PROJ_DIR$\..\..\source\include $PROJ_DIR$\..\..\source\portable\IAR\ARM_CM0 @@ -1165,7 +1166,944 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + XMC1300 Boot Kit + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 29 + 1 + 1 + + + + + + + + + + + + + + + +