提交 7729b4a1 编写于 作者: L luohui2320@gmail.com

move SDIO driver header files to the drivers/include directory and update rtdevice.h

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2209 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 6ae04def
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#endif #endif
#ifdef RT_USING_SDIO #ifdef RT_USING_SDIO
#include <mmcsd_core.h> #include <drivers/mmcsd_core.h>
#include "at91_mci.h" #include "at91_mci.h"
#endif #endif
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <rtthread.h> #include <rtthread.h>
#include <rthw.h> #include <rthw.h>
#include <mmcsd_core.h> #include <drivers/mmcsd_core.h>
#include <at91sam926x.h> #include <at91sam926x.h>
#include "at91_mci.h" #include "at91_mci.h"
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
#ifndef __MMCSD_CARD_H__ #ifndef __MMCSD_CARD_H__
#define __MMCSD_CARD_H__ #define __MMCSD_CARD_H__
#include "mmcsd_host.h" #include <drivers/mmcsd_host.h>
#include "sdio.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -95,6 +94,39 @@ struct rt_sdio_cis { ...@@ -95,6 +94,39 @@ struct rt_sdio_cis {
rt_uint32_t max_tran_speed; rt_uint32_t max_tran_speed;
}; };
/*
* SDIO function CIS tuple (unknown to the core)
*/
struct rt_sdio_function_tuple {
struct rt_sdio_function_tuple *next;
rt_uint8_t code;
rt_uint8_t size;
rt_uint8_t *data;
};
struct rt_sdio_function;
typedef void (rt_sdio_irq_handler_t)(struct rt_sdio_function *);
/*
* SDIO function devices
*/
struct rt_sdio_function {
struct rt_mmcsd_card *card; /* the card this device belongs to */
rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */
rt_uint8_t num; /* function number */
rt_uint8_t func_code; /* Standard SDIO Function interface code */
rt_uint16_t manufacturer; /* manufacturer id */
rt_uint16_t product; /* product id */
rt_uint32_t max_blk_size; /* maximum block size */
rt_uint32_t cur_blk_size; /* current block size */
rt_uint32_t enable_timeout_val; /* max enable timeout in msec */
struct rt_sdio_function_tuple *tuples;
};
#define SDIO_MAX_FUNCTIONS 7 #define SDIO_MAX_FUNCTIONS 7
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#define __CORE_H__ #define __CORE_H__
#include <rtthread.h> #include <rtthread.h>
#include "mmcsd_host.h" #include <drivers/mmcsd_host.h>
#include "mmcsd_card.h" #include <drivers/mmcsd_card.h>
#include "mmcsd_cmd.h" #include <drivers/mmcsd_cmd.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#include <rtthread.h> #include <rtthread.h>
#include "mmcsd_host.h" #include <drivers/mmcsd_host.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -18,48 +18,14 @@ ...@@ -18,48 +18,14 @@
#include <rtthread.h> #include <rtthread.h>
#include "mmcsd_host.h" #include <drivers/mmcsd_host.h>
#include "mmcsd_card.h" #include <drivers/mmcsd_card.h>
#include "sdio_func_ids.h" #include <drivers/sdio_func_ids.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct rt_sdio_function;
typedef void (rt_sdio_irq_handler_t)(struct rt_sdio_function *);
/*
* SDIO function CIS tuple (unknown to the core)
*/
struct rt_sdio_function_tuple {
struct rt_sdio_function_tuple *next;
rt_uint8_t code;
rt_uint8_t size;
rt_uint8_t *data;
};
/*
* SDIO function devices
*/
struct rt_sdio_function {
struct rt_mmcsd_card *card; /* the card this device belongs to */
rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */
rt_uint8_t num; /* function number */
rt_uint8_t func_code; /* Standard SDIO Function interface code */
rt_uint16_t manufacturer; /* manufacturer id */
rt_uint16_t product; /* product id */
rt_uint32_t max_blk_size; /* maximum block size */
rt_uint32_t cur_blk_size; /* current block size */
rt_uint32_t enable_timeout_val; /* max enable timeout in msec */
struct rt_sdio_function_tuple *tuples;
};
/* /*
* Card Common Control Registers (CCCR) * Card Common Control Registers (CCCR)
*/ */
......
...@@ -90,4 +90,10 @@ rt_size_t rt_ringbuffer_emptry_size(struct rt_ringbuffer* rb); ...@@ -90,4 +90,10 @@ rt_size_t rt_ringbuffer_emptry_size(struct rt_ringbuffer* rb);
#include "drivers/pm.h" #include "drivers/pm.h"
#endif #endif
#ifdef RT_USING_SDIO
#include "drivers/mmcsd_core.h"
#include "drivers/sd.h"
#include "drivers/sdio.h"
#endif
#endif /* __RT_DEVICE_H__ */ #endif /* __RT_DEVICE_H__ */
...@@ -10,7 +10,7 @@ sdio.c ...@@ -10,7 +10,7 @@ sdio.c
""") """)
# The set of source files associated with this SConscript file. # The set of source files associated with this SConscript file.
path = [cwd] path = [cwd + '/../include']
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SDIO'], CPPPATH = path) group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SDIO'], CPPPATH = path)
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
#include <rtthread.h> #include <rtthread.h>
#include <dfs_fs.h> #include <dfs_fs.h>
#include "mmcsd_core.h" #include <drivers/mmcsd_core.h>
#include "mmcsd_cmd.h"
static rt_list_t blk_devices; static rt_list_t blk_devices;
......
...@@ -13,10 +13,8 @@ ...@@ -13,10 +13,8 @@
*/ */
#include <rtthread.h> #include <rtthread.h>
#include "mmcsd_core.h" #include <drivers/mmcsd_core.h>
#include "mmcsd_card.h" #include <drivers/sd.h>
#include "mmcsd_cmd.h"
#include "sd.h"
#ifndef RT_MMCSD_STACK_SIZE #ifndef RT_MMCSD_STACK_SIZE
#define RT_MMCSD_STACK_SIZE 1024 #define RT_MMCSD_STACK_SIZE 1024
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
* 2011-07-25 weety first version * 2011-07-25 weety first version
*/ */
#include "mmcsd_core.h" #include <drivers/mmcsd_core.h>
#include "mmcsd_cmd.h" #include <drivers/sd.h>
static const rt_uint32_t tran_unit[] = { static const rt_uint32_t tran_unit[] = {
10000, 100000, 1000000, 10000000, 10000, 100000, 1000000, 10000000,
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
* 2012-01-13 weety first version * 2012-01-13 weety first version
*/ */
#include "mmcsd_core.h" #include <drivers/mmcsd_core.h>
#include "mmcsd_cmd.h" #include <drivers/sdio.h>
#ifndef RT_SDIO_STACK_SIZE #ifndef RT_SDIO_STACK_SIZE
#define RT_SDIO_STACK_SIZE 512 #define RT_SDIO_STACK_SIZE 512
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册