⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lh7a400_int_driver.h

📁 sharp触摸屏测试代码
💻 H
字号:
/**********************************************************************
 *	$Workfile:   LH7A400_int_driver.h  $
 *	$Revision:   1.7  $
 *	$Author:   MaysR  $
 *	$Date:   Jun 13 2002 11:17:32  $
 *
 *	Project: LH7A400 
 *
 *	Description:
 *     This file contains driver support for the LH7A400
 *     interrupt driver. This module contains the following
 *     user functions:
 *     int_init_irq_handler()--init basic interrupt driver
 *     int_install_irq_handler()--install a handler with a priority
 *                                for a particular IRQ source
 *     int_install_fiq_handler()--install a handler with a priority
 *                                for a particular FIQ source
 *     int_enable_interrupt()--enable an interrupt source
 *     int_disable_interrupt()--disable an interrupt source
 *     int_enabled()--return true if a source is enabled
 *     int_pending()--return true if a source is pending
 *     int_priority()--return the priority assigned to the source
 *     int_handler()--return a pointer to the hander for the source
 *
 *     See int_driver.c for a functional description
 *	References:
 *     Internal documentation
 *
 *	Revision History:
 *	$Log:   //smaicnt2/pvcs/VM/CHIPS/archives/LH7A400/Interrupts/Drivers/LH7A400_int_driver.h-arc  $
 * 
 *    Rev 1.7   Jun 13 2002 11:17:32   MaysR
 * Changed all functions back to accept UNS_32 parameters,
 * and added range checking within each function.
 * 
 *    Rev 1.6   Jun 05 2002 19:55:44   MaysR
 * Changed function declarations to match C source file.
 * 
 *    Rev 1.5   10 Apr 2002 16:08:04   suryang
 * Added ARM_arch.h and changed CORE_IRQ and CORE_FIQ
 * to ARM_IRQ and ARM_FIQ.
 * 
 *    Rev 1.4   09 Apr 2002 11:54:12   suryang
 * Added initialized flag.
 * 
 *    Rev 1.3   Jan 04 2002 16:43:18   KovitzP
 * Added hooks to allow for installation of an external IRQ handler.
 * 
 *    Rev 1.2   Nov 20 2001 16:52:56   KovitzP
 * Used CORE_IRQ and CORE_FIQ in inline routines instead
 * of hard-coded numbers.
 * 
 *    Rev 1.1   Nov 15 2001 17:29:16   KovitzP
 * Added FIQ support. Changed default handler operation to properly handle uninstalled interrupts. Added functions to uninstall interrupts. Will not work with cache enabled; install handler routines do not drain D cache or invalidate I-cache.
 * 
 *    Rev 1.0   Nov 13 2001 17:43:14   SuryanG
 * Initial revision.
 * 
 *    Rev 1.0   Nov 12 2001 12:44:38   SuryanG
 * Initial revision.
 * 
 *	COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
 *		CAMAS, WA
 *********************************************************************/
#if !defined(LH7A400_INT_DRIVER_H)
#define LH7A400_INT_DRIVER_H

#include "ARM_arch.h"
#include "LH7A400_map.h"

#define INTC_N_IRQ_HANDLERS 24
#define INTC_N_FIQ_HANDLERS 4
#define INTC_N_SOURCES_TOTAL (INTC_N_IRQ_HANDLERS + INTC_N_FIQ_HANDLERS)
#define INTC_N_SOURCES_PER_STAGE 8
#define INTC_N_COMBINATIONS (_BIT(INTC_N_SOURCES_PER_STAGE) )
#define INTC_LOWEST_IRQ_PRIORITY (INTC_N_IRQ_HANDLERS - 1)
#define INTC_LOWEST_FIQ_PRIORITY (INTC_N_FIQ_HANDLERS - 1)

#if !defined(INTC_IRQ)
void LH7A400_IRQ_dispatcher(void);
void int_install_irq_dispatcher(__irq void (*fp)(void));
#endif

void int_init_irq_handler(INT_32 force_init);
INT_8 int_install_irq_handler(UNS_32 source, 
                               UNS_32 priority,
                               void (*hp)(void) );
INT_8 int_remove_irq_handler(UNS_32 priority);
void int_enable_interrupt(UNS_32 source);
void int_disable_interrupt(UNS_32 source);
UNS_32 int_enabled(UNS_32 source);
UNS_32 int_pending(UNS_32 source);
INT_8 int_irq_priority(UNS_32 source);
INT_8 int_fiq_priority(UNS_32 source);
void int_init_fiq_handler(void);
INT_8 int_install_fiq_handler(UNS_32 source, 
                               UNS_32 priority,
                               void (*hp)(void) );
INT_8 int_remove_fiq_handler(UNS_32 priority);
void (* int_handler(UNS_32 source))(void);
INT_8 irq_next_available(UNS_32 range_start, UNS_32 range_end);
INT_8 fiq_next_available(UNS_32 range_start, UNS_32 range_end);

__inline void enable_IRQ(void)
{
   int tmp;
   __asm
   {
      MRS tmp, CPSR
      BIC tmp, tmp, #ARM_IRQ
      MSR CPSR_c, tmp
   }
}

__inline void disable_IRQ(void)
{
   int tmp;
   __asm
   {
      MRS tmp, CPSR
      ORR tmp, tmp, #ARM_IRQ
      MSR CPSR_c, tmp
   }
}

__inline void enable_FIQ(void)
{
   int tmp;
   __asm
   {
      MRS tmp, CPSR
      BIC tmp, tmp, #ARM_FIQ
      MSR CPSR_c, tmp
   }
}

__inline void disable_FIQ(void)
{
   int tmp;
   __asm
   {
      MRS tmp, CPSR
      ORR tmp, tmp, #ARM_FIQ
      MSR CPSR_c, tmp
   }
}

#endif /* INT_DRIVER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -