1 /* 2 * Copyright (c) 2009-2018 Arm Limited. All rights reserved. 3 * Copyright (c) 2019 Nuclei Limited. All rights reserved. 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 * 7 * Licensed under the Apache License, Version 2.0 (the License); you may 8 * not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 /******************************************************************************* 20 * @file system_demosoc.h 21 * @brief NMSIS Nuclei N/NX Device Peripheral Access Layer Header File for 22 * Device <Device> 23 * @version V1.00 24 * @date 17. Dec 2019 25 ******************************************************************************/ 26 27 #ifndef __SYSTEM_DEMOSOC_H__ /* ToDo: replace '<Device>' with your device name */ 28 #define __SYSTEM_DEMOSOC_H__ 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 #include <stdint.h> 35 36 extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 37 38 /** 39 * \brief Setup the microcontroller system. 40 * \details 41 * Initialize the System and update the SystemCoreClock variable. 42 */ 43 extern void SystemInit(void); 44 45 /** 46 * \brief Update SystemCoreClock variable. 47 * \details 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 #ifdef __cplusplus 76 } 77 #endif 78 79 #endif /* __SYSTEM_DEMOSOC_H__ */ 80