board.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2008-12-11 xuxinming first version
  13. */
  14. #ifndef __BOARD_H__
  15. #define __BOARD_H__
  16. void rt_hw_board_init(void);
  17. void rt_hw_led_set(rt_uint32_t led);
  18. void rt_hw_led_flash(void);
  19. #ifdef RT_USING_FINSH
  20. void rt_hw_finsh_init(void);
  21. #endif
  22. #define USE_USB 0
  23. #if USE_USB /* 1 is USB, 0 is non-USB related */
  24. #define PLL_MValue 11
  25. #define PLL_NValue 0
  26. #define CCLKDivValue 4
  27. #define USBCLKDivValue 5
  28. #define Fosc 12000000
  29. #define Fcclk 57600000
  30. #define Fcco 288000000
  31. #else
  32. #define PLL_MValue 12
  33. #define PLL_NValue 1
  34. #define CCLKDivValue 5
  35. #define Fosc 12000000
  36. #define Fcclk 72000000
  37. #define Fcco 360000000
  38. #endif
  39. #if USE_USB
  40. #define Fpclk (Fcclk / 2)
  41. #else
  42. #define Fpclk (Fcclk / 4)
  43. #endif
  44. /* IRQ define */
  45. #define SYS32Mode 0x1F
  46. #define IRQ32Mode 0x12
  47. #define FIQ32Mode 0x11
  48. #define HIGHEST_PRIORITY 0x01
  49. #define LOWEST_PRIORITY 0x0F
  50. #define WDT_INT 0
  51. #define SWI_INT 1
  52. #define ARM_CORE0_INT 2
  53. #define ARM_CORE1_INT 3
  54. #define TIMER0_INT 4
  55. #define TIMER1_INT 5
  56. #define UART0_INT 6
  57. #define UART1_INT 7
  58. #define PWM0_1_INT 8
  59. #define I2C0_INT 9
  60. #define SPI0_INT 10 /* SPI and SSP0 share VIC slot */
  61. #define SSP0_INT 10
  62. #define SSP1_INT 11
  63. #define PLL_INT 12
  64. #define RTC_INT 13
  65. #define EINT0_INT 14
  66. #define EINT1_INT 15
  67. #define EINT2_INT 16
  68. #define EINT3_INT 17
  69. #define ADC0_INT 18
  70. #define I2C1_INT 19
  71. #define BOD_INT 20
  72. #define EMAC_INT 21
  73. #define USB_INT 22
  74. #define CAN_INT 23
  75. #define MCI_INT 24
  76. #define GPDMA_INT 25
  77. #define TIMER2_INT 26
  78. #define TIMER3_INT 27
  79. #define UART2_INT 28
  80. #define UART3_INT 29
  81. #define I2C2_INT 30
  82. #define I2S_INT 31
  83. #define VIC_SIZE 32
  84. #define VECT_ADDR_INDEX 0x100
  85. #define VECT_CNTL_INDEX 0x200
  86. #define CCLK 60000000 /* Fosc = 12MHz, M = 5 */
  87. #define PCLK 15000000 /* CCLK/4, use default */
  88. /******************************************************************************
  89. ** Function name: TargetInit
  90. **
  91. ** Descriptions: Initialize the target board; it is called in a
  92. ** necessary place, change it as needed
  93. **
  94. ** parameters: None
  95. ** Returned value: None
  96. **
  97. ******************************************************************************/
  98. extern void TargetInit(void);
  99. extern void ConfigurePLL( void );
  100. extern void TargetResetInit(void);
  101. #endif