OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [ARM7_STR71x_IAR/] [Library/] [include/] [eic.h] - Blame information for rev 583

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 577 jeremybenn
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
2
* File Name          : eic.h
3
* Author             : MCD Application Team
4
* Date First Issued  : 25/06/2003
5
* Description        : This file contains all the functions prototypes for the
6
*                      EIC software library.
7
********************************************************************************
8
* History:
9
*  30/11/2004 : V2.0
10
*  14/07/2004 : V1.3
11
*  01/01/2004 : V1.2
12
*******************************************************************************
13
 THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
14
 CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
15
 AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
16
 OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
17
 OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
18
 CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19
*******************************************************************************/
20
#ifndef __eic_H
21
#define __eic_H
22
 
23
#include "71x_map.h"
24
 
25
typedef enum
26
{
27
  T0TIMI_IRQChannel    = 0,
28
  FLASH_IRQChannel     = 1,
29
  RCCU_IRQChannel      = 2,
30
  RTC_IRQChannel       = 3,
31
  WDG_IRQChannel       = 4,
32
  XTI_IRQChannel       = 5,
33
  USBHP_IRQChannel     = 6,
34
  I2C0ITERR_IRQChannel = 7,
35
  I2C1ITERR_IRQChannel = 8,
36
  UART0_IRQChannel     = 9,
37
  UART1_IRQChannel     = 10,
38
  UART2_IRQChannel     = 11,
39
  UART3_IRQChannel     = 12,
40
  SPI0_IRQChannel      = 13,
41
  SPI1_IRQChannel      = 14,
42
  I2C0_IRQChannel      = 15,
43
  I2C1_IRQChannel      = 16,
44
  CAN_IRQChannel       = 17,
45
  ADC_IRQChannel       = 18,
46
  T1TIMI_IRQChannel    = 19,
47
  T2TIMI_IRQChannel    = 20,
48
  T3TIMI_IRQChannel    = 21,
49
  HDLC_IRQChannel      = 25,
50
  USBLP_IRQChannel     = 26,
51
  T0TOI_IRQChannel     = 29,
52
  T0OC1_IRQChannel     = 30,
53
  T0OC2_IRQChannel     = 31
54
} IRQChannel_TypeDef;
55
 
56
typedef enum
57
{
58
  T0TIMI_FIQChannel     = 0x00000001,
59
  WDG_FIQChannel        = 0x00000002,
60
  WDGT0TIMI_FIQChannels = 0x00000003
61
} FIQChannel_TypeDef;
62
 
63
/*******************************************************************************
64
* Function Name  : EIC_Init
65
* Description    : Initialise the EIC using the load PC instruction
66
*                 (PC = PC +offset)
67
* Input          : None
68
* Output         : None
69
* Return         : None
70
*******************************************************************************/
71
void EIC_Init(void);
72
 
73
/*******************************************************************************
74
* Function Name  : EIC_IRQConfig
75
* Description    : Enable or Disable IRQ interrupts
76
* Input 1        : New status : can be ENABLE or DISABLE
77
* Output         : None
78
* Return         : None
79
*******************************************************************************/
80
inline void EIC_IRQConfig(FunctionalState NewState)
81
{
82
  if (NewState==ENABLE) EIC->ICR |= 0x0001; else EIC->ICR &= ~0x0001;
83
}
84
 
85
/*******************************************************************************
86
* Function Name  : EIC_FIQConfig
87
* Description    : Enable or Disable FIQ interrupts
88
* Input 1        : New status : can be ENABLE or DISABLE
89
* Output         : None
90
* Return         : None
91
*******************************************************************************/
92
inline void EIC_FIQConfig(FunctionalState NewState)
93
{
94
  if (NewState==ENABLE) EIC->ICR |= 0x0002; else EIC->ICR &= ~0x0002;
95
}
96
 
