cmem7_conf.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #ifndef __CMEM7_CONF_H
  27. #define __CMEM7_CONF_H
  28. #define _ADC
  29. #define _AES
  30. #define _CAN
  31. #define _DDR
  32. #define _DMA
  33. #define _EFUSE
  34. #define _ETH
  35. #define _FLASH
  36. #define _GPIO
  37. #define _I2C
  38. #define _MISC
  39. #define _RTC
  40. #define _SPI
  41. #define _TIM
  42. #define _UART
  43. #define _USB
  44. #define _WDG
  45. //#define _MARVELL
  46. //#define _IP1826D
  47. #define _M7NORFLASH
  48. #define _ME_6095_F
  49. #define USE_FULL_ASSERT 1
  50. #ifdef USE_FULL_ASSERT
  51. /**
  52. * @brief The assert_param macro is used for function's parameters check.
  53. * @param expr: If expr is false, it calls assert_failed function which reports
  54. * the name of the source file and the source line number of the call
  55. * that failed. If expr is true, it returns no value.
  56. * @retval None
  57. */
  58. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((unsigned char *)__FILE__, __LINE__))
  59. static void assert_failed(unsigned char* file, unsigned long line) {
  60. while (1) {
  61. ;
  62. }
  63. }
  64. #else
  65. #define assert_param(expr) ((void)0)
  66. #endif /* USE_FULL_ASSERT */
  67. typedef enum _BOOL {FALSE = 0, TRUE = 1} BOOL;
  68. /**
  69. * System clock frequency, unit is Hz.
  70. */
  71. #define SYSTEM_CLOCK_FREQ 300000000
  72. //250000000
  73. //300000000
  74. /**
  75. * @brief usecond delay
  76. * @note It can't delay in an accurate time
  77. * @param[in] usec usecond to be delay
  78. * @retval None
  79. */
  80. static void udelay(unsigned long usec) {
  81. unsigned long count = 0;
  82. unsigned long utime = SYSTEM_CLOCK_FREQ / 1000000 * usec;
  83. while(++count < utime) ;
  84. }
  85. /**
  86. * UART definition for print
  87. */
  88. #define PRINT_UART UART2
  89. /**
  90. * DDR type definition
  91. */
  92. #define DDR_TYPE 3 // 2 for DDR2, 3 for DDR3
  93. #if (DDR_TYPE == 3)
  94. # define DDR_SIZE (256 << 20)
  95. #elif (DDR_TYPE == 2)
  96. # define DDR_SIZE (128 << 20)
  97. #else
  98. # error
  99. #endif
  100. #endif /* __CMEM7_CONF_H */