1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include <common/bk_include.h> 18 #include <common/bk_compiler.h> 19 #include "bk_list.h" 20 #include <common/bk_generic.h> 21 #include "icu_map.h" 22 #include "arch_interrupt.h" 23 #include <common/bk_err.h> 24 25 typedef struct { 26 LIST_HEADER_T list; 27 int_group_isr_t isr_func; 28 uint8_t pri; // priority 29 uint8_t int_num; 30 uint16_t resv; 31 } isr_t; 32 33 typedef struct { 34 LIST_HEADER_T isr; 35 uint8_t max; // maximum interrupt number 36 uint8_t min; // minum interrupt number 37 } isr_list_t; 38 39 typedef struct { 40 icu_int_src_t src; 41 uint8_t int_bit; 42 uint8_t int_prio; 43 uint8_t group; 44 } icu_int_map_t; 45 46 47 void interrupt_init(void); 48 void interrupt_deinit(void); 49 void interrupt_spurious(void); 50 void group_isr(uint32_t group_id, uint32_t int_status); 51 52 53 54