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

📄 irq.h

📁 T-Kernel下PCF8563的驱动程序开发
💻 H
字号:
/**********************************************************************************/
/*                                                                                */
/*    Copyright (C) 2001 Oki Electric Industry Co., LTD.                          */
/*                                                                                */
/*    System Name    :  uPLAT series                                              */
/*    Module Name    :  header file for using IRQ                                 */
/*    File   Name    :  irq.h                                                     */
/*    Revision       :  01.00                                                     */
/*    Date           :  2001/12/20 initial version                                */
/*                                                                                */
/**********************************************************************************/
#ifndef IRQ_H
#define IRQ_H

#include "common.h"

#ifdef __cplusplus
extern "C" {
#endif

/* type definition */
typedef void IRQ_HANDLER(void);
typedef IRQ_HANDLER *pIRQ_HANDLER;

/* functions */

/**********************************************************************/
/*  Enable IRQ                                                        */
/*  Function : UWORD irq_en(void)                                     */
/*      Parameters                                                    */
/*          input  : nothing                                          */ 
/*          output : IRQ state before change                          */
/*                   0 : Enable                                       */
/*                   others : Disable                                 */ 
/**********************************************************************/
UWORD irq_en(void);

/**********************************************************************/
/*  Disable IRQ                                                       */
/*  Function : UWORD irq_dis(void)                                    */
/*      Parameters                                                    */
/*          input  : nothing                                          */ 
/*          output : IRQ state before change                          */
/*                   0 : Enable                                       */
/*                   others : Disable                                 */ 
/**********************************************************************/
UWORD irq_dis(void);

/**********************************************************************/
/*  Get IRQ State                                                     */
/*  Function : UWORD get_irq_state(void)                              */
/*      Parameters                                                    */
/*          input  : nothing                                          */ 
/*          output : IRQ state                                        */
/*                   0 : Enable                                       */
/*                   others : Disable                                 */ 
/**********************************************************************/
UWORD get_irq_state(void);

/**********************************************************************/
/*  Set IRQ State                                                     */
/*  Function : UWORD set_irq_state(void)                              */
/*      Parameters                                                    */
/*          input  : IRQ State to be set                              */
/*                   0 : Enable                                       */
/*                   others : Disable                                 */
/*          output : IRQ state before change                          */
/*                   0 : Enable                                       */
/*                   others : Disable                                 */ 
/**********************************************************************/
#define set_irq_state(n)    (n == 0 ? irq_en() : irq_dis())

/**********************************************************************/
/*  Initialize Interrupt Control Registers (IRQ interrupt)            */
/*  Function : init_irq                                               */
/*      Parameters                                                    */
/*          Input   :   Nothing                                       */
/*          Output  :   Nothing                                       */
/*  Note : This function initializes only IRQ interrupt,              */
/*         and doesn't initialize FIQ and expanded interrupt.         */
/**********************************************************************/
void init_irq(void);

#ifndef IRQSIZE
#define IRQSIZE 32
#endif

#if IRQSIZE < 16
#error IRQSIZE needs to be 16 or more.
#endif

/**********************************************************************/
/*  Table of IRQ handler                                              */
/*      If interrupt of interrupt number N occurred,                  */
/*      function of IRQ_HANDLER_TABLE[N] is called.                   */
/**********************************************************************/
extern pIRQ_HANDLER IRQ_HANDLER_TABLE[IRQSIZE];

#ifdef __cplusplus
};      /* end of 'extern "C"' */
#endif
#endif  /* #define IRQ_H */

⌨️ 快捷键说明

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