Subversion Repositories NaviCtrl

Rev

Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 196
Line 1... Line 1...
1
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
1
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
2
* File Name          : 91x_vic.c
2
* File Name          : 91x_vic.c
3
* Author             : MCD Application Team
3
* Author             : MCD Application Team
-
 
4
* Version            : V2.1
4
* Date First Issued  : 05/18/2006 : Version 1.0
5
* Date               : 12/22/2008
5
* Description        : This file provides all the VIC software functions.
6
* Description        : This file provides all the VIC firmware functions.
6
********************************************************************************
-
 
7
* History:
-
 
8
* 05/22/2007 : Version 1.2
-
 
9
* 05/24/2006 : Version 1.1
-
 
10
* 05/18/2006 : Version 1.0
-
 
11
********************************************************************************
7
********************************************************************************
12
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
8
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
13
* CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS
9
* CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS
14
* A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
10
* A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
15
* OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
11
* OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
Line 56... Line 52...
56
{
52
{
57
  SCU_AHBPeriphReset(__VIC, ENABLE);     /* VIC peripheral is under Reset */
53
  SCU_AHBPeriphReset(__VIC, ENABLE);     /* VIC peripheral is under Reset */
58
  SCU_AHBPeriphReset(__VIC, DISABLE);    /* VIC peripheral Reset off */
54
  SCU_AHBPeriphReset(__VIC, DISABLE);    /* VIC peripheral Reset off */
59
}
55
}
Line -... Line 56...
-
 
56
 
-
 
57
 
-
 
58
/*******************************************************************************
-
 
59
* Function Name  : VIC_InitDefaultVectors
-
 
60
* Description    : Assign the handler "DefaultVector_Handler" to VIC0 and VIC1
-
 
61
*                  default vector address registers VIC0_DVAR and VIC1_DVAR
-
 
62
* Input          : None
-
 
63
* Output         : None
-
 
64
* Return         : None
-
 
65
*******************************************************************************/
-
 
66
void VIC_InitDefaultVectors(void)
-
 
67
{
-
 
68
  VIC0->DVAR = (u32)DefaultVector_Handler;
-
 
69
  VIC1->DVAR = (u32)DefaultVector_Handler;                                  
60
 
70
}
61
/*******************************************************************************
71
/*******************************************************************************
62
* Function Name  : VIC_GetIRQStatus
72
* Function Name  : VIC_GetIRQStatus
63
* Description    : Get the status of interrupts after IRQ masking.
73
* Description    : Get the status of interrupts after IRQ masking.
64
* Input          : VIC_Source: specifies the number of the source line.
74
* Input          : VIC_Source: specifies the number of the source line.
Line 521... Line 531...
521
}
531
}
Line 522... Line 532...
522
 
532
 
523
/*******************************************************************************
533
/*******************************************************************************
524
* Function Name  : VIC_GetISRVectAdd
534
* Function Name  : VIC_GetISRVectAdd
525
* Description    : Get the ISR vector address of the correspondent line.
535
* Description    : Get the ISR vector address of the correspondent line.
526
* Input          : VIC_Source: specifies the number of the source line.
536
* Input1          : VIC_Source: specifies the number of the source line.
527
*                  This parameter can be one of the following values:
537
*                  This parameter can be one of the following values:
528
*                     - WDG_ITLine   : VIC source 0
538
*                     - WDG_ITLine   : VIC source 0
529
*                     - SW_ITLine    : VIC source 1
539
*                     - SW_ITLine    : VIC source 1
530
*                     - ARMRX_ITLine : VIC source 2
540
*                     - ARMRX_ITLine : VIC source 2
Line 555... Line 565...
555
*                     - EXTIT1_ITLine: VIC source 27
565
*                     - EXTIT1_ITLine: VIC source 27
556
*                     - EXTIT2_ITLine: VIC source 28
566
*                     - EXTIT2_ITLine: VIC source 28
557
*                     - EXTIT3_ITLine: VIC source 29
567
*                     - EXTIT3_ITLine: VIC source 29
558
*                     - USBWU_ITLine : VIC source 30
568
*                     - USBWU_ITLine : VIC source 30
559
*                     - PFQBC_ITLine : VIC source 31
569
*                     - PFQBC_ITLine : VIC source 31
-
 
570
* Input2         : VIC_Priority: specifies the priority of the interrupt.
-
 
571
*                  It can be a value from 0 to 15. 0 is the highest priority.
560
* Output         : None
572
* Output         : None
561
* Return         : The correspondent ISR vector address.
573
* Return         : The correspondent ISR vector address.
562
*******************************************************************************/
574
*******************************************************************************/
563
u32 VIC_GetISRVectAdd(u16 VIC_Source)
575
u32 VIC_GetISRVectAdd(u16 VIC_Source,u16 VIC_Priority)
564
{
576
{
565
  if (VIC_Source < VIC_REGISTER_NUMBER) /* VIC0 */
577
  if (VIC_Source < VIC_REGISTER_NUMBER) /* VIC0 */
566
    return VIC0->VAiR[VIC_Source];
578
    return VIC0->VAiR[VIC_Priority];
567
  else /* VIC1 */
579
  else /* VIC1 */
568
    return VIC1->VAiR[VIC_Source - VIC_REGISTER_NUMBER];
580
    return VIC1->VAiR[VIC_Priority];
569
}
581
}
Line 570... Line 582...
570
 
582
 
571
/*******************************************************************************
583
/*******************************************************************************
572
* Function Name  : VIC_VectEnableConfig
584
* Function Name  : VIC_VectEnableConfig
Line 826... Line 838...
826
  VIC_ITModeConfig(VIC_Source, VIC_LineMode);
838
  VIC_ITModeConfig(VIC_Source, VIC_LineMode);
827
  VIC_VectEnableConfig(VIC_Source, VIC_Priority);
839
  VIC_VectEnableConfig(VIC_Source, VIC_Priority);
828
  VIC_ITSourceConfig(VIC_Source, VIC_Priority);
840
  VIC_ITSourceConfig(VIC_Source, VIC_Priority);
829
}
841
}
Line 830... Line 842...
830
 
842