rtdevice.h 5.9 KB

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