board.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2012-02-13 mojingxian first version
  9. */
  10. #ifndef _BOARD_H_
  11. #define _BOARD_H_
  12. #define CLKIN 33333000LL
  13. #define SPEED_MULTIPLE 16
  14. #define BUS_DIVISOR 4
  15. #define CCLKSPEED (CLKIN * SPEED_MULTIPLE)
  16. #define SCLKSPEED (CLKIN * BUS_DIVISOR)
  17. #define CLOCKS_PER_SECD CCLKSPEED
  18. #define SCLOCKS_PER_SEC SCLKSPEED
  19. //SIC_IMASK寄存器
  20. #define PLL_WAKEUP_INT_MASK 0x00000001
  21. #define DMA_ERROR_INT_MASK 0x00000002
  22. #define PPI_ERROR_INT_MASK 0x00000004
  23. #define SPORT0_ERROR_INT_MASK 0x00000008
  24. #define SPORT1_ERROR_INT_MASK 0x00000010
  25. #define SPI_ERROR_INT_MASK 0x00000020
  26. #define UART_ERROR_INT_MASK 0x00000040
  27. #define RTC_INT_MASK 0x00000080
  28. #define DMA0_PPI_INT_MASK 0x00000100
  29. #define DMA1_SPORT0_RX_INT_MASK 0x00000200
  30. #define DMA2_SPORT0_TX_INT_MASK 0x00000400
  31. #define DMA3_SPORT1_RX_INT_MASK 0x00000800
  32. #define DMA4_SPORT1_TX_INT_MASK 0x00001000
  33. #define DMA5_SPI_INT_MASK 0x00002000
  34. #define DMA6_UART_RX_INT_MASK 0x00004000
  35. #define DMA7_UART_TX_INT_MASK 0x00008000
  36. #define TIMER0_INT_MASK 0x00010000
  37. #define TIMER1_INT_MASK 0x00020000
  38. #define TIMER2_INT_MASK 0x00040000
  39. #define PF_INTA_MASK 0x00080000
  40. #define PF_INTB_MASK 0x00100000
  41. #define MEM_DMA_STREAM0_MASK 0x00200000
  42. #define MEM_DMA_STREAM1_MASK 0x00400000
  43. #define SOFT_WATCHDOG_TMER_MASK 0x00800000
  44. //SIC_IAR0
  45. #define IAR0_PLL_WAKEUP_INT_IVG 0x00
  46. #define IAR0_DMA_ERROR_INT_IVG 0x01
  47. #define IAR0_PPI_ERROR_INT_IVG 0x02
  48. #define IAR0_SPORT0_ERROR_INT_IVG 0x03
  49. #define IAR0_SPORT1_ERROR_INT_IVG 0x04
  50. #define IAR0_SPI_ERROR_INT_IVG 0x05
  51. #define IAR0_UART_ERROR_INT_IVG 0x06
  52. #define IAR0_RTC_INT_IVG 0x07
  53. //SIC_IAR1
  54. #define IAR1_DMA0_PPI_INT_IVG 0x00
  55. #define IAR1_DMA1_SPORT0RX_IVG 0x01
  56. #define IAR1_DMA2_SPORT0TX_IVG 0x02
  57. #define IAR1_DMA3_SPORT1RX_IVG 0x03
  58. #define IAR1_DMA4_SPORT1TX_IVG 0x04
  59. #define IAR1_DMA5_SPI_INT_IVG 0x05
  60. #define IAR1_DMA6_UARTRX_IVG 0x06
  61. #define IAR1_DMA7_UARTTX_IVG 0x07
  62. //SIC_IAR2
  63. #define IAR2_TIMER0_INT_IVG 0x00
  64. #define IAR2_TIMER1_INT_IVG 0x01
  65. #define IAR2_TIMER2_INT_IVG 0x02
  66. #define IAR2_PF_A_INT_IVG 0x03
  67. #define IAR2_PF_B_INT_IVG 0x04
  68. #define IAR2_MEM_DMA_STREAM0_INT_IVG 0x05
  69. #define IAR2_MEM_DMA_STREAM1_INT_IVG 0x06
  70. #define IAR2_SWATCHDOG_TIMER_INT_IVG 0x07
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. void rt_hw_core_timer_init(void);
  75. void rt_hw_board_init(void);
  76. void rt_hw_isr_install(void);
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif /* _BSP_H_ */