1
0

rtdevice.h 5.5 KB

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