summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-01-08 14:14:54 +0000
committer[email protected] <[email protected]>2012-01-08 14:14:54 +0000
commit5588bbe4d2401f436c8a09147094fa92b1b3322f (patch)
tree1173c7490fa080af35187e7ceda12277c5568b75 /components
parent107ed32e8071900380cccc7ac29b18317b449363 (diff)
add some device driver header files.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1910 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/drivers/include/drivers/mtd.h18
-rw-r--r--components/drivers/include/rtdevice.h22
-rw-r--r--components/drivers/mtd/SConscript8
-rw-r--r--components/drivers/spi/SConscript8
-rw-r--r--components/drivers/usb/SConscript2
5 files changed, 57 insertions, 1 deletions
diff --git a/components/drivers/include/drivers/mtd.h b/components/drivers/include/drivers/mtd.h
new file mode 100644
index 0000000000..7fcb28c3a2
--- /dev/null
+++ b/components/drivers/include/drivers/mtd.h
@@ -0,0 +1,18 @@
+#ifndef __MTD_H__
+#define __MTD_H__
+
+struct rt_mtd_device
+{
+ const struct rt_mtd_driver_ops* ops;
+};
+
+struct rt_mtd_driver_ops
+{
+ rt_uint32_t (*read_id) (rt_mtd_device* device);
+ rt_err_t (*read_page) (rt_mtd_device* device, rt_uint32_t page, rt_uint8_t *data, rt_uint8_t *spare);
+ rt_err_t (*write_page) (rt_mtd_device* device, rt_uint32_t page, rt_uint8_t *data, rt_uint8_t *spare);
+
+ rt_err_t (*erase_block)(rt_mtd_device* device, rt_uint32_t block);
+};
+
+#endif
diff --git a/components/drivers/include/rtdevice.h b/components/drivers/include/rtdevice.h
new file mode 100644
index 0000000000..41ce642556
--- /dev/null
+++ b/components/drivers/include/rtdevice.h
@@ -0,0 +1,22 @@
+#ifndef __RT_DEVICE_H__
+#define __RT_DEVICE_H__
+
+#include <rtthread.h>
+
+#ifdef RT_USING_SPI
+#include "drivers/spi.h"
+#endif
+
+#ifdef RT_USING_MTD
+#include "drivers/mtd.h"
+#endif
+
+#ifdef RT_USING_USB_DEVICE
+#include "drivers/usb_device.h"
+#endif
+
+#ifdef RT_USING_USB_HOST
+#include "drivers/usb_host.h"
+#endif
+
+#endif
diff --git a/components/drivers/mtd/SConscript b/components/drivers/mtd/SConscript
new file mode 100644
index 0000000000..6671d42b8f
--- /dev/null
+++ b/components/drivers/mtd/SConscript
@@ -0,0 +1,8 @@
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd + '/../include']
+group = DefineGroup('Drivers', src, depend = ['RT_USING_MTD'], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/drivers/spi/SConscript b/components/drivers/spi/SConscript
new file mode 100644
index 0000000000..930ebbee84
--- /dev/null
+++ b/components/drivers/spi/SConscript
@@ -0,0 +1,8 @@
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd + '/../include']
+group = DefineGroup('Drivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/drivers/usb/SConscript b/components/drivers/usb/SConscript
index 5a6486ef44..ecc8102c05 100644
--- a/components/drivers/usb/SConscript
+++ b/components/drivers/usb/SConscript
@@ -4,6 +4,6 @@ from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
-group = DefineGroup('USB', src, depend = ['RT_USING_USB_DEVICE'], CPPPATH = CPPPATH)
+group = DefineGroup('Drivers', src, depend = ['RT_USING_USB_DEVICE'], CPPPATH = CPPPATH)
Return('group')