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