rtdevice.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2012-01-08 bernard first version.
  9. * 2014-07-12 bernard Add workqueue implementation.
  10. */
  11. #ifndef __RT_DEVICE_H__
  12. #define __RT_DEVICE_H__
  13. #include <rtdef.h>
  14. #include <rtthread.h>
  15. #include <drivers/core/driver.h>
  16. #include <drivers/classes/block.h>
  17. #include <drivers/classes/char.h>
  18. #include <drivers/classes/graphic.h>
  19. #include <drivers/classes/mtd.h>
  20. #include <drivers/classes/net.h>
  21. #include "ipc/ringbuffer.h"
  22. #include "ipc/completion.h"
  23. #include "ipc/dataqueue.h"
  24. #include "ipc/workqueue.h"
  25. #include "ipc/condvar.h"
  26. #include "ipc/waitqueue.h"
  27. #include "ipc/pipe.h"
  28. #include "ipc/poll.h"
  29. #include "ipc/ringblk_buf.h"
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #define RT_DEVICE(device) ((rt_device_t)device)
  34. #ifdef RT_USING_RTC
  35. #include "drivers/rtc.h"
  36. #ifdef RT_USING_ALARM
  37. #include "drivers/alarm.h"
  38. #endif
  39. #endif /* RT_USING_RTC */
  40. #ifdef RT_USING_SPI
  41. #include "drivers/spi.h"
  42. #endif /* RT_USING_SPI */
  43. #ifdef RT_USING_MTD_NOR
  44. #include "drivers/mtd_nor.h"
  45. #endif /* RT_USING_MTD_NOR */
  46. #ifdef RT_USING_MTD_NAND
  47. #include "drivers/mtd_nand.h"
  48. #endif /* RT_USING_MTD_NAND */
  49. #ifdef RT_USING_USB_DEVICE
  50. #include "drivers/usb_device.h"
  51. #endif /* RT_USING_USB_DEVICE */
  52. #ifdef RT_USING_USB_HOST
  53. #include "drivers/usb_host.h"
  54. #endif /* RT_USING_USB_HOST */
  55. #ifdef RT_USING_SERIAL
  56. #ifdef RT_USING_SERIAL_V2
  57. #include "drivers/serial_v2.h"
  58. #else
  59. #include "drivers/serial.h"
  60. #endif
  61. #endif /* RT_USING_SERIAL */
  62. #ifdef RT_USING_I2C
  63. #include "drivers/i2c.h"
  64. #include "drivers/i2c_dev.h"
  65. #ifdef RT_USING_I2C_BITOPS
  66. #include "drivers/i2c-bit-ops.h"
  67. #endif /* RT_USING_I2C_BITOPS */
  68. #endif /* RT_USING_I2C */
  69. #ifdef RT_USING_PHY
  70. #include "drivers/phy.h"
  71. #include "drivers/phy_mdio.h"
  72. #endif /* RT_USING_PHY */
  73. #ifdef RT_USING_SDIO
  74. #include "drivers/mmcsd_core.h"
  75. #include "drivers/sd.h"
  76. #include "drivers/sdio.h"
  77. #endif /* RT_USING_SDIO */
  78. #ifdef RT_USING_WDT
  79. #include "drivers/watchdog.h"
  80. #endif /* RT_USING_WDT */
  81. #ifdef RT_USING_PIN
  82. #include "drivers/pin.h"
  83. #endif /* RT_USING_PIN */
  84. #ifdef RT_USING_SENSOR
  85. #ifdef RT_USING_SENSOR_V2
  86. #include "drivers/sensor_v2.h"
  87. #else
  88. #include "drivers/sensor.h"
  89. #endif /* RT_USING_SENSOR_V2 */
  90. #endif /* RT_USING_SENSOR */
  91. #ifdef RT_USING_CAN
  92. #include "drivers/can.h"
  93. #endif /* RT_USING_CAN */
  94. #ifdef RT_USING_HWTIMER
  95. #include "drivers/hwtimer.h"
  96. #endif /* RT_USING_HWTIMER */
  97. #ifdef RT_USING_AUDIO
  98. #include "drivers/audio.h"
  99. #endif /* RT_USING_AUDIO */
  100. #ifdef RT_USING_CPUTIME
  101. #include "drivers/cputime.h"
  102. #endif /* RT_USING_CPUTIME */
  103. #ifdef RT_USING_ADC
  104. #include "drivers/adc.h"
  105. #endif /* RT_USING_ADC */
  106. #ifdef RT_USING_DAC
  107. #include "drivers/dac.h"
  108. #endif /* RT_USING_DAC */
  109. #ifdef RT_USING_PWM
  110. #include "drivers/rt_drv_pwm.h"
  111. #endif /* RT_USING_PWM */
  112. #ifdef RT_USING_PM
  113. #include "drivers/pm.h"
  114. #endif /* RT_USING_PM */
  115. #ifdef RT_USING_WIFI
  116. #include "drivers/wlan.h"
  117. #endif /* RT_USING_WIFI */
  118. #ifdef MTD_USING_NOR
  119. #include "drivers/mtdnor.h"
  120. #endif /* MTD_USING_NOR */
  121. #ifdef MTD_USING_NAND
  122. #include "drivers/mtdnand.h"
  123. #endif /* MTD_USING_NAND */
  124. #ifdef RT_USING_HWCRYPTO
  125. #include "drivers/crypto.h"
  126. #endif /* RT_USING_HWCRYPTO */
  127. #ifdef RT_USING_PULSE_ENCODER
  128. #include "drivers/pulse_encoder.h"
  129. #endif /* RT_USING_PULSE_ENCODER */
  130. #ifdef RT_USING_INPUT_CAPTURE
  131. #include "drivers/rt_inputcapture.h"
  132. #endif /* RT_USING_INPUT_CAPTURE */
  133. #ifdef RT_USING_TOUCH
  134. #include "drivers/touch.h"
  135. #endif
  136. #ifdef RT_USING_DEV_BUS
  137. #include "drivers/rt_dev_bus.h"
  138. #endif
  139. #ifdef RT_USING_LCD
  140. #include "drivers/lcd.h"
  141. #endif
  142. #ifdef RT_USING_CLK
  143. #include "drivers/clk.h"
  144. #endif /* RT_USING_CLK */
  145. #ifdef RT_USING_DM
  146. #include "drivers/core/dm.h"
  147. #include "drivers/platform.h"
  148. #ifdef RT_USING_OFW
  149. #include "drivers/ofw.h"
  150. #include "drivers/ofw_fdt.h"
  151. #include "drivers/ofw_io.h"
  152. #include "drivers/ofw_irq.h"
  153. #include "drivers/ofw_raw.h"
  154. #endif /* RT_USING_OFW */
  155. #ifdef RT_USING_PIC
  156. #include "drivers/pic.h"
  157. #endif
  158. #endif /* RT_USING_DM */
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162. #endif /* __RT_DEVICE_H__ */