rtdevice.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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/core/bus.h>
  17. #include <drivers/classes/block.h>
  18. #include <drivers/classes/char.h>
  19. #include <drivers/classes/graphic.h>
  20. #include <drivers/classes/mtd.h>
  21. #include <drivers/classes/net.h>
  22. #include "ipc/ringbuffer.h"
  23. #include "ipc/completion.h"
  24. #include "ipc/dataqueue.h"
  25. #include "ipc/workqueue.h"
  26. #include "ipc/condvar.h"
  27. #include "ipc/waitqueue.h"
  28. #include "ipc/pipe.h"
  29. #include "ipc/poll.h"
  30. #include "ipc/ringblk_buf.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #define RT_DEVICE(device) ((rt_device_t)device)
  35. #ifdef RT_USING_DM
  36. #include "drivers/core/dm.h"
  37. #include "drivers/core/numa.h"
  38. #include "drivers/core/power.h"
  39. #include "drivers/core/power_domain.h"
  40. #include "drivers/platform.h"
  41. #ifdef RT_USING_GRAPHIC
  42. #include "drivers/graphic.h"
  43. #ifdef RT_GRAPHIC_BACKLIGHT
  44. #include "drivers/backlight.h"
  45. #endif /* RT_GRAPHIC_BACKLIGHT */
  46. #endif /* RT_USING_GRAPHIC */
  47. #ifdef RT_USING_ATA
  48. #ifdef RT_ATA_AHCI
  49. #include "drivers/ahci.h"
  50. #endif /* RT_ATA_AHCI */
  51. #endif /* RT_USING_ATA */
  52. #ifdef RT_USING_LED
  53. #include "drivers/led.h"
  54. #endif /* RT_USING_LED */
  55. #ifdef RT_USING_INPUT
  56. #include "drivers/input.h"
  57. #ifdef RT_INPUT_UAPI
  58. #include "drivers/input_uapi.h"
  59. #endif
  60. #endif /* RT_USING_INPUT */
  61. #ifdef RT_USING_MBOX
  62. #include "drivers/mailbox.h"
  63. #endif /* RT_USING_MBOX */
  64. #ifdef RT_USING_HWSPINLOCK
  65. #include "drivers/hwspinlock.h"
  66. #endif /* RT_USING_HWSPINLOCK */
  67. #ifdef RT_USING_BLK
  68. #include "drivers/blk.h"
  69. #endif /* RT_USING_BLK */
  70. #ifdef RT_USING_DMA
  71. #include "drivers/dma.h"
  72. #endif /* RT_USING_DMA */
  73. #include "drivers/iio.h"
  74. #ifdef RT_USING_NVME
  75. #include "drivers/nvme.h"
  76. #endif /* RT_USING_NVME */
  77. #ifdef RT_USING_OFW
  78. #include "drivers/ofw.h"
  79. #include "drivers/ofw_fdt.h"
  80. #include "drivers/ofw_io.h"
  81. #include "drivers/ofw_irq.h"
  82. #include "drivers/ofw_raw.h"
  83. #endif /* RT_USING_OFW */
  84. #ifdef RT_USING_PHYE
  85. #include "drivers/phye.h"
  86. #endif /* RT_USING_PHYE */
  87. #ifdef RT_USING_PIC
  88. #include "drivers/pic.h"
  89. #endif /* RT_USING_PIC */
  90. #ifdef RT_USING_PCI
  91. #include "drivers/pci.h"
  92. #ifdef RT_PCI_MSI
  93. #include "drivers/pci_msi.h"
  94. #endif /* RT_PCI_MSI */
  95. #ifdef RT_PCI_ENDPOINT
  96. #include "drivers/pci_endpoint.h"
  97. #endif /* RT_PCI_ENDPOINT */
  98. #endif /* RT_USING_PCI */
  99. #ifdef RT_USING_REGULATOR
  100. #include "drivers/regulator.h"
  101. #endif /* RT_USING_REGULATOR */
  102. #ifdef RT_USING_RESET
  103. #include "drivers/reset.h"
  104. #endif /* RT_USING_RESET */
  105. #ifdef RT_USING_SCSI
  106. #include "drivers/scsi.h"
  107. #endif /* RT_USING_SCSI */
  108. #ifdef RT_MFD_SYSCON
  109. #include "drivers/syscon.h"
  110. #endif /* RT_MFD_SYSCON */
  111. #ifdef RT_USING_THERMAL
  112. #include "drivers/thermal.h"
  113. #endif /* RT_USING_THERMAL */
  114. #ifdef RT_USING_FIRMWARE
  115. #ifdef RT_FIRMWARE_ARM_SCMI
  116. #include "drivers/scmi.h"
  117. #endif /* RT_FIRMWARE_ARM_SCMI */
  118. #endif /* RT_USING_FIRMWARE */
  119. #ifdef RT_USING_HWCACHE
  120. #include "drivers/hwcache.h"
  121. #endif /* RT_USING_HWCACHE */
  122. #ifdef RT_USING_POWER_SUPPLY
  123. #include "drivers/power_supply.h"
  124. #endif /* RT_USING_POWER_SUPPLY */
  125. #ifdef RT_USING_NVMEM
  126. #include "drivers/nvmem.h"
  127. #endif /* RT_USING_NVMEM */
  128. #endif /* RT_USING_DM */
  129. #ifdef RT_USING_RTC
  130. #include "drivers/dev_rtc.h"
  131. #ifdef RT_USING_ALARM
  132. #include "drivers/dev_alarm.h"
  133. #endif /* RT_USING_ALARM */
  134. #endif /* RT_USING_RTC */
  135. #ifdef RT_USING_SPI
  136. #include "drivers/dev_spi.h"
  137. #endif /* RT_USING_SPI */
  138. #ifdef RT_USING_MTD_NOR
  139. #include "drivers/mtd_nor.h"
  140. #endif /* RT_USING_MTD_NOR */
  141. #ifdef RT_USING_MTD_NAND
  142. #include "drivers/mtd_nand.h"
  143. #endif /* RT_USING_MTD_NAND */
  144. #ifdef RT_USING_USB_DEVICE
  145. #include "drivers/usb_device.h"
  146. #endif /* RT_USING_USB_DEVICE */
  147. #ifdef RT_USING_USB_HOST
  148. #include "drivers/usb_host.h"
  149. #endif /* RT_USING_USB_HOST */
  150. #ifdef RT_USING_SERIAL
  151. #ifdef RT_USING_SERIAL_V2
  152. #include "drivers/dev_serial_v2.h"
  153. #else
  154. #include "drivers/dev_serial.h"
  155. #endif /* RT_USING_SERIAL_V2 */
  156. #ifdef RT_USING_SERIAL_BYPASS
  157. #include "drivers/serial_bypass.h"
  158. #endif /* RT_USING_SERIAL_BYPASS */
  159. #endif /* RT_USING_SERIAL */
  160. #ifdef RT_USING_I2C
  161. #include "drivers/dev_i2c.h"
  162. #ifdef RT_USING_I2C_BITOPS
  163. #include "drivers/dev_i2c_bit_ops.h"
  164. #endif /* RT_USING_I2C_BITOPS */
  165. #ifdef RT_USING_DM
  166. #include "drivers/dev_i2c_dm.h"
  167. #endif /* RT_USING_DM */
  168. #endif /* RT_USING_I2C */
  169. #if defined(RT_USING_PHY) || defined(RT_USING_PHY_V2)
  170. #include "drivers/phy.h"
  171. #endif /* RT_USING_PHY || RT_USING_PHY_V2 */
  172. #ifdef RT_USING_SDIO
  173. #include "drivers/dev_mmcsd_core.h"
  174. #include "drivers/dev_sd.h"
  175. #include "drivers/dev_sdio.h"
  176. #if defined(RT_USING_DM) && defined(RT_USING_SDHCI)
  177. #include "drivers/dev_sdhci.h"
  178. #include "drivers/dev_sdhci_host.h"
  179. #endif /* RT_USING_DM && RT_USING_SDHCI */
  180. #endif /* RT_USING_SDIO */
  181. #ifdef RT_USING_WDT
  182. #include "drivers/dev_watchdog.h"
  183. #endif /* RT_USING_WDT */
  184. #ifdef RT_USING_PIN
  185. #include "drivers/dev_pin.h"
  186. #endif /* RT_USING_PIN */
  187. #ifdef RT_USING_SENSOR
  188. #ifdef RT_USING_SENSOR_V2
  189. #include "drivers/sensor_v2.h"
  190. #else
  191. #include "drivers/sensor.h"
  192. #endif /* RT_USING_SENSOR_V2 */
  193. #endif /* RT_USING_SENSOR */
  194. #ifdef RT_USING_CAN
  195. #include "drivers/dev_can.h"
  196. #endif /* RT_USING_CAN */
  197. #ifdef RT_USING_HWTIMER
  198. #include "drivers/hwtimer.h"
  199. #endif /* RT_USING_HWTIMER */
  200. #ifdef RT_USING_AUDIO
  201. #include "drivers/dev_audio.h"
  202. #endif /* RT_USING_AUDIO */
  203. #ifdef RT_USING_CPUTIME
  204. #include "drivers/cputime.h"
  205. #endif /* RT_USING_CPUTIME */
  206. #ifdef RT_USING_ADC
  207. #include "drivers/adc.h"
  208. #endif /* RT_USING_ADC */
  209. #ifdef RT_USING_DAC
  210. #include "drivers/dac.h"
  211. #endif /* RT_USING_DAC */
  212. #ifdef RT_USING_PWM
  213. #include "drivers/dev_pwm.h"
  214. #endif /* RT_USING_PWM */
  215. #ifdef RT_USING_PM
  216. #include "drivers/pm.h"
  217. #endif /* RT_USING_PM */
  218. #ifdef RT_USING_WIFI
  219. #include "drivers/wlan.h"
  220. #endif /* RT_USING_WIFI */
  221. #ifdef MTD_USING_NOR
  222. #include "drivers/mtdnor.h"
  223. #endif /* MTD_USING_NOR */
  224. #ifdef MTD_USING_NAND
  225. #include "drivers/mtdnand.h"
  226. #endif /* MTD_USING_NAND */
  227. #ifdef RT_USING_HWCRYPTO
  228. #include "drivers/crypto.h"
  229. #endif /* RT_USING_HWCRYPTO */
  230. #ifdef RT_USING_PULSE_ENCODER
  231. #include "drivers/pulse_encoder.h"
  232. #endif /* RT_USING_PULSE_ENCODER */
  233. #ifdef RT_USING_INPUT_CAPTURE
  234. #include "drivers/rt_inputcapture.h"
  235. #endif /* RT_USING_INPUT_CAPTURE */
  236. #ifdef RT_USING_TOUCH
  237. #include "drivers/dev_touch.h"
  238. #endif
  239. #ifdef RT_USING_DEV_BUS
  240. #include "drivers/rt_dev_bus.h"
  241. #endif
  242. #ifdef RT_USING_LCD
  243. #include "drivers/lcd.h"
  244. #endif
  245. #ifdef RT_USING_CLK
  246. #include "drivers/clk.h"
  247. #endif /* RT_USING_CLK */
  248. #ifdef __cplusplus
  249. }
  250. #endif
  251. #endif /* __RT_DEVICE_H__ */