1 /* 2 * Copyright (c) 2009-2018 Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Licensed under the Apache License, Version 2.0 (the License); you may 7 * not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 /******************************************************************************* 19 * @file system_gd32vf103.h 20 * @brief NMSIS Nuclei N/NX Device Peripheral Access Layer Header File for 21 * Device gd32vf103 22 * @version V1.00 23 * @date 7. Jan 2020 24 ******************************************************************************/ 25 26 #ifndef __SYSTEM_GD32VF103_H__ 27 #define __SYSTEM_GD32VF103_H__ 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 #include <stdint.h> 34 35 extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 36 37 /** 38 \brief Setup the microcontroller system. 39 40 Initialize the System and update the SystemCoreClock variable. 41 */ 42 extern void SystemInit (void); 43 44 45 /** 46 \brief Update SystemCoreClock variable. 47 48 Updates the SystemCoreClock with current core Clock retrieved from cpu registers. 49 */ 50 extern void SystemCoreClockUpdate (void); 51 52 /** 53 * \brief Register an exception handler for exception code EXCn 54 */ 55 extern void Exception_Register_EXC(uint32_t EXCn, unsigned long exc_handler); 56 57 /** 58 * \brief Get current exception handler for exception code EXCn 59 */ 60 extern unsigned long Exception_Get_EXC(uint32_t EXCn); 61 62 /** 63 * \brief Initialize eclic config 64 */ 65 extern void ECLIC_Init(void); 66 67 /** 68 * \brief Initialize a specific IRQ and register the handler 69 * \details 70 * This function set vector mode, trigger mode and polarity, interrupt level and priority, 71 * assign handler for specific IRQn. 72 */ 73 extern int32_t ECLIC_Register_IRQ(IRQn_Type IRQn, uint8_t shv, ECLIC_TRIGGER_Type trig_mode, uint8_t lvl, uint8_t priority, void *handler); 74 75 76 #ifdef __cplusplus 77 } 78 #endif 79 80 #endif /* __SYSTEM_GD32VF103_H__ */ 81