81 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			81 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | /****************************************************************************
 | ||
|  | 
 | ||
|  | Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED. | ||
|  | 
 | ||
|  | This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT | ||
|  | be copied by any method or incorporated into another program without | ||
|  | the express written consent of Aerospace C.Power. This Information or any portion | ||
|  | thereof remains the property of Aerospace C.Power. The Information contained herein | ||
|  | is believed to be accurate and Aerospace C.Power assumes no responsibility or | ||
|  | liability for its use in any way and conveys no license or title under | ||
|  | any patent or copyright and makes no representation or warranty that this | ||
|  | Information is free from patent or copyright infringement. | ||
|  | 
 | ||
|  | ****************************************************************************/ | ||
|  | #ifndef _IRQ_H
 | ||
|  | #define _IRQ_H
 | ||
|  | 
 | ||
|  | #include "os_types.h"
 | ||
|  | #include "iot_config.h"
 | ||
|  | #if HW_PLATFORM > HW_PLATFORM_SIMU
 | ||
|  | #include "irq_hw.h"
 | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | extern "C" { | ||
|  | #endif
 | ||
|  | 
 | ||
|  | /*
 | ||
|  | * interrupt priority | ||
|  | */ | ||
|  | 
 | ||
|  | typedef enum { | ||
|  |     HAL_INTR_PRI_0  = 0, | ||
|  |     HAL_INTR_PRI_1, | ||
|  |     HAL_INTR_PRI_2, | ||
|  |     HAL_INTR_PRI_3, | ||
|  |     HAL_INTR_PRI_4, | ||
|  |     HAL_INTR_PRI_5, | ||
|  |     HAL_INTR_PRI_6, | ||
|  |     HAL_INTR_PRI_7, | ||
|  | 
 | ||
|  |     HAL_INTR_PRI_MAX | ||
|  | }IOT_INTR_PRIORITY; | ||
|  | 
 | ||
|  | /*
 | ||
|  |  * interrupt's cpu core | ||
|  | */ | ||
|  | typedef enum{ | ||
|  |     HAL_INTR_CPU_0 = 0, | ||
|  |     HAL_INTR_CPU_1, | ||
|  |     HAL_INTR_CPU_2, | ||
|  | 
 | ||
|  |     HAL_INTR_CPU_MAX | ||
|  | }IOT_INTR_CPU; | ||
|  | 
 | ||
|  | typedef iot_addrword_t iot_irq_t; | ||
|  | 
 | ||
|  | /*
 | ||
|  | * interrupt service routine prototype. | ||
|  | */ | ||
|  | typedef uint32_t iot_isr_t( uint32_t vector, iot_addrword_t data); | ||
|  | 
 | ||
|  | typedef struct iot_interrupt | ||
|  | { | ||
|  |     uint8_t         vector; | ||
|  |     uint8_t         priority; | ||
|  |     uint8_t         cpu; | ||
|  |     uint8_t         rsvd; | ||
|  |     iot_isr_t       *isr; | ||
|  |     iot_addrword_t  data; | ||
|  | } iot_interrupt; | ||
|  | 
 | ||
|  | void hal_deliver_interrupt( uint32_t vector ); | ||
|  | 
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | } | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #endif //_IRQ_H
 |