1 |
577 |
jeremybenn |
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
|
2 |
|
|
* File Name : 75x_cfg.c
|
3 |
|
|
* Author : MCD Application Team
|
4 |
|
|
* Date First Issued : 03/10/2006
|
5 |
|
|
* Description : This file provides all the CFG software functions.
|
6 |
|
|
********************************************************************************
|
7 |
|
|
* History:
|
8 |
|
|
* 07/17/2006 : V1.0
|
9 |
|
|
* 03/10/2006 : V0.1
|
10 |
|
|
********************************************************************************
|
11 |
|
|
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
12 |
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
13 |
|
|
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
|
14 |
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
|
15 |
|
|
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
|
16 |
|
|
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
17 |
|
|
*******************************************************************************/
|
18 |
|
|
|
19 |
|
|
/* Includes ------------------------------------------------------------------*/
|
20 |
|
|
#include "75x_cfg.h"
|
21 |
|
|
|
22 |
|
|
/* Private typedef -----------------------------------------------------------*/
|
23 |
|
|
/* Private define ------------------------------------------------------------*/
|
24 |
|
|
#define CFG_SWBOOT_Mask 0xFFFFFFFC
|
25 |
|
|
#define CFG_FLASHBusy_Mask 0x00000080
|
26 |
|
|
|
27 |
|
|
/* Private macro -------------------------------------------------------------*/
|
28 |
|
|
/* Private variables ---------------------------------------------------------*/
|
29 |
|
|
/* Private function prototypes -----------------------------------------------*/
|
30 |
|
|
/* Private functions ---------------------------------------------------------*/
|
31 |
|
|
|
32 |
|
|
/*******************************************************************************
|
33 |
|
|
* Function Name : CFG_BootSpaceConfig
|
34 |
|
|
* Description : Selects which memory space will be remapped at address 0x00.
|
35 |
|
|
* Input : - CFG_BootSpace: specifies the memory space to be remapped
|
36 |
|
|
* at address 0x00.
|
37 |
|
|
* This parameter can be one of the following values:
|
38 |
|
|
* - CFG_BootSpace_FLASH
|
39 |
|
|
* - CFG_BootSpace_SRAM
|
40 |
|
|
* - CFG_BootSpace_ExtSMI
|
41 |
|
|
* Output : None
|
42 |
|
|
* Return : None
|
43 |
|
|
*******************************************************************************/
|
44 |
|
|
void CFG_BootSpaceConfig(u32 CFG_BootSpace)
|
45 |
|
|
{
|
46 |
|
|
u32 Temp = 0;
|
47 |
|
|
|
48 |
|
|
/* Clear SW_BOOT[1:0] bits */
|
49 |
|
|
Temp = CFG->GLCONF & CFG_SWBOOT_Mask;
|
50 |
|
|
|
51 |
|
|
/* Set SW_BOOT[1:0] bits according to CFG_BootSpace parameter value */
|
52 |
|
|
Temp |= CFG_BootSpace;
|
53 |
|
|
|
54 |
|
|
/* Store the new value */
|
55 |
|
|
CFG->GLCONF = Temp;
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
/*******************************************************************************
|
59 |
|
|
* Function Name : CFG_FLASHBurstConfig
|
60 |
|
|
* Description : Enables or disables the FLASH Burst mode.
|
61 |
|
|
* Input : - CCFG_FLASHBurst: specifies the new state of the FLASH Burst
|
62 |
|
|
* mode.
|
63 |
|
|
* This parameter can be one of the following values:
|
64 |
|
|
* - CFG_FLASHBurst_Disable
|
65 |
|
|
* - CFG_FLASHBurst_Enable
|
66 |
|
|
* Output : None
|
67 |
|
|
* Return : None
|
68 |
|
|
*******************************************************************************/
|
69 |
|
|
void CFG_FLASHBurstConfig(u32 CFG_FLASHBurst)
|
70 |
|
|
{
|
71 |
|
|
if(CFG_FLASHBurst == CFG_FLASHBurst_Enable)
|
72 |
|
|
{
|
73 |
|
|
CFG->GLCONF |= CFG_FLASHBurst_Enable;
|
74 |
|
|
}
|
75 |
|
|
else
|
76 |
|
|
{
|
77 |
|
|
CFG->GLCONF &= CFG_FLASHBurst_Disable;
|
78 |
|
|
}
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
/*******************************************************************************
|
82 |
|
|
* Function Name : CFG_USBFilterConfig
|
83 |
|
|
* Description : Enables or disables the USB Filter.
|
84 |
|
|
* Input : - CFG_USBFilter: specifies the new state of the USB Filter.
|
85 |
|
|
* This parameter can be one of the following values:
|
86 |
|
|
* - CFG_USBFilter_Disable
|
87 |
|
|
* - CFG_USBFilter_Enable
|
88 |
|
|
* Output : None
|
89 |
|
|
* Return : None
|
90 |
|
|
*******************************************************************************/
|
91 |
|
|
void CFG_USBFilterConfig(u32 CFG_USBFilter)
|
92 |
|
|
{
|
93 |
|
|
if(CFG_USBFilter == CFG_USBFilter_Enable)
|
94 |
|
|
{
|
95 |
|
|
CFG->GLCONF |= CFG_USBFilter_Enable;
|
96 |
|
|
}
|
97 |
|
|
else
|
98 |
|
|
{
|
99 |
|
|
CFG->GLCONF &= CFG_USBFilter_Disable;
|
100 |
|
|
}
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
/*******************************************************************************
|
104 |
|
|
* Function Name : CFG_GetFlagStatus
|
105 |
|
|
* Description : Checks whether the FLASH Busy flag is set or not.
|
106 |
|
|
* Input : None
|
107 |
|
|
* Output : None
|
108 |
|
|
* Return : The new state of FLASH Busy flag (SET or RESET).
|
109 |
|
|
*******************************************************************************/
|
110 |
|
|
FlagStatus CFG_GetFlagStatus(void)
|
111 |
|
|
{
|
112 |
|
|
if((CFG->GLCONF & CFG_FLASHBusy_Mask) != RESET)
|
113 |
|
|
{
|
114 |
|
|
return SET;
|
115 |
|
|
}
|
116 |
|
|
else
|
117 |
|
|
{
|
118 |
|
|
return RESET;
|
119 |
|
|
}
|
120 |
|
|
}
|
121 |
|
|
|
122 |
|
|
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/
|