1 /* 2 * Copyright 2020 GreenWaves Technologies 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 * SPDX-License-Identifier: Apache-2.0 17 */ 18 #ifndef HAL_INCLUDE_HAL_FC_EVENT_H_ 19 #define HAL_INCLUDE_HAL_FC_EVENT_H_ 20 21 #include "core-v-mcu-pmsis.h" 22 #ifdef PKG_USING_FREERTOS_WRAPPER 23 #include <FreeRTOS.h> 24 #include <semphr.h> 25 #include <task.h> 26 #endif 27 /*! 28 * @addtogroup FC_EventHandler 29 * @{ 30 */ 31 32 /******************************************************************************* 33 * Variables, macros, structures,... definitions 34 ******************************************************************************/ 35 36 /******************************************************************************* 37 * APIs 38 ******************************************************************************/ 39 40 #define NB_SOC_EVENTS ( SOC_EU_NB_FC_EVENTS ) 41 42 typedef void (*pi_fc_event_handler_t)(void* arg); 43 44 void pi_fc_event_handler_init(uint32_t fc_event_irq); 45 46 /*! 47 * @brief FC event handler. 48 * 49 * This function pops an event and executes the handler corresponding to the event. 50 */ 51 void fc_soc_event_handler(void); 52 #ifdef PKG_USING_FREERTOS_WRAPPER 53 void pi_fc_event_handler_set(uint32_t event_id, pi_fc_event_handler_t event_handler, SemaphoreHandle_t semaphoreHandle);//This function based on freertos 54 #endif 55 void user_pi_fc_event_handler_set(uint32_t event_id,pi_fc_event_handler_t event_handler); 56 57 void pi_fc_event_handler_clear(uint32_t event_id); 58 59 void clear_fc_event_handler(uint32_t event_id); 60 61 #if defined(__cplusplus) 62 } 63 #endif /* __cplusplus */ 64 65 /* @} */ 66 67 68 #endif /* HAL_INCLUDE_HAL_FC_EVENT_H_ */ 69