1
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
3
File: oct6100_interrupts_priv.h
5
Copyright (c) 2001-2006 Octasic Inc.
9
File containing all private defines, macros, structures and prototypes
10
pertaining to the file oct6100_interrupts.c. All elements defined in this
11
file are for private usage of the API. All public elements are defined
12
in the oct6100_interrupts_pub.h file.
14
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is
15
free software; you can redistribute it and/or modify it under the terms of
16
the GNU General Public License as published by the Free Software Foundation;
17
either version 2 of the License, or (at your option) any later version.
19
The OCT6100 GPL API is distributed in the hope that it will be useful, but
20
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24
You should have received a copy of the GNU General Public License
25
along with the OCT6100 GPL API; if not, write to the Free Software
26
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28
$Octasic_Release: OCT612xAPI-01.00-PR43 $
30
$Octasic_Revision: 8 $
32
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
34
#ifndef __OCT6100_INTERRUPTS_PRIV_H__
35
#define __OCT6100_INTERRUPTS_PRIV_H__
37
/***************************** INCLUDE FILES *******************************/
40
/***************************** DEFINES *************************************/
42
#define mOCT6100_GET_INTRPT_ENABLE_TIME( \
46
ulIntrptEnableMclkHigh, \
47
ulIntrptEnableMclkLow, \
48
ulIntrptTimeoutMclk, \
50
if ( ulIntrptState == cOCT6100_INTRPT_WILL_TIMEOUT ) \
52
ulIntrptEnableMclkLow = ulRegMclkTimeLow + ulIntrptTimeoutMclk; \
53
if ( ulIntrptEnableMclkLow < ulRegMclkTimeLow ) \
54
ulIntrptEnableMclkHigh = (ulRegMclkTimeHigh + 1) & 0xFF; \
56
ulIntrptEnableMclkHigh = ulRegMclkTimeHigh; \
58
ulIntrptState = cOCT6100_INTRPT_IN_TIMEOUT; \
61
if ( ulIntrptEnableMclkLow < ulRegMclkTimeLow ) \
63
ulTimeDiff = (cOCT6100_FFFFFFFF - ulRegMclkTimeLow - 1) + ulIntrptEnableMclkLow; \
67
ulTimeDiff = ulIntrptEnableMclkLow - ulRegMclkTimeLow; \
70
#define mOCT6100_CHECK_INTRPT_TIMEOUT( \
71
ulRegMclkTimePlus5MsHigh, \
72
ulRegMclkTimePlus5MsLow, \
73
ulIntrptDisableMclkHigh, \
74
ulIntrptDisableMclkLow, \
75
ulIntrptEnableMclkHigh, \
76
ulIntrptEnableMclkLow, \
79
/* Branch depending on whether the disable time is lesser or greater than the timeout time. */ \
80
if ( ulIntrptDisableMclkLow < ulIntrptEnableMclkLow ) \
82
/* Disable period is over if mclk is greater than timeout time or less than disabled time. */ \
83
if ( ulRegMclkTimePlus5MsLow > ulIntrptEnableMclkLow || \
84
ulRegMclkTimePlus5MsLow < ulIntrptDisableMclkLow || \
85
ulRegMclkTimePlus5MsHigh != ulIntrptEnableMclkHigh ) \
87
fIntrptChange = TRUE; \
88
ulIntrptState = cOCT6100_INTRPT_ACTIVE; \
93
/* Disable period is over if mclk is lesser than disable time and greater than timeout. */ \
94
if ( (ulRegMclkTimePlus5MsLow > ulIntrptEnableMclkLow && ulRegMclkTimePlus5MsLow < ulIntrptDisableMclkLow) || \
95
(ulRegMclkTimePlus5MsHigh != ulIntrptDisableMclkHigh && ulRegMclkTimePlus5MsHigh != ulIntrptEnableMclkHigh) ) \
97
fIntrptChange = TRUE; \
98
ulIntrptState = cOCT6100_INTRPT_ACTIVE; \
102
/***************************** TYPES ***************************************/
105
/************************** FUNCTION PROTOTYPES *****************************/
107
UINT32 Oct6100ApiIsrSwInit(
108
IN tPOCT6100_INSTANCE_API f_pApiInstance );
110
UINT32 Oct6100ApiIsrHwInit(
111
IN tPOCT6100_INSTANCE_API f_pApiInstance,
112
IN tPOCT6100_INTERRUPT_CONFIGURE f_pIntrptConfig );
114
UINT32 Oct6100InterruptConfigureSer(
115
IN tPOCT6100_INSTANCE_API f_pApiInstance,
116
IN tPOCT6100_INTERRUPT_CONFIGURE f_pIntrptConfig,
117
IN BOOL f_fCheckParams );
119
UINT32 Oct6100InterruptServiceRoutineSer(
120
IN tPOCT6100_INSTANCE_API f_pApiInstance,
121
OUT tPOCT6100_INTERRUPT_FLAGS f_pIntFlags );
123
UINT32 Oct6100ApiWriteIeRegs(
124
IN tPOCT6100_INSTANCE_API f_pApiInstance );
126
UINT32 Oct6100ApiReadIntrptRegs(
127
IN tPOCT6100_INSTANCE_API f_pApiInstance,
128
OUT tPOCT6100_INTERRUPT_FLAGS f_pIntFlags,
129
IN UINT32 f_ulRegister210h );
131
UINT32 Oct6100ApiUpdateIntrptStates(
132
IN tPOCT6100_INSTANCE_API f_pApiInstance,
133
OUT tPOCT6100_INTERRUPT_FLAGS f_pIntFlags );
135
UINT32 Oct6100ApiWriteIntrptRegs(
136
IN tPOCT6100_INSTANCE_API f_pApiInstance );
138
UINT32 Oct6100ApiReadChipMclkTime(
139
IN tPOCT6100_INSTANCE_API f_pApiInstance );
141
UINT32 Oct6100ApiUpdateIntrptTimeouts(
142
IN tPOCT6100_INSTANCE_API f_pApiInstance );
144
UINT32 Oct6100ApiScheduleNextMclkIntrpt(
145
IN tPOCT6100_INSTANCE_API f_pApiInstance,
146
IN UINT32 f_ulIntrptToSet );
148
UINT32 Oct6100ApiScheduleNextMclkIntrptSer(
149
IN tPOCT6100_INSTANCE_API f_pApiInstance );
151
UINT32 Oct6100ApiCheckProcessorState(
152
IN tPOCT6100_INSTANCE_API f_pApiInstance,
153
IN tPOCT6100_INTERRUPT_FLAGS f_pIntFlags );
155
#endif /* __OCT6100_INTERRUPTS_PRIV_H__ */