Mouse code for the MacroRat
mbed-dev/targets/TARGET_NUVOTON/TARGET_M451/device/system_M451Series.h@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 2 | * @file system_M451Series.h |
sahilmgandhi | 18:6a4db94011d3 | 3 | * @version V0.10 |
sahilmgandhi | 18:6a4db94011d3 | 4 | * $Revision: 7 $ |
sahilmgandhi | 18:6a4db94011d3 | 5 | * $Date: 15/09/02 10:02a $ |
sahilmgandhi | 18:6a4db94011d3 | 6 | * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File for M451 Series MCU |
sahilmgandhi | 18:6a4db94011d3 | 7 | * |
sahilmgandhi | 18:6a4db94011d3 | 8 | * @note |
sahilmgandhi | 18:6a4db94011d3 | 9 | * Copyright (C) 2013~2015 Nuvoton Technology Corp. All rights reserved. |
sahilmgandhi | 18:6a4db94011d3 | 10 | *****************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 11 | |
sahilmgandhi | 18:6a4db94011d3 | 12 | #ifndef __SYSTEM_M451SERIES_H__ |
sahilmgandhi | 18:6a4db94011d3 | 13 | #define __SYSTEM_M451SERIES_H__ |
sahilmgandhi | 18:6a4db94011d3 | 14 | |
sahilmgandhi | 18:6a4db94011d3 | 15 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 16 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 17 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 18 | |
sahilmgandhi | 18:6a4db94011d3 | 19 | #include <stdint.h> |
sahilmgandhi | 18:6a4db94011d3 | 20 | |
sahilmgandhi | 18:6a4db94011d3 | 21 | /*---------------------------------------------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 22 | /* Macro Definition */ |
sahilmgandhi | 18:6a4db94011d3 | 23 | /*---------------------------------------------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 24 | #ifndef DEBUG_PORT |
sahilmgandhi | 18:6a4db94011d3 | 25 | # define DEBUG_PORT UART0 /*!< Select Debug Port which is used for retarget.c to output debug message to UART */ |
sahilmgandhi | 18:6a4db94011d3 | 26 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 27 | |
sahilmgandhi | 18:6a4db94011d3 | 28 | |
sahilmgandhi | 18:6a4db94011d3 | 29 | /*---------------------------------------------------------------------------- |
sahilmgandhi | 18:6a4db94011d3 | 30 | Define clocks |
sahilmgandhi | 18:6a4db94011d3 | 31 | *----------------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 32 | |
sahilmgandhi | 18:6a4db94011d3 | 33 | #define __HSI (12000000UL) /*!< PLL default output is 72MHz */ |
sahilmgandhi | 18:6a4db94011d3 | 34 | #define __HXT (12000000UL) /*!< External Crystal Clock Frequency */ |
sahilmgandhi | 18:6a4db94011d3 | 35 | #define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ |
sahilmgandhi | 18:6a4db94011d3 | 36 | #define __HIRC (22118400UL) /*!< Internal 22M RC Oscillator Frequency */ |
sahilmgandhi | 18:6a4db94011d3 | 37 | #define __LIRC (10000UL) /*!< Internal 10K RC Oscillator Frequency */ |
sahilmgandhi | 18:6a4db94011d3 | 38 | #define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */ |
sahilmgandhi | 18:6a4db94011d3 | 39 | |
sahilmgandhi | 18:6a4db94011d3 | 40 | |
sahilmgandhi | 18:6a4db94011d3 | 41 | #define __SYSTEM_CLOCK (1*__HXT) |
sahilmgandhi | 18:6a4db94011d3 | 42 | |
sahilmgandhi | 18:6a4db94011d3 | 43 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ |
sahilmgandhi | 18:6a4db94011d3 | 44 | extern uint32_t CyclesPerUs; /*!< Cycles per micro second */ |
sahilmgandhi | 18:6a4db94011d3 | 45 | extern uint32_t PllClock; /*!< PLL Output Clock Frequency */ |
sahilmgandhi | 18:6a4db94011d3 | 46 | |
sahilmgandhi | 18:6a4db94011d3 | 47 | |
sahilmgandhi | 18:6a4db94011d3 | 48 | /** |
sahilmgandhi | 18:6a4db94011d3 | 49 | * Initialize the system |
sahilmgandhi | 18:6a4db94011d3 | 50 | * |
sahilmgandhi | 18:6a4db94011d3 | 51 | * @param None |
sahilmgandhi | 18:6a4db94011d3 | 52 | * @return None |
sahilmgandhi | 18:6a4db94011d3 | 53 | * |
sahilmgandhi | 18:6a4db94011d3 | 54 | * @brief Setup the microcontroller system. |
sahilmgandhi | 18:6a4db94011d3 | 55 | * Initialize the System and update the SystemCoreClock variable. |
sahilmgandhi | 18:6a4db94011d3 | 56 | */ |
sahilmgandhi | 18:6a4db94011d3 | 57 | extern void SystemInit(void); |
sahilmgandhi | 18:6a4db94011d3 | 58 | |
sahilmgandhi | 18:6a4db94011d3 | 59 | /** |
sahilmgandhi | 18:6a4db94011d3 | 60 | * Update SystemCoreClock variable |
sahilmgandhi | 18:6a4db94011d3 | 61 | * |
sahilmgandhi | 18:6a4db94011d3 | 62 | * @param None |
sahilmgandhi | 18:6a4db94011d3 | 63 | * @return None |
sahilmgandhi | 18:6a4db94011d3 | 64 | * |
sahilmgandhi | 18:6a4db94011d3 | 65 | * @brief Updates the SystemCoreClock with current core Clock |
sahilmgandhi | 18:6a4db94011d3 | 66 | * retrieved from cpu registers. |
sahilmgandhi | 18:6a4db94011d3 | 67 | */ |
sahilmgandhi | 18:6a4db94011d3 | 68 | extern void SystemCoreClockUpdate(void); |
sahilmgandhi | 18:6a4db94011d3 | 69 | |
sahilmgandhi | 18:6a4db94011d3 | 70 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 71 | } |
sahilmgandhi | 18:6a4db94011d3 | 72 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 73 | |
sahilmgandhi | 18:6a4db94011d3 | 74 | #endif /* __SYSTEM_M451SERIES_H__ */ |
sahilmgandhi | 18:6a4db94011d3 | 75 | /*** (C) COPYRIGHT 2013~2015 Nuvoton Technology Corp. ***/ |