97
/*******************************************************************************
98
* Function Name  : EIC_IRQChannelConfig
99
* Description    : Configure the IRQ Channel
100
* Input 1        : IRQ channel name
101
* Input 2        : Channel New status : can be ENABLE or DISABLE
102
* Output         : None
103
* Return         : None
104
*******************************************************************************/
105
inline void EIC_IRQChannelConfig(IRQChannel_TypeDef IRQChannel, FunctionalState NewState)
106
{
107
  if (NewState==ENABLE) EIC->IER |= 0x0001 << IRQChannel;
108
  else EIC->IER &= ~(0x0001 << IRQChannel);
109
}
110
 
111
/*******************************************************************************
112
* Function Name  : EIC_FIQChannelConfig
113
* Description    : Configure the FIQ Channel
114
* Input 1        : FIQ channel name
115
* Input 2        : Channel New status : can be ENABLE or DISABLE
116
* Output         : None
117
* Return         : None
118
*******************************************************************************/
119
inline void EIC_FIQChannelConfig(FIQChannel_TypeDef FIQChannel,
120
                          FunctionalState NewState)
121
{
122
  if (NewState==ENABLE) EIC->FIR |= FIQChannel;
123
  else EIC->FIR &= ~FIQChannel;
124
}
125
 
126
/*******************************************************************************
127
* Function Name  : EIC_IRQChannelPriorityConfig
128
* Description    : Configure the selected IRQ channel priority
129
* Input 1        : IRQ channel name
130
* Input 2        : IRQ channel priority
131
* Output         : None
132
* Return         : None
133
*******************************************************************************/
134
inline void EIC_IRQChannelPriorityConfig(IRQChannel_TypeDef IRQChannel, u8 Priority)
135
{
136
  EIC->SIR[IRQChannel] = (EIC->SIR[IRQChannel]&0xFFFF0000) | (u16)Priority & 0x000F;
137
}
138
 
139
/*******************************************************************************
140
* Function Name  : EIC_CurrentPriorityLevelConfig
141
* Description    : Change the current priority level of the srved IRQ routine
142
* Input 1        : New priority
143
* Output         : None
144
* Return         : None
145
*******************************************************************************/
146
void EIC_CurrentPriorityLevelConfig(u8 NewPriorityLevel);
147
 
148
/*******************************************************************************
149
* Function Name  : EIC_CurrentPriorityLevelValue
150
* Description    : Return the current priority level of the current served IRQ
151
*                  routine
152
* Input          : None
153
* Output         : None
154
* Return         : The current priority level
155
*******************************************************************************/
156
inline u8 EIC_CurrentPriorityLevelValue(void)
157
{
158
  return EIC->CIPR & 0xF;
159
}
160
 
161
/*******************************************************************************
162
* Function Name  : EIC_CurrentIRQChannelValue
163
* Description    : Return the current served IRQ channel number
164
* Input 0        : None
165
* Output         : None
166
* Return         : The current served IRQ channel number
167
*******************************************************************************/
168
inline IRQChannel_TypeDef EIC_CurrentIRQChannelValue(void)
169
{
170
  return (IRQChannel_TypeDef)(EIC->CICR & 0x1F);
171
}
172
 
173
/*******************************************************************************
174
* Function Name  : EIC_CurrentFIQChannelValue
175
* Description    : Return the current served FIQ channel number
176
* Input          : None
177
* Output         : None
178
* Return         : The current served FIQ channel number
179
*******************************************************************************/
180
inline FIQChannel_TypeDef EIC_CurrentFIQChannelValue(void)
181
{
182
   return (FIQChannel_TypeDef)((EIC->FIR >> 2) & 0x0003);
183
}
184
 
185
/*******************************************************************************
186
* Function Name  : EIC_FIPendingBitClear
187
* Description    : Clear the FIQ pending bit
188
* Input 1        : FIQ channel
189
* Output         : None
190
* Return         : None
191
*******************************************************************************/
192
inline void EIC_FIQPendingBitClear(FIQChannel_TypeDef FIQChannel)
193
{
194
  EIC->FIR = (EIC->FIR & 0x0003) | (FIQChannel << 2);
195
}
196
 
197
#endif /* __eic_H */
198
 
199
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.