rtdevice.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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_ATA
  42. #ifdef RT_ATA_AHCI
  43. #include "drivers/ahci.h"
  44. #endif /* RT_ATA_AHCI */
  45. #endif /* RT_USING_ATA */
  46. #ifdef RT_USING_LED
  47. #include "drivers/led.h"
  48. #endif /* RT_USING_LED */
  49. #ifdef RT_USING_INPUT
  50. #include "drivers/input.h"
  51. #ifdef RT_INPUT_UAPI
  52. #include "drivers/input_uapi.h"
  53. #endif
  54. #endif /* RT_USING_INPUT */
  55. #ifdef RT_USING_MBOX
  56. #include "drivers/mailbox.h"
  57. #endif /* RT_USING_MBOX */
  58. #ifdef RT_USING_HWSPINLOCK
  59. #include "drivers/hwspinlock.h"
  60. #endif /* RT_USING_HWSPINLOCK */
  61. #ifdef RT_USING_BLK
  62. #include "drivers/blk.h"
  63. #endif /* RT_USING_BLK */
  64. #ifdef RT_USING_DMA
  65. #include "drivers/dma.h"
  66. #endif /* RT_USING_DMA */
  67. #include "drivers/iio.h"
  68. #ifdef RT_USING_NVME
  69. #include "drivers/nvme.h"
  70. #endif /* RT_USING_NVME */
  71. #ifdef RT_USING_OFW
  72. #include "drivers/ofw.h"
  73. #include "drivers/ofw_fdt.h"
  74. #include "drivers/ofw_io.h"
  75. #include "drivers/ofw_irq.h"
  76. #include "drivers/ofw_raw.h"
  77. #endif /* RT_USING_OFW */
  78. #ifdef RT_USING_PHYE
  79. #include "drivers/phye.h"
  80. #endif /* RT_USING_PHYE */
  81. #ifdef RT_USING_PIC
  82. #include "drivers/pic.h"
  83. #endif /* RT_USING_PIC */
  84. #ifdef RT_USING_PCI
  85. #include "drivers/pci.h"
  86. #ifdef RT_PCI_MSI
  87. #include "drivers/pci_msi.h"
  88. #endif /* RT_PCI_MSI */
  89. #ifdef RT_PCI_ENDPOINT
  90. #include "drivers/pci_endpoint.h"
  91. #endif /* RT_PCI_ENDPOINT */
  92. #endif /* RT_USING_PCI */
  93. #ifdef RT_USING_REGULATOR
  94. #include "drivers/regulator.h"
  95. #endif /* RT_USING_REGULATOR */
  96. #ifdef RT_USING_RESET
  97. #include "drivers/reset.h"
  98. #endif /* RT_USING_RESET */
  99. #ifdef RT_USING_SCSI
  100. #include "drivers/scsi.h"
  101. #endif /* RT_USING_SCSI */
  102. #ifdef RT_MFD_SYSCON
  103. #include "drivers/syscon.h"
  104. #endif /* RT_MFD_SYSCON */
  105. #ifdef RT_USING_THERMAL
  106. #include "drivers/thermal.h"
  107. #endif /* RT_USING_THERMAL */
  108. #ifdef RT_USING_HWCACHE
  109. #include "drivers/hwcache.h"
  110. #endif /* RT_USING_HWCACHE */
  111. #ifdef RT_USING_NVMEM
  112. #include "drivers/nvmem.h"
  113. #endif /* RT_USING_NVMEM */
  114. #endif /* RT_USING_DM */
  115. #ifdef RT_USING_RTC
  116. #include "drivers/dev_rtc.h"
  117. #ifdef RT_USING_ALARM
  118. #include "drivers/dev_alarm.h"
  119. #endif /* RT_USING_ALARM */
  120. #endif /* RT_USING_RTC */
  121. #ifdef RT_USING_SPI
  122. #include "drivers/dev_spi.h"
  123. #endif /* RT_USING_SPI */
  124. #ifdef RT_USING_MTD_NOR
  125. #include "drivers/mtd_nor.h"
  126. #endif /* RT_USING_MTD_NOR */
  127. #ifdef RT_USING_MTD_NAND
  128. #include "drivers/mtd_nand.h"
  129. #endif /* RT_USING_MTD_NAND */
  130. #ifdef RT_USING_USB_DEVICE
  131. #include "drivers/usb_device.h"
  132. #endif /* RT_USING_USB_DEVICE */
  133. #ifdef RT_USING_USB_HOST
  134. #include "drivers/usb_host.h"
  135. #endif /* RT_USING_USB_HOST */
  136. #ifdef RT_USING_SERIAL
  137. #ifdef RT_USING_SERIAL_V2
  138. #include "drivers/dev_serial_v2.h"
  139. #else
  140. #include "drivers/dev_serial.h"
  141. #endif /* RT_USING_SERIAL_V2 */
  142. #ifdef RT_USING_SERIAL_BYPASS
  143. #include "drivers/serial_bypass.h"
  144. #endif /* RT_USING_SERIAL_BYPASS */
  145. #endif /* RT_USING_SERIAL */
  146. #ifdef RT_USING_I2C
  147. #include "drivers/dev_i2c.h"
  148. #ifdef RT_USING_I2C_BITOPS
  149. #include "drivers/dev_i2c_bit_ops.h"
  150. #endif /* RT_USING_I2C_BITOPS */
  151. #ifdef RT_USING_DM
  152. #include "drivers/dev_i2c_dm.h"
  153. #endif /* RT_USING_DM */
  154. #endif /* RT_USING_I2C */
  155. #if defined(RT_USING_PHY) || defined(RT_USING_PHY_V2)
  156. #include "drivers/phy.h"
  157. #endif /* RT_USING_PHY || RT_USING_PHY_V2 */
  158. #ifdef RT_USING_SDIO
  159. #include "drivers/dev_mmcsd_core.h"
  160. #include "drivers/dev_sd.h"
  161. #include "drivers/dev_sdio.h"
  162. #endif /* RT_USING_SDIO */
  163. #ifdef RT_USING_WDT
  164. #include "drivers/dev_watchdog.h"
  165. #endif /* RT_USING_WDT */
  166. #ifdef RT_USING_PIN
  167. #include "drivers/dev_pin.h"
  168. #endif /* RT_USING_PIN */
  169. #ifdef RT_USING_SENSOR
  170. #ifdef RT_USING_SENSOR_V2
  171. #include "drivers/sensor_v2.h"
  172. #else
  173. #include "drivers/sensor.h"
  174. #endif /* RT_USING_SENSOR_V2 */
  175. #endif /* RT_USING_SENSOR */
  176. #ifdef RT_USING_CAN
  177. #include "drivers/dev_can.h"
  178. #endif /* RT_USING_CAN */
  179. #ifdef RT_USING_HWTIMER
  180. #include "drivers/hwtimer.h"
  181. #endif /* RT_USING_HWTIMER */
  182. #ifdef RT_USING_AUDIO
  183. #include "drivers/dev_audio.h"
  184. #endif /* RT_USING_AUDIO */
  185. #ifdef RT_USING_CPUTIME
  186. #include "drivers/cputime.h"
  187. #endif /* RT_USING_CPUTIME */
  188. #ifdef RT_USING_ADC
  189. #include "drivers/adc.h"
  190. #endif /* RT_USING_ADC */
  191. #ifdef RT_USING_DAC
  192. #include "drivers/dac.h"
  193. #endif /* RT_USING_DAC */
  194. #ifdef RT_USING_PWM
  195. #include "drivers/dev_pwm.h"
  196. #endif /* RT_USING_PWM */
  197. #ifdef RT_USING_PM
  198. #include "drivers/pm.h"
  199. #endif /* RT_USING_PM */
  200. #ifdef RT_USING_WIFI
  201. #include "drivers/wlan.h"
  202. #endif /* RT_USING_WIFI */
  203. #ifdef MTD_USING_NOR
  204. #include "drivers/mtdnor.h"
  205. #endif /* MTD_USING_NOR */
  206. #ifdef MTD_USING_NAND
  207. #include "drivers/mtdnand.h"
  208. #endif /* MTD_USING_NAND */
  209. #ifdef RT_USING_HWCRYPTO
  210. #include "drivers/crypto.h"
  211. #endif /* RT_USING_HWCRYPTO */
  212. #ifdef RT_USING_PULSE_ENCODER
  213. #include "drivers/pulse_encoder.h"
  214. #endif /* RT_USING_PULSE_ENCODER */
  215. #ifdef RT_USING_INPUT_CAPTURE
  216. #include "drivers/rt_inputcapture.h"
  217. #endif /* RT_USING_INPUT_CAPTURE */
  218. #ifdef RT_USING_TOUCH
  219. #include "drivers/dev_touch.h"
  220. #endif
  221. #ifdef RT_USING_DEV_BUS
  222. #include "drivers/rt_dev_bus.h"
  223. #endif
  224. #ifdef RT_USING_LCD
  225. #include "drivers/lcd.h"
  226. #endif
  227. #ifdef RT_USING_CLK
  228. #include "drivers/clk.h"
  229. #endif /* RT_USING_CLK */
  230. #ifdef __cplusplus
  231. }
  232. #endif
  233. #endif /* __RT_DEVICE_H__ */