add some device driver header files.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1910 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
107ed32e80
commit
5588bbe4d2
|
@ -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
|
|
@ -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
|
|
@ -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')
|
|
@ -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')
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue