blob: bcc9e14b27edf8d7ebc169132d922f7f7d99adb3 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*******************************************************************************
2 * Copyright (C) 2014, ZTE Corporation.
3 *
4 * File Name: hal_int_internal.h
5 * File Mark:
6 * Description: describe functions and related macros and types used by
7 * other driver modules
8 * Others:
9 * Version: 1.0
10 * Author: xuzhiguo
11 * Date: 2014-05-05
12 * History 1:
13 * Date:
14 * Version:
15 * Author:
16 * Modification:
17 * History 2:
18 ********************************************************************************/
19
20#ifndef _DRVS_INT_INTERNAL_H
21#define _DRVS_INT_INTERNAL_H
22
23/****************************************************************************
24* Include files
25****************************************************************************/
26#include "drvs_general.h"
27#include "drvs_int.h"
28
29/****************************************************************************
30* Macros
31****************************************************************************/
32
33/****************************************************************************
34* Types
35****************************************************************************/
36typedef enum _T_Int_State
37{
38 INT_UNINSTALL,
39 INT_PENDING,
40 INT_ACTIVE,
41} T_Int_State;
42
43/*
44* this struct presents the operation method
45* and state of interrupt controller chip
46*/
47typedef struct _T_Int_Chip
48{
49 VOID (*pMaskIrq)( UINT32 line );
50 VOID (*pUnmaskIrq)( UINT32 line );
51 VOID (*pSetLineLevel)(UINT32 line, T_zDrvIntLineLevel level);
52 VOID (*pSetLinePri)(UINT32 line, UINT32 pri);
53} T_Int_Chip;
54
55typedef VOID (*IsrFunc)(VOID);
56
57/**************************************************************************
58 * Global Variable
59 **************************************************************************/
60
61/**************************************************************************
62 * Function Prototypes
63 **************************************************************************/
64 /*******************************************************************************
65 * Function: zDrvInt_SetMaskRam
66 * Description: an inline function to set g_IntDev.MaskRegInRam
67 * Parameters:
68 * Input:
69 * index: which member in array MaskRegInRam
70 * value: be writen
71 *
72 * Output:
73 *
74 * Returns:
75 *
76 * Others:
77 ********************************************************************************/
78 VOID zDrvInt_SetMaskRam(UINT32 index, UINT32 value);
79
80/*******************************************************************************
81 * Function: zDrvInt_GetMaskRam
82 * Description: an inline function to get g_IntDev.MaskRegInRam
83 * Parameters:
84 * Input:
85 * index: which member in array MaskRegInRam
86 *
87 * Output:
88 *
89 * Returns:
90 * member's value in array MaskRegInRam
91 *
92 * Others:
93 ********************************************************************************/
94 UINT32 zDrvInt_GetMaskRam(UINT32 index);
95
96/*******************************************************************************
97 * Function: zDrvInt_GetExtraIsr
98 * Description: get a isr according to ex8in1 int and gpio int
99 * Parameters:
100 * Input:
101 * line: interrupt line
102 *
103 * Output:
104 *
105 * Returns:
106 * isr for ex8in1 int and gpio int
107 * Others:
108 ********************************************************************************/
109 VOID* zDrvInt_GetExtraIsr(UINT32 line);
110
111/*******************************************************************************
112 * Function: zDrvInt_GetIntState
113 * Description: an inline function to get g_IntDev.IntState
114 * Parameters:
115 * Input:
116 * line: interrupt line to be disabled 0--INT_LINES_NUM
117 *
118 * Output:
119 *
120 * Returns:
121 * member's value in array IntState
122 *
123 * Others:
124 ********************************************************************************/
125 T_Int_State zDrvInt_GetIntState(UINT32 line);
126
127/*******************************************************************************
128 * Function: zDrvInt_SetChipHandler
129 * Description:
130 * Parameters:
131 * Input:
132 * line: which member in array IntChipHandler, according to interrupt line
133 * pChip: point to struct T_Int_Chip to be set
134 *
135 * Output:
136 *
137 * Returns:
138 *
139 * Others:
140 ********************************************************************************/
141 VOID zDrvInt_SetChipHandler(UINT32 line, T_Int_Chip *pChip);
142
143 #endif