/**************************************************************************//**
 * @file     system_N572F065.h
 * @brief    CMSIS Cortex-M0 Device System Header File
 *           for CM0 Device Series
 * @version  V1.03
 * @date     22. July 2014
 *
 * @note
 * Copyright (C) 2010 ARM Limited. All rights reserved.
 *
 * @par
 * ARM Limited (ARM) is supplying this software for use with Cortex-M 
 * processor based microcontrollers.  This file can be freely distributed 
 * within development tools that are supporting such ARM based processors. 
 *
 * @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.
 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 *
 ******************************************************************************/


#ifndef __SYSTEM_N572F065_H__
#define __SYSTEM_N572F065_H__

#ifdef __cplusplus
extern "C" {
#endif


/*----------------------------------------------------------------------------
  Define system clocks sources
 *----------------------------------------------------------------------------*/
#define __XTL_32K     (32768UL)     /*!< External Crystal Clock Frequency 32.768kHz */
#define __XTL_12M_6M (0UL)     /*!< External Crystal Clock Frequency 12M or 6M */
#define __PLL1_FOUT   (6000000UL)   /*!< First PLL output, from 32KHz crystal */
//#define __PLL2_FOUT   (0UL)         /*!< Second PLL output, from 12M/6M Crystal or PLL1, max 48MHz */
#define __RC_24M      (24000000UL)  /*!< Internal 24MHz RC Oscillator Frequency */
#define __HSI         (__RC_24M)      /* Factory Default is internal 24MHz */

extern uint32_t SystemCoreClock;     /*!< System Clock Frequency (Core Clock)  */
extern uint32_t CyclesPerUs;         /*!< Cycles per micro second              */
extern uint32_t gau32HiRCSrcTbl[];   /*!< HIRC(OSC48)Frequency Selection Table */

/**
 * Initialize the system
 *
 * @param  none
 * @return none
 *
 * @brief  Setup the microcontroller system.
 *         Initialize the System and update the SystemCoreClock variable.
 */
extern void SystemInit (void);

/**
 * Update SystemCoreClock variable
 *
 * @param  none
 * @return none
 *
 * @brief  Updates the SystemCoreClock with current core Clock 
 *         retrieved from cpu registers.
 */
extern void SystemCoreClockUpdate (void);

#ifdef __cplusplus
}
#endif

#endif /* __SYSTEM_N572F065_H__ */
