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