1 /**
2     *****************************************************************************
3     * @file     cmem7_conf.h
4     *
5     * @brief    CMEM7 config file
6     *
7     *
8     * @version  V1.0
9     * @date     3. September 2013
10     *
11     * @note
12     *
13     *****************************************************************************
14     * @attention
15     *
16     * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
17     * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
18     * TIME. AS A RESULT, CAPITAL-MICRO SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
19     * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
20     * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
21     * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
22     *
23     * <h2><center>&copy; COPYRIGHT 2013 Capital-micro </center></h2>
24     *****************************************************************************
25     */
26 
27 #ifndef __CMEM7_CONF_H
28 #define __CMEM7_CONF_H
29 
30 #define _ADC
31 #define _AES
32 #define _CAN
33 #define _DDR
34 #define _DMA
35 #define _EFUSE
36 #define _ETH
37 #define _FLASH
38 #define _GPIO
39 #define _I2C
40 #define _MISC
41 #define _RTC
42 #define _SPI
43 #define _TIM
44 #define _UART
45 #define _USB
46 #define _WDG
47 
48 //#define _MARVELL
49 //#define _IP1826D
50 #define _M7NORFLASH
51 #define _ME_6095_F
52 
53 #define USE_FULL_ASSERT    1
54 
55 #ifdef  USE_FULL_ASSERT
56 /**
57   * @brief  The assert_param macro is used for function's parameters check.
58   * @param  expr: If expr is false, it calls assert_failed function which reports
59   *         the name of the source file and the source line number of the call
60   *         that failed. If expr is true, it returns no value.
61   * @retval None
62   */
63   #define assert_param(expr) ((expr) ? (void)0 : assert_failed((unsigned char *)__FILE__, __LINE__))
64 
assert_failed(unsigned char * file,unsigned long line)65     static void assert_failed(unsigned char* file, unsigned long line) {
66         while (1) {
67             ;
68         }
69     }
70 #else
71   #define assert_param(expr) ((void)0)
72 #endif /* USE_FULL_ASSERT */
73 
74 typedef enum _BOOL {FALSE = 0, TRUE = 1} BOOL;
75 
76 /**
77   * System clock frequency, unit is Hz.
78   */
79 #define SYSTEM_CLOCK_FREQ        300000000
80 //250000000
81 //300000000
82 
83 /**
84   * @brief  usecond delay
85     * @note     It can't delay in an accurate time
86     * @param[in] usec usecond to be delay
87     * @retval None
88     */
udelay(unsigned long usec)89 static void udelay(unsigned long usec) {
90   unsigned long count = 0;
91   unsigned long utime = SYSTEM_CLOCK_FREQ / 1000000 * usec;
92 
93   while(++count < utime) ;
94 }
95 
96 /**
97   * UART definition for print
98     */
99 #define PRINT_UART                          UART2
100 
101 /**
102   * DDR type definition
103   */
104 #define DDR_TYPE                3   // 2 for DDR2, 3 for DDR3
105 
106 #if (DDR_TYPE == 3)
107 # define DDR_SIZE               (256 << 20)
108 #elif (DDR_TYPE == 2)
109 # define DDR_SIZE               (128 << 20)
110 #else
111 # error
112 #endif
113 
114 #endif /* __CMEM7_CONF_H */
115 
116