cmem7_conf.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 USE_FULL_ASSERT 1
  46. #ifdef USE_FULL_ASSERT
  47. /**
  48. * @brief The assert_param macro is used for function's parameters check.
  49. * @param expr: If expr is false, it calls assert_failed function which reports
  50. * the name of the source file and the source line number of the call
  51. * that failed. If expr is true, it returns no value.
  52. * @retval None
  53. */
  54. #define assert_param(expr) ((expr) ? (void)0 : assert_failed((unsigned char *)__FILE__, __LINE__))
  55. static void assert_failed(unsigned char* file, unsigned long line) {
  56. while (1) {
  57. ;
  58. }
  59. }
  60. #else
  61. #define assert_param(expr) ((void)0)
  62. #endif /* USE_FULL_ASSERT */
  63. typedef enum _BOOL {FALSE = 0, TRUE = 1} BOOL;
  64. /**
  65. * System clock frequency, unit is Hz.
  66. */
  67. #define SYSTEM_CLOCK_FREQ 200000000
  68. /**
  69. * @brief usecond delay
  70. * @note It can't delay in an accurate time
  71. * @param[in] usec usecond to be delay
  72. * @retval None
  73. */
  74. static void udelay(unsigned long usec) {
  75. unsigned long count = 0;
  76. unsigned long utime = SYSTEM_CLOCK_FREQ / 1000000 * usec;
  77. while(++count < utime) ;
  78. }
  79. /**
  80. * UART definition for print
  81. */
  82. #define PRINT_UART UART2
  83. /**
  84. * DDR type definition
  85. */
  86. #define DDR_TYPE 3 // 2 for DDR2, 3 for DDR3
  87. #if (DDR_TYPE == 3)
  88. # define DDR_SIZE (256 << 20)
  89. #elif (DDR_TYPE == 2)
  90. # define DDR_SIZE (128 << 20)
  91. #else
  92. # error
  93. #endif
  94. #endif /* __CMEM7_CONF_H */