Skip to content

Commit

Permalink
move SDIO driver header files to the drivers/include directory and up…
Browse files Browse the repository at this point in the history
…date rtdevice.h

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2209 bbd45198-f89e-11dd-88c7-29a3b14d5316
  • Loading branch information
weety committed Jul 8, 2012
1 parent 6ae04de commit 7729b4a
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bsp/at91sam9260/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#endif

#ifdef RT_USING_SDIO
#include <mmcsd_core.h>
#include <drivers/mmcsd_core.h>
#include "at91_mci.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion bsp/at91sam9260/at91_mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <rtthread.h>
#include <rthw.h>
#include <mmcsd_core.h>
#include <drivers/mmcsd_core.h>
#include <at91sam926x.h>
#include "at91_mci.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#ifndef __MMCSD_CARD_H__
#define __MMCSD_CARD_H__

#include "mmcsd_host.h"
#include "sdio.h"
#include <drivers/mmcsd_host.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -95,6 +94,39 @@ struct rt_sdio_cis {
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


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#define __CORE_H__

#include <rtthread.h>
#include "mmcsd_host.h"
#include "mmcsd_card.h"
#include "mmcsd_cmd.h"
#include <drivers/mmcsd_host.h>
#include <drivers/mmcsd_card.h>
#include <drivers/mmcsd_cmd.h>

#ifdef __cplusplus
extern "C" {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#include <rtthread.h>
#include "mmcsd_host.h"
#include <drivers/mmcsd_host.h>

#ifdef __cplusplus
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,14 @@


#include <rtthread.h>
#include "mmcsd_host.h"
#include "mmcsd_card.h"
#include "sdio_func_ids.h"
#include <drivers/mmcsd_host.h>
#include <drivers/mmcsd_card.h>
#include <drivers/sdio_func_ids.h>

#ifdef __cplusplus
extern "C" {
#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)
*/
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions components/drivers/include/rtdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,10 @@ rt_size_t rt_ringbuffer_emptry_size(struct rt_ringbuffer* rb);
#include "drivers/pm.h"
#endif

#ifdef RT_USING_SDIO
#include "drivers/mmcsd_core.h"
#include "drivers/sd.h"
#include "drivers/sdio.h"
#endif

#endif /* __RT_DEVICE_H__ */
2 changes: 1 addition & 1 deletion components/drivers/sdio/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sdio.c
""")

# 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)

Expand Down
3 changes: 1 addition & 2 deletions components/drivers/sdio/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include <rtthread.h>
#include <dfs_fs.h>

#include "mmcsd_core.h"
#include "mmcsd_cmd.h"
#include <drivers/mmcsd_core.h>

static rt_list_t blk_devices;

Expand Down
6 changes: 2 additions & 4 deletions components/drivers/sdio/mmcsd_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
*/

#include <rtthread.h>
#include "mmcsd_core.h"
#include "mmcsd_card.h"
#include "mmcsd_cmd.h"
#include "sd.h"
#include <drivers/mmcsd_core.h>
#include <drivers/sd.h>

#ifndef RT_MMCSD_STACK_SIZE
#define RT_MMCSD_STACK_SIZE 1024
Expand Down
4 changes: 2 additions & 2 deletions components/drivers/sdio/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* 2011-07-25 weety first version
*/

#include "mmcsd_core.h"
#include "mmcsd_cmd.h"
#include <drivers/mmcsd_core.h>
#include <drivers/sd.h>

static const rt_uint32_t tran_unit[] = {
10000, 100000, 1000000, 10000000,
Expand Down
4 changes: 2 additions & 2 deletions components/drivers/sdio/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* 2012-01-13 weety first version
*/

#include "mmcsd_core.h"
#include "mmcsd_cmd.h"
#include <drivers/mmcsd_core.h>
#include <drivers/sdio.h>

#ifndef RT_SDIO_STACK_SIZE
#define RT_SDIO_STACK_SIZE 512
Expand Down

0 comments on commit 7729b4a

Please sign in to comment.