hardware.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * This file is only used for doxygen document generation.
  3. */
  4. /**
  5. * @defgroup bsp Hardware Related Package
  6. *
  7. * @brief Hardware Related Package includes board support package(BSP) and CSP(Chip
  8. * Support Package).
  9. *
  10. * Board Support Package(BSP) is the hardware related wrapper, for example, peripherals
  11. * in board, the pinmux setting etc. In RT-Thread RTOS, the bsp is placed under bsp
  12. * directory.
  13. *
  14. * Chip Support Package(CSP) is a software set that contains chip specific software.
  15. * A CSP usually includes operating system porting and peripheral device drivers inside
  16. * chip. In RT-Thread RTOS, the csp is placed under libcpu directory.
  17. */
  18. /**
  19. * @addtogroup bsp
  20. * @{
  21. */
  22. /**
  23. * This function will return current system interrupt status and disable system
  24. * interrupt.
  25. *
  26. * @return the current system interrupt status.
  27. */
  28. rt_base_t rt_hw_interrupt_disable(void);
  29. /**
  30. * This function will set the specified interrupt status, which shall saved by
  31. * rt_hw_intterrupt_disable function. If the saved interrupt status is interrupt
  32. * opened, this function will open system interrupt status.
  33. *
  34. * @param level the interrupt status to be set.
  35. */
  36. void rt_hw_interrupt_enable(rt_base_t level);
  37. /**
  38. * This function initializes interrupt.
  39. */
  40. void rt_hw_interrupt_init(void);
  41. /**
  42. * This function masks the specified interrupt.
  43. *
  44. * @param vector the interrupt number to be masked.
  45. *
  46. * @note not all of platform provide this function.
  47. */
  48. void rt_hw_interrupt_mask(int vector);
  49. /**
  50. * This function umasks the specified interrupt.
  51. *
  52. * @param vector the interrupt number to be unmasked.
  53. *
  54. * @note not all of platform provide this function.
  55. */
  56. void rt_hw_interrupt_umask(int vector);
  57. /**
  58. * This function will install specified interrupt handler.
  59. *
  60. * @param vector the interrupt number to be installed.
  61. * @param new_handler the new interrupt handler.
  62. * @param old_handler the old interrupt handler. This parameter can be RT_NULL.
  63. *
  64. * @note not all of platform provide this function.
  65. */
  66. void rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handler,
  67. rt_isr_handler_t *old_handler);
  68. /**
  69. * This function will reset whole platform.
  70. */
  71. void rt_hw_cpu_reset(void);
  72. /**
  73. * This function will halt whole platform.
  74. */
  75. void rt_hw_cpu_shutdown(void);
  76. /**@}*/