Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
621fbdb9
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
621fbdb9
编写于
6月 28, 2013
作者:
Y
yiyue.fang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Embedded GPLv2 license in drivers
上级
90ac1c9b
变更
49
显示空白变更内容
内联
并排
Showing
49 changed file
with
3383 addition
and
2740 deletion
+3383
-2740
components/drivers/i2c/i2c-bit-ops.c
components/drivers/i2c/i2c-bit-ops.c
+13
-3
components/drivers/i2c/i2c_core.c
components/drivers/i2c/i2c_core.c
+13
-3
components/drivers/i2c/i2c_dev.c
components/drivers/i2c/i2c_dev.c
+13
-3
components/drivers/include/drivers/alarm.h
components/drivers/include/drivers/alarm.h
+13
-3
components/drivers/include/drivers/i2c-bit-ops.h
components/drivers/include/drivers/i2c-bit-ops.h
+13
-3
components/drivers/include/drivers/i2c.h
components/drivers/include/drivers/i2c.h
+13
-3
components/drivers/include/drivers/i2c_dev.h
components/drivers/include/drivers/i2c_dev.h
+13
-3
components/drivers/include/drivers/mmcsd_card.h
components/drivers/include/drivers/mmcsd_card.h
+13
-3
components/drivers/include/drivers/mmcsd_cmd.h
components/drivers/include/drivers/mmcsd_cmd.h
+13
-3
components/drivers/include/drivers/mmcsd_core.h
components/drivers/include/drivers/mmcsd_core.h
+13
-3
components/drivers/include/drivers/mmcsd_host.h
components/drivers/include/drivers/mmcsd_host.h
+13
-3
components/drivers/include/drivers/mtd_nand.h
components/drivers/include/drivers/mtd_nand.h
+13
-3
components/drivers/include/drivers/mtd_nor.h
components/drivers/include/drivers/mtd_nor.h
+13
-3
components/drivers/include/drivers/rtc.h
components/drivers/include/drivers/rtc.h
+13
-3
components/drivers/include/drivers/sd.h
components/drivers/include/drivers/sd.h
+18
-7
components/drivers/include/drivers/sdio.h
components/drivers/include/drivers/sdio.h
+132
-95
components/drivers/include/drivers/sdio_func_ids.h
components/drivers/include/drivers/sdio_func_ids.h
+24
-15
components/drivers/include/drivers/serial.h
components/drivers/include/drivers/serial.h
+13
-3
components/drivers/include/drivers/spi.h
components/drivers/include/drivers/spi.h
+13
-3
components/drivers/include/drivers/usb_device.h
components/drivers/include/drivers/usb_device.h
+35
-12
components/drivers/include/drivers/usb_host.h
components/drivers/include/drivers/usb_host.h
+87
-43
components/drivers/include/rtdevice.h
components/drivers/include/rtdevice.h
+13
-3
components/drivers/mtd/mtd_nand.c
components/drivers/mtd/mtd_nand.c
+13
-3
components/drivers/mtd/mtd_nor.c
components/drivers/mtd/mtd_nor.c
+13
-3
components/drivers/rtc/alarm.c
components/drivers/rtc/alarm.c
+13
-3
components/drivers/rtc/rtc.c
components/drivers/rtc/rtc.c
+13
-3
components/drivers/sdio/block_dev.c
components/drivers/sdio/block_dev.c
+384
-358
components/drivers/sdio/mmcsd_core.c
components/drivers/sdio/mmcsd_core.c
+486
-464
components/drivers/sdio/sd.c
components/drivers/sdio/sd.c
+615
-585
components/drivers/sdio/sdio.c
components/drivers/sdio/sdio.c
+1082
-1041
components/drivers/serial/serial.c
components/drivers/serial/serial.c
+13
-3
components/drivers/spi/spi_core.c
components/drivers/spi/spi_core.c
+13
-3
components/drivers/spi/spi_dev.c
components/drivers/spi/spi_dev.c
+13
-3
components/drivers/src/completion.c
components/drivers/src/completion.c
+13
-3
components/drivers/src/dataqueue.c
components/drivers/src/dataqueue.c
+13
-3
components/drivers/src/pipe.c
components/drivers/src/pipe.c
+13
-3
components/drivers/src/ringbuffer.c
components/drivers/src/ringbuffer.c
+13
-3
components/drivers/usb/usbdevice/class/cdc.h
components/drivers/usb/usbdevice/class/cdc.h
+13
-3
components/drivers/usb/usbdevice/class/cdc_vcom.c
components/drivers/usb/usbdevice/class/cdc_vcom.c
+13
-3
components/drivers/usb/usbdevice/class/mstorage.c
components/drivers/usb/usbdevice/class/mstorage.c
+13
-3
components/drivers/usb/usbdevice/class/mstorage.h
components/drivers/usb/usbdevice/class/mstorage.h
+13
-3
components/drivers/usb/usbdevice/core/core.c
components/drivers/usb/usbdevice/core/core.c
+13
-3
components/drivers/usb/usbdevice/core/usbdevice.c
components/drivers/usb/usbdevice/core/usbdevice.c
+13
-3
components/drivers/usb/usbhost/class/adk.c
components/drivers/usb/usbhost/class/adk.c
+13
-3
components/drivers/usb/usbhost/class/adk.h
components/drivers/usb/usbhost/class/adk.h
+13
-3
components/drivers/usb/usbhost/core/core.c
components/drivers/usb/usbhost/core/core.c
+13
-3
components/drivers/usb/usbhost/core/driver.c
components/drivers/usb/usbhost/core/driver.c
+13
-3
components/drivers/usb/usbhost/core/hub.c
components/drivers/usb/usbhost/core/hub.c
+13
-3
components/drivers/usb/usbhost/core/usbhost.c
components/drivers/usb/usbhost/core/usbhost.c
+13
-3
未找到文件。
components/drivers/i2c/i2c-bit-ops.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/i2c/i2c_core.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/i2c/i2c_dev.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/alarm.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/i2c-bit-ops.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/i2c.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/i2c_dev.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mmcsd_card.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mmcsd_cmd.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mmcsd_core.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mmcsd_host.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mtd_nand.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/mtd_nor.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, Shanghai Real-Thread Technology Co., Ltd
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/rtc.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/sd.h
浏览文件 @
621fbdb9
#ifndef __SD_H__
#define __SD_H__
/*
* File : sd.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2011-07-25 weety first version
*/
#ifndef __SD_H__
#define __SD_H__
#include <rtthread.h>
#include <drivers/mmcsd_host.h>
...
...
components/drivers/include/drivers/sdio.h
浏览文件 @
621fbdb9
...
...
@@ -3,20 +3,28 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2012-01-15 weety first version
*/
#ifndef __SDIO_H__
#define __SDIO_H__
#include <rtthread.h>
#include <drivers/mmcsd_host.h>
#include <drivers/mmcsd_card.h>
...
...
@@ -124,7 +132,6 @@ extern "C" {
#define SDIO_REG_FBR_BLKSIZE 0x10
/* block size (2 bytes) */
/* SDIO CIS Tuple code */
#define CISTPL_NULL 0x00
#define CISTPL_CHECKSUM 0x10
...
...
@@ -142,55 +149,85 @@ extern "C" {
#define SDIO_ANY_MAN_ID 0xffff
#define SDIO_ANY_PROD_ID 0xffff
struct
rt_sdio_device_id
{
struct
rt_sdio_device_id
{
rt_uint8_t
func_code
;
rt_uint16_t
manufacturer
;
rt_uint16_t
product
;
};
struct
rt_sdio_driver
{
struct
rt_sdio_driver
{
char
*
name
;
rt_int32_t
(
*
probe
)(
struct
rt_mmcsd_card
*
card
);
rt_int32_t
(
*
remove
)(
struct
rt_mmcsd_card
*
card
);
struct
rt_sdio_device_id
*
id
;
};
rt_int32_t
sdio_io_send_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
cmd5_resp
);
rt_int32_t
sdio_io_rw_direct
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
reg_addr
,
rt_uint8_t
*
pdata
,
rt_uint8_t
raw
);
rt_int32_t
sdio_io_rw_extended
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
blocks
,
rt_uint32_t
blksize
);
rt_int32_t
sdio_io_send_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
cmd5_resp
);
rt_int32_t
sdio_io_rw_direct
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
reg_addr
,
rt_uint8_t
*
pdata
,
rt_uint8_t
raw
);
rt_int32_t
sdio_io_rw_extended
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
blocks
,
rt_uint32_t
blksize
);
rt_uint8_t
sdio_io_readb
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
reg
,
rt_int32_t
*
err
);
rt_uint32_t
reg
,
rt_int32_t
*
err
);
rt_int32_t
sdio_io_writeb
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
reg
,
rt_uint8_t
data
);
rt_uint16_t
sdio_io_readw
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
);
rt_int32_t
sdio_io_writew
(
struct
rt_sdio_function
*
func
,
rt_uint16_t
data
,
rt_uint32_t
addr
);
rt_uint32_t
sdio_io_readl
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
);
rt_int32_t
sdio_io_writel
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
data
,
rt_uint32_t
addr
);
rt_uint32_t
reg
,
rt_uint8_t
data
);
rt_uint16_t
sdio_io_readw
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
);
rt_int32_t
sdio_io_writew
(
struct
rt_sdio_function
*
func
,
rt_uint16_t
data
,
rt_uint32_t
addr
);
rt_uint32_t
sdio_io_readl
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
);
rt_int32_t
sdio_io_writel
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
data
,
rt_uint32_t
addr
);
rt_int32_t
sdio_io_read_multi_fifo_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_int32_t
sdio_io_write_multi_fifo_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_int32_t
sdio_io_read_multi_incr_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_int32_t
sdio_io_write_multi_incr_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
);
rt_int32_t
init_sdio
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
);
rt_int32_t
sdio_attach_irq
(
struct
rt_sdio_function
*
func
,
rt_sdio_irq_handler_t
*
handler
);
rt_int32_t
sdio_attach_irq
(
struct
rt_sdio_function
*
func
,
rt_sdio_irq_handler_t
*
handler
);
rt_int32_t
sdio_detach_irq
(
struct
rt_sdio_function
*
func
);
void
sdio_irq_wakeup
(
struct
rt_mmcsd_host
*
host
);
rt_int32_t
sdio_enable_func
(
struct
rt_sdio_function
*
func
);
rt_int32_t
sdio_disable_func
(
struct
rt_sdio_function
*
func
);
rt_int32_t
sdio_set_block_size
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
blksize
);
rt_int32_t
sdio_set_block_size
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
blksize
);
rt_int32_t
sdio_register_driver
(
struct
rt_sdio_driver
*
driver
);
rt_int32_t
sdio_unregister_driver
(
struct
rt_sdio_driver
*
driver
);
void
rt_sdio_init
(
void
);
#ifdef __cplusplus
}
#endif
...
...
components/drivers/include/drivers/sdio_func_ids.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -15,7 +25,6 @@
#ifndef __SDIO_FUNC_IDS_H__
#define __SDIO_FUNC_IDS_H__
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
components/drivers/include/drivers/serial.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/spi.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/include/drivers/usb_device.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -175,15 +185,16 @@ typedef struct udev_msg* udev_msg_t;
udevice_t
rt_usbd_device_create
(
void
);
uconfig_t
rt_usbd_config_create
(
void
);
uclass_t
rt_usbd_class_create
(
udevice_t
device
,
udev_desc_t
dev_desc
,
uclass_t
rt_usbd_class_create
(
udevice_t
device
,
udev_desc_t
dev_desc
,
uclass_ops_t
ops
);
uintf_t
rt_usbd_interface_create
(
udevice_t
device
,
uintf_handler_t
handler
);
uep_t
rt_usbd_endpoint_create
(
uep_desc_t
ep_desc
,
udep_handler_t
handler
);
ualtsetting_t
rt_usbd_altsetting_create
(
rt_size_t
desc_size
);
rt_err_t
rt_usbd_core_init
(
void
);
rt_err_t
rt_usb_device_init
(
const
char
*
udc_name
);
rt_err_t
rt_usbd_post_event
(
struct
udev_msg
*
msg
,
rt_size_t
size
);
rt_err_t
rt_usb_device_init
(
const
char
*
udc_name
);
rt_err_t
rt_usbd_post_event
(
struct
udev_msg
*
msg
,
rt_size_t
size
);
rt_err_t
rt_usbd_free_device
(
udevice_t
device
);
rt_err_t
rt_usbd_device_set_controller
(
udevice_t
device
,
udcd_t
dcd
);
rt_err_t
rt_usbd_device_set_descriptor
(
udevice_t
device
,
udev_desc_t
dev_desc
);
...
...
@@ -193,14 +204,20 @@ rt_err_t rt_usbd_config_add_class(uconfig_t cfg, uclass_t cls);
rt_err_t
rt_usbd_class_add_interface
(
uclass_t
cls
,
uintf_t
intf
);
rt_err_t
rt_usbd_interface_add_altsetting
(
uintf_t
intf
,
ualtsetting_t
setting
);
rt_err_t
rt_usbd_altsetting_add_endpoint
(
ualtsetting_t
setting
,
uep_t
ep
);
rt_err_t
rt_usbd_altsetting_config_descriptor
(
ualtsetting_t
setting
,
const
void
*
desc
,
rt_off_t
intf_pos
);
rt_err_t
rt_usbd_altsetting_config_descriptor
(
ualtsetting_t
setting
,
const
void
*
desc
,
rt_off_t
intf_pos
);
rt_err_t
rt_usbd_set_config
(
udevice_t
device
,
rt_uint8_t
value
);
rt_err_t
rt_usbd_set_altsetting
(
uintf_t
intf
,
rt_uint8_t
value
);
udevice_t
rt_usbd_find_device
(
udcd_t
dcd
);
uconfig_t
rt_usbd_find_config
(
udevice_t
device
,
rt_uint8_t
value
);
uintf_t
rt_usbd_find_interface
(
udevice_t
device
,
rt_uint8_t
value
,
uclass_t
*
pcls
);
uep_t
rt_usbd_find_endpoint
(
udevice_t
device
,
uclass_t
*
pcls
,
rt_uint8_t
ep_addr
);
uintf_t
rt_usbd_find_interface
(
udevice_t
device
,
rt_uint8_t
value
,
uclass_t
*
pcls
);
uep_t
rt_usbd_find_endpoint
(
udevice_t
device
,
uclass_t
*
pcls
,
rt_uint8_t
ep_addr
);
uclass_t
rt_usbd_class_mstorage_create
(
udevice_t
device
);
uclass_t
rt_usbd_class_cdc_create
(
udevice_t
device
);
...
...
@@ -218,14 +235,18 @@ rt_inline rt_err_t dcd_set_address(udcd_t dcd, rt_uint8_t value)
return
dcd
->
ops
->
set_address
(
value
);
}
rt_inline
rt_err_t
dcd_clear_feature
(
udcd_t
dcd
,
rt_uint16_t
value
,
rt_uint16_t
index
)
rt_inline
rt_err_t
dcd_clear_feature
(
udcd_t
dcd
,
rt_uint16_t
value
,
rt_uint16_t
index
)
{
RT_ASSERT
(
dcd
!=
RT_NULL
);
return
dcd
->
ops
->
clear_feature
(
value
,
index
);
}
rt_inline
rt_err_t
dcd_set_feature
(
udcd_t
dcd
,
rt_uint8_t
value
,
rt_uint16_t
index
)
rt_inline
rt_err_t
dcd_set_feature
(
udcd_t
dcd
,
rt_uint8_t
value
,
rt_uint16_t
index
)
{
RT_ASSERT
(
dcd
!=
RT_NULL
);
...
...
@@ -275,7 +296,9 @@ rt_inline rt_err_t dcd_ep_read(udcd_t dcd, uep_t ep, void *buffer,
return
dcd
->
ops
->
ep_read
(
ep
,
buffer
,
size
);
}
rt_inline
rt_size_t
dcd_ep_write
(
udcd_t
dcd
,
uep_t
ep
,
void
*
buffer
,
rt_inline
rt_size_t
dcd_ep_write
(
udcd_t
dcd
,
uep_t
ep
,
void
*
buffer
,
rt_size_t
size
)
{
RT_ASSERT
(
dcd
!=
RT_NULL
);
...
...
components/drivers/include/drivers/usb_host.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -167,23 +177,27 @@ void rt_usb_hub_thread(void);
uinst_t
rt_usb_alloc_instance
(
void
);
rt_err_t
rt_usb_attatch_instance
(
uinst_t
uinst
);
rt_err_t
rt_usb_detach_instance
(
uinst_t
uinst
);
rt_err_t
rt_usb_get_descriptor
(
uinst_t
uinst
,
rt_uint8_t
type
,
void
*
buffer
,
rt_err_t
rt_usb_get_descriptor
(
uinst_t
uinst
,
rt_uint8_t
type
,
void
*
buffer
,
int
nbytes
);
rt_err_t
rt_usb_set_configure
(
uinst_t
uinst
,
int
config
);
rt_err_t
rt_usb_set_address
(
uinst_t
uinst
);
rt_err_t
rt_usb_set_interface
(
uinst_t
uinst
,
int
intf
);
rt_err_t
rt_usb_clear_feature
(
uinst_t
uinst
,
int
endpoint
,
int
feature
);
rt_err_t
rt_usb_get_interface_descriptor
(
ucfg_desc_t
cfg_desc
,
int
num
,
uintf_desc_t
*
intf_desc
);
rt_err_t
rt_usb_get_endpoint_descriptor
(
uintf_desc_t
intf_desc
,
int
num
,
uep_desc_t
*
ep_desc
);
rt_err_t
rt_usb_get_interface_descriptor
(
ucfg_desc_t
cfg_desc
,
int
num
,
uintf_desc_t
*
intf_desc
);
rt_err_t
rt_usb_get_endpoint_descriptor
(
uintf_desc_t
intf_desc
,
int
num
,
uep_desc_t
*
ep_desc
);
/* usb class driver interface */
rt_err_t
rt_usb_class_driver_init
(
void
);
rt_err_t
rt_usb_class_driver_register
(
ucd_t
drv
);
rt_err_t
rt_usb_class_driver_unregister
(
ucd_t
drv
);
rt_err_t
rt_usb_class_driver_run
(
ucd_t
drv
,
void
*
args
);
rt_err_t
rt_usb_class_driver_stop
(
ucd_t
drv
,
void
*
args
);
rt_err_t
rt_usb_class_driver_run
(
ucd_t
drv
,
void
*
args
);
rt_err_t
rt_usb_class_driver_stop
(
ucd_t
drv
,
void
*
args
);
ucd_t
rt_usb_class_driver_find
(
int
class_code
,
int
subclass_code
);
/* usb class driver implement */
...
...
@@ -197,28 +211,39 @@ uprotocal_t rt_usb_hid_protocal_kbd(void);
uprotocal_t
rt_usb_hid_protocal_mouse
(
void
);
/* usb adk class driver interface */
rt_err_t
rt_usb_adk_set_string
(
const
char
*
manufacturer
,
const
char
*
model
,
const
char
*
description
,
const
char
*
version
,
const
char
*
uri
,
const
char
*
serial
);
rt_err_t
rt_usb_adk_set_string
(
const
char
*
manufacturer
,
const
char
*
model
,
const
char
*
description
,
const
char
*
version
,
const
char
*
uri
,
const
char
*
serial
);
/* usb hub interface */
rt_err_t
rt_usb_hub_get_descriptor
(
uinst_t
uinst
,
rt_uint8_t
*
buffer
,
rt_err_t
rt_usb_hub_get_descriptor
(
uinst_t
uinst
,
rt_uint8_t
*
buffer
,
rt_size_t
size
);
rt_err_t
rt_usb_hub_get_status
(
uinst_t
uinst
,
rt_uint8_t
*
buffer
);
rt_err_t
rt_usb_hub_get_port_status
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_uint8_t
*
buffer
);
rt_err_t
rt_usb_hub_clear_port_feature
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_err_t
rt_usb_hub_get_status
(
uinst_t
uinst
,
rt_uint8_t
*
buffer
);
rt_err_t
rt_usb_hub_get_port_status
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_uint8_t
*
buffer
);
rt_err_t
rt_usb_hub_clear_port_feature
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_uint16_t
feature
);
rt_err_t
rt_usb_hub_set_port_feature
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_err_t
rt_usb_hub_set_port_feature
(
uhubinst_t
uhub
,
rt_uint16_t
port
,
rt_uint16_t
feature
);
rt_err_t
rt_usb_hub_reset_port
(
uhubinst_t
uhub
,
rt_uint16_t
port
);
rt_err_t
rt_usb_post_event
(
struct
uhost_msg
*
msg
,
rt_size_t
size
);
/* usb host controller driver interface */
rt_inline
rt_err_t
rt_usb_hcd_alloc_pipe
(
uhcd_t
hcd
,
upipe_t
*
pipe
,
uifinst_t
ifinst
,
uep_desc_t
ep
,
func_callback
callback
)
rt_inline
rt_err_t
rt_usb_hcd_alloc_pipe
(
uhcd_t
hcd
,
upipe_t
*
pipe
,
uifinst_t
ifinst
,
uep_desc_t
ep
,
func_callback
callback
)
{
if
(
ifinst
==
RT_NULL
)
return
-
RT_EIO
;
if
(
ifinst
==
RT_NULL
)
return
-
RT_EIO
;
return
hcd
->
ops
->
alloc_pipe
(
pipe
,
ifinst
,
ep
,
callback
);
}
...
...
@@ -230,40 +255,59 @@ rt_inline rt_err_t rt_usb_hcd_free_pipe(uhcd_t hcd, upipe_t pipe)
return
hcd
->
ops
->
free_pipe
(
pipe
);
}
rt_inline
int
rt_usb_hcd_bulk_xfer
(
uhcd_t
hcd
,
upipe_t
pipe
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
rt_inline
int
rt_usb_hcd_bulk_xfer
(
uhcd_t
hcd
,
upipe_t
pipe
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
{
if
(
pipe
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
->
status
==
UINST_STATUS_IDLE
)
if
(
pipe
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
->
status
==
UINST_STATUS_IDLE
)
return
-
1
;
return
hcd
->
ops
->
bulk_xfer
(
pipe
,
buffer
,
nbytes
,
timeout
);
}
rt_inline
int
rt_usb_hcd_control_xfer
(
uhcd_t
hcd
,
uinst_t
uinst
,
ureq_t
setup
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
rt_inline
int
rt_usb_hcd_control_xfer
(
uhcd_t
hcd
,
uinst_t
uinst
,
ureq_t
setup
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
{
if
(
uinst
->
status
==
UINST_STATUS_IDLE
)
return
-
1
;
if
(
uinst
->
status
==
UINST_STATUS_IDLE
)
return
-
1
;
return
hcd
->
ops
->
ctl_xfer
(
uinst
,
setup
,
buffer
,
nbytes
,
timeout
);
}
rt_inline
int
rt_usb_hcd_int_xfer
(
uhcd_t
hcd
,
upipe_t
pipe
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
rt_inline
int
rt_usb_hcd_int_xfer
(
uhcd_t
hcd
,
upipe_t
pipe
,
void
*
buffer
,
int
nbytes
,
int
timeout
)
{
if
(
pipe
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
->
status
==
UINST_STATUS_IDLE
)
if
(
pipe
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
==
RT_NULL
)
return
-
1
;
if
(
pipe
->
ifinst
->
uinst
->
status
==
UINST_STATUS_IDLE
)
return
-
1
;
return
hcd
->
ops
->
int_xfer
(
pipe
,
buffer
,
nbytes
,
timeout
);
}
rt_inline
rt_err_t
rt_usb_hcd_hub_control
(
uhcd_t
hcd
,
rt_uint16_t
port
,
rt_uint8_t
cmd
,
void
*
args
)
rt_inline
rt_err_t
rt_usb_hcd_hub_control
(
uhcd_t
hcd
,
rt_uint16_t
port
,
rt_uint8_t
cmd
,
void
*
args
)
{
return
hcd
->
ops
->
hub_ctrl
(
port
,
cmd
,
args
);
}
...
...
components/drivers/include/rtdevice.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/mtd/mtd_nand.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/mtd/mtd_nor.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, Shanghai Real-Thread Technology Co., Ltd
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/rtc/alarm.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/rtc/rtc.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/sdio/block_dev.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -93,7 +103,11 @@ static rt_int32_t mmcsd_num_wr_blocks(struct rt_mmcsd_card *card)
return
blocks
;
}
static
rt_err_t
rt_mmcsd_req_blk
(
struct
rt_mmcsd_card
*
card
,
rt_uint32_t
sector
,
void
*
buf
,
rt_size_t
blks
,
rt_uint8_t
dir
)
static
rt_err_t
rt_mmcsd_req_blk
(
struct
rt_mmcsd_card
*
card
,
rt_uint32_t
sector
,
void
*
buf
,
rt_size_t
blks
,
rt_uint8_t
dir
)
{
void
*
aligned_buf
;
...
...
@@ -184,7 +198,8 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, rt_uint32_t sector,
if
(
cmd
.
err
||
data
.
err
||
stop
.
err
)
{
rt_kprintf
(
"mmcsd request blocks error
\n
"
);
rt_kprintf
(
"%d,%d,%d, 0x%08x,0x%08x
\n
"
,
cmd
.
err
,
data
.
err
,
stop
.
err
,
data
.
flags
,
sector
);
rt_kprintf
(
"%d,%d,%d, 0x%08x,0x%08x
\n
"
,
cmd
.
err
,
data
.
err
,
stop
.
err
,
data
.
flags
,
sector
);
return
-
RT_ERROR
;
}
...
...
@@ -221,7 +236,10 @@ static rt_err_t rt_mmcsd_control(rt_device_t dev, rt_uint8_t cmd, void *args)
return
RT_EOK
;
}
static
rt_size_t
rt_mmcsd_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
rt_size_t
size
)
static
rt_size_t
rt_mmcsd_read
(
rt_device_t
dev
,
rt_off_t
pos
,
void
*
buffer
,
rt_size_t
size
)
{
rt_err_t
err
;
struct
mmcsd_blk_device
*
blk_dev
=
(
struct
mmcsd_blk_device
*
)
dev
->
user_data
;
...
...
@@ -230,6 +248,7 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_s
if
(
dev
==
RT_NULL
)
{
rt_set_errno
(
-
DFS_STATUS_EINVAL
);
return
0
;
}
...
...
@@ -246,7 +265,10 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_s
return
size
;
}
static
rt_size_t
rt_mmcsd_write
(
rt_device_t
dev
,
rt_off_t
pos
,
const
void
*
buffer
,
rt_size_t
size
)
static
rt_size_t
rt_mmcsd_write
(
rt_device_t
dev
,
rt_off_t
pos
,
const
void
*
buffer
,
rt_size_t
size
)
{
rt_err_t
err
;
struct
mmcsd_blk_device
*
blk_dev
=
(
struct
mmcsd_blk_device
*
)
dev
->
user_data
;
...
...
@@ -255,6 +277,7 @@ static rt_size_t rt_mmcsd_write(rt_device_t dev, rt_off_t pos, const void *buffe
if
(
dev
==
RT_NULL
)
{
rt_set_errno
(
-
DFS_STATUS_EINVAL
);
return
0
;
}
...
...
@@ -266,6 +289,7 @@ static rt_size_t rt_mmcsd_write(rt_device_t dev, rt_off_t pos, const void *buffe
if
(
err
)
{
rt_set_errno
(
-
DFS_STATUS_EIO
);
return
0
;
}
return
size
;
...
...
@@ -290,6 +314,7 @@ static rt_int32_t mmcsd_set_blksize(struct rt_mmcsd_card *card)
if
(
err
)
{
rt_kprintf
(
"MMCSD: unable to set block size to %d: %d
\n
"
,
cmd
.
arg
,
err
);
return
-
RT_ERROR
;
}
...
...
@@ -312,17 +337,18 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card)
}
/* get the first sector to read partition table */
sector
=
(
rt_uint8_t
*
)
rt_malloc
(
SECTOR_SIZE
);
sector
=
(
rt_uint8_t
*
)
rt_malloc
(
SECTOR_SIZE
);
if
(
sector
==
RT_NULL
)
{
rt_kprintf
(
"allocate partition sector buffer failed
\n
"
);
return
-
RT_ENOMEM
;
}
status
=
rt_mmcsd_req_blk
(
card
,
0
,
sector
,
1
,
0
);
if
(
status
==
RT_EOK
)
{
for
(
i
=
0
;
i
<
RT_MMCSD_MAX_PARTITION
;
i
++
)
for
(
i
=
0
;
i
<
RT_MMCSD_MAX_PARTITION
;
i
++
)
{
blk_dev
=
rt_malloc
(
sizeof
(
struct
mmcsd_blk_device
));
if
(
!
blk_dev
)
...
...
@@ -361,7 +387,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card)
}
else
{
if
(
i
==
0
)
if
(
i
==
0
)
{
/* there is no partition table */
blk_dev
->
part
.
offset
=
0
;
...
...
components/drivers/sdio/mmcsd_core.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -68,7 +78,9 @@ void mmcsd_send_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req)
rt_sem_take
(
&
host
->
sem_ack
,
RT_WAITING_FOREVER
);
}
rt_int32_t
mmcsd_send_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_cmd
*
cmd
,
int
retries
)
rt_int32_t
mmcsd_send_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_cmd
*
cmd
,
int
retries
)
{
struct
rt_mmcsd_req
req
;
...
...
@@ -88,7 +100,8 @@ rt_int32_t mmcsd_go_idle(struct rt_mmcsd_host *host)
rt_int32_t
err
;
struct
rt_mmcsd_cmd
cmd
;
if
(
!
controller_is_spi
(
host
))
{
if
(
!
controller_is_spi
(
host
))
{
mmcsd_set_chip_select
(
host
,
MMCSD_CS_HIGH
);
mmcsd_delay_ms
(
1
);
}
...
...
@@ -109,11 +122,12 @@ rt_int32_t mmcsd_go_idle(struct rt_mmcsd_host *host)
mmcsd_delay_ms
(
1
);
}
return
err
;
}
rt_int32_t
mmcsd_spi_read_ocr
(
struct
rt_mmcsd_host
*
host
,
rt_int32_t
high_capacity
,
rt_uint32_t
*
ocr
)
rt_int32_t
mmcsd_spi_read_ocr
(
struct
rt_mmcsd_host
*
host
,
rt_int32_t
high_capacity
,
rt_uint32_t
*
ocr
)
{
struct
rt_mmcsd_cmd
cmd
;
rt_int32_t
err
;
...
...
@@ -127,10 +141,10 @@ rt_int32_t mmcsd_spi_read_ocr(struct rt_mmcsd_host *host, rt_int32_t high_capaci
err
=
mmcsd_send_cmd
(
host
,
&
cmd
,
0
);
*
ocr
=
cmd
.
resp
[
1
];
return
err
;
}
rt_int32_t
mmcsd_all_get_cid
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
*
cid
)
{
rt_int32_t
err
;
...
...
@@ -151,7 +165,6 @@ rt_int32_t mmcsd_all_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid)
return
0
;
}
rt_int32_t
mmcsd_get_cid
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
*
cid
)
{
rt_int32_t
err
,
i
;
...
...
@@ -174,6 +187,7 @@ rt_int32_t mmcsd_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid)
return
err
;
rt_memcpy
(
cid
,
cmd
.
resp
,
sizeof
(
rt_uint32_t
)
*
4
);
return
0
;
}
...
...
@@ -181,6 +195,7 @@ rt_int32_t mmcsd_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid)
if
(
!
buf
)
{
rt_kprintf
(
"allocate memory failed
\n
"
);
return
-
RT_ENOMEM
;
}
...
...
@@ -217,6 +232,7 @@ rt_int32_t mmcsd_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid)
if
(
cmd
.
err
||
data
.
err
)
{
rt_free
(
buf
);
return
-
RT_ERROR
;
}
...
...
@@ -247,6 +263,7 @@ rt_int32_t mmcsd_get_csd(struct rt_mmcsd_card *card, rt_uint32_t *csd)
return
err
;
rt_memcpy
(
csd
,
cmd
.
resp
,
sizeof
(
rt_uint32_t
)
*
4
);
return
0
;
}
...
...
@@ -254,6 +271,7 @@ rt_int32_t mmcsd_get_csd(struct rt_mmcsd_card *card, rt_uint32_t *csd)
if
(
!
buf
)
{
rt_kprintf
(
"allocate memory failed
\n
"
);
return
-
RT_ENOMEM
;
}
...
...
@@ -291,6 +309,7 @@ rt_int32_t mmcsd_get_csd(struct rt_mmcsd_card *card, rt_uint32_t *csd)
if
(
cmd
.
err
||
data
.
err
)
{
rt_free
(
buf
);
return
-
RT_ERROR
;
}
...
...
@@ -301,7 +320,8 @@ rt_int32_t mmcsd_get_csd(struct rt_mmcsd_card *card, rt_uint32_t *csd)
return
0
;
}
static
rt_int32_t
_mmcsd_select_card
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
)
static
rt_int32_t
_mmcsd_select_card
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
)
{
rt_int32_t
err
;
struct
rt_mmcsd_cmd
cmd
;
...
...
@@ -352,10 +372,10 @@ rt_int32_t mmcsd_spi_use_crc(struct rt_mmcsd_host *host, rt_int32_t use_crc)
err
=
mmcsd_send_cmd
(
host
,
&
cmd
,
0
);
if
(
!
err
)
host
->
spi_use_crc
=
use_crc
;
return
err
;
}
rt_inline
void
mmcsd_set_iocfg
(
struct
rt_mmcsd_host
*
host
)
{
struct
rt_mmcsd_io_cfg
*
io_cfg
=
&
host
->
io_cfg
;
...
...
@@ -411,7 +431,8 @@ void mmcsd_set_bus_width(struct rt_mmcsd_host *host, rt_uint32_t width)
mmcsd_set_iocfg
(
host
);
}
void
mmcsd_set_data_timeout
(
struct
rt_mmcsd_data
*
data
,
const
struct
rt_mmcsd_card
*
card
)
void
mmcsd_set_data_timeout
(
struct
rt_mmcsd_data
*
data
,
const
struct
rt_mmcsd_card
*
card
)
{
rt_uint32_t
mult
;
...
...
@@ -419,6 +440,7 @@ void mmcsd_set_data_timeout(struct rt_mmcsd_data *data, const struct rt_mmcsd_ca
{
data
->
timeout_ns
=
1000000000
;
/* SDIO card 1s */
data
->
timeout_clks
=
0
;
return
;
}
...
...
@@ -482,7 +504,6 @@ void mmcsd_set_data_timeout(struct rt_mmcsd_data *data, const struct rt_mmcsd_ca
}
}
/*
* Mask off any voltages we don't support and select
* the lowest voltage
...
...
@@ -512,7 +533,6 @@ rt_uint32_t mmcsd_select_voltage(struct rt_mmcsd_host *host, rt_uint32_t ocr)
return
ocr
;
}
static
void
mmcsd_power_up
(
struct
rt_mmcsd_host
*
host
)
{
int
bit
=
fls
(
host
->
valid_ocr
)
-
1
;
...
...
@@ -587,7 +607,8 @@ void mmcsd_detect(void *param)
mmcsd_send_if_cond
(
host
,
host
->
valid_ocr
);
err
=
sdio_io_send_op_cond
(
host
,
0
,
&
ocr
);
if
(
!
err
)
{
if
(
!
err
)
{
if
(
init_sdio
(
host
,
ocr
))
mmcsd_power_off
(
host
);
mmcsd_host_unlock
(
host
);
...
...
@@ -619,6 +640,7 @@ struct rt_mmcsd_host *mmcsd_alloc_host(void)
if
(
!
host
)
{
rt_kprintf
(
"alloc host failed
\n
"
);
return
RT_NULL
;
}
...
...
components/drivers/sdio/sd.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -15,26 +25,32 @@
#include <drivers/mmcsd_core.h>
#include <drivers/sd.h>
static
const
rt_uint32_t
tran_unit
[]
=
{
static
const
rt_uint32_t
tran_unit
[]
=
{
10000
,
100000
,
1000000
,
10000000
,
0
,
0
,
0
,
0
};
static
const
rt_uint8_t
tran_value
[]
=
{
static
const
rt_uint8_t
tran_value
[]
=
{
0
,
10
,
12
,
13
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
50
,
55
,
60
,
70
,
80
,
};
static
const
rt_uint32_t
tacc_uint
[]
=
{
static
const
rt_uint32_t
tacc_uint
[]
=
{
1
,
10
,
100
,
1000
,
10000
,
100000
,
1000000
,
10000000
,
};
static
const
rt_uint8_t
tacc_value
[]
=
{
static
const
rt_uint8_t
tacc_value
[]
=
{
0
,
10
,
12
,
13
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
50
,
55
,
60
,
70
,
80
,
};
rt_inline
rt_uint32_t
GET_BITS
(
rt_uint32_t
*
resp
,
rt_uint32_t
start
,
rt_uint32_t
size
)
rt_inline
rt_uint32_t
GET_BITS
(
rt_uint32_t
*
resp
,
rt_uint32_t
start
,
rt_uint32_t
size
)
{
const
rt_int32_t
__size
=
size
;
const
rt_uint32_t
__mask
=
(
__size
<
32
?
1
<<
__size
:
0
)
-
1
;
...
...
@@ -45,6 +61,7 @@ rt_inline rt_uint32_t GET_BITS(rt_uint32_t *resp, rt_uint32_t start, rt_uint32_t
__res
=
resp
[
__off
]
>>
__shft
;
if
(
__size
+
__shft
>
32
)
__res
|=
resp
[
__off
-
1
]
<<
((
32
-
__shft
)
%
32
);
return
__res
&
__mask
;
}
...
...
@@ -55,7 +72,8 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card)
csd
->
csd_structure
=
GET_BITS
(
resp
,
126
,
2
);
switch
(
csd
->
csd_structure
)
{
switch
(
csd
->
csd_structure
)
{
case
0
:
csd
->
taac
=
GET_BITS
(
resp
,
112
,
8
);
csd
->
nsac
=
GET_BITS
(
resp
,
104
,
8
);
...
...
@@ -150,6 +168,7 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card)
break
;
default:
rt_kprintf
(
"unrecognised CSD structure version %d
\n
"
,
csd
->
csd_structure
);
return
-
RT_ERROR
;
}
rt_kprintf
(
"SD card capacity %d KB
\n
"
,
card
->
card_capacity
);
...
...
@@ -183,6 +202,7 @@ static rt_int32_t mmcsd_switch(struct rt_mmcsd_card *card)
if
(
!
buf
)
{
rt_kprintf
(
"alloc memory failed
\n
"
);
return
-
RT_ENOMEM
;
}
...
...
@@ -261,13 +281,16 @@ err:
return
0
;
err1:
if
(
cmd
.
err
)
err
=
cmd
.
err
;
if
(
data
.
err
)
err
=
data
.
err
;
if
(
cmd
.
err
)
err
=
cmd
.
err
;
if
(
data
.
err
)
err
=
data
.
err
;
return
err
;
}
static
rt_err_t
mmcsd_app_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
)
static
rt_err_t
mmcsd_app_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
)
{
rt_err_t
err
;
struct
rt_mmcsd_cmd
cmd
=
{
0
};
...
...
@@ -297,8 +320,10 @@ static rt_err_t mmcsd_app_cmd(struct rt_mmcsd_host *host, struct rt_mmcsd_card *
}
rt_err_t
mmcsd_send_app_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
,
struct
rt_mmcsd_cmd
*
cmd
,
int
retry
)
rt_err_t
mmcsd_send_app_cmd
(
struct
rt_mmcsd_host
*
host
,
struct
rt_mmcsd_card
*
card
,
struct
rt_mmcsd_cmd
*
cmd
,
int
retry
)
{
struct
rt_mmcsd_req
req
;
...
...
@@ -351,7 +376,6 @@ rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host, struct rt_mmcsd_card *ca
return
err
;
}
rt_err_t
mmcsd_app_set_bus_width
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
width
)
{
rt_err_t
err
;
...
...
@@ -381,7 +405,9 @@ rt_err_t mmcsd_app_set_bus_width(struct rt_mmcsd_card *card, rt_int32_t width)
return
RT_EOK
;
}
rt_err_t
mmcsd_send_app_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
rocr
)
rt_err_t
mmcsd_send_app_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
rocr
)
{
struct
rt_mmcsd_cmd
cmd
;
rt_uint32_t
i
;
...
...
@@ -528,7 +554,8 @@ rt_int32_t mmcsd_get_scr(struct rt_mmcsd_card *card, rt_uint32_t *scr)
}
static
rt_int32_t
mmcsd_sd_init_card
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
)
static
rt_int32_t
mmcsd_sd_init_card
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
)
{
struct
rt_mmcsd_card
*
card
;
rt_int32_t
err
;
...
...
@@ -665,7 +692,8 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
/*
* We need to get OCR a different way for SPI.
*/
if
(
controller_is_spi
(
host
))
{
if
(
controller_is_spi
(
host
))
{
mmcsd_go_idle
(
host
);
err
=
mmcsd_spi_read_ocr
(
host
,
0
,
&
ocr
);
...
...
@@ -673,7 +701,8 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
goto
err
;
}
if
(
ocr
&
VDD_165_195
)
{
if
(
ocr
&
VDD_165_195
)
{
rt_kprintf
(
" SD card claims to support the "
"incompletely defined 'low voltage range'. This "
"will be ignored.
\n
"
);
...
...
@@ -685,7 +714,8 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
/*
* Can we support the voltage(s) of the card(s)?
*/
if
(
!
current_ocr
)
{
if
(
!
current_ocr
)
{
err
=
-
RT_ERROR
;
goto
err
;
}
...
...
components/drivers/sdio/sdio.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
@@ -25,12 +35,14 @@
static
rt_list_t
sdio_cards
;
static
rt_list_t
sdio_drivers
;
struct
sdio_card
{
struct
sdio_card
{
struct
rt_mmcsd_card
*
card
;
rt_list_t
list
;
};
struct
sdio_driver
{
struct
sdio_driver
{
struct
rt_sdio_driver
*
drv
;
rt_list_t
list
;
};
...
...
@@ -38,17 +50,22 @@ struct sdio_driver {
#define MIN(a, b) (a < b ? a : b)
static
const
rt_uint8_t
speed_value
[
16
]
=
{
0
,
10
,
12
,
13
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
50
,
55
,
60
,
70
,
80
};
{
0
,
10
,
12
,
13
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
50
,
55
,
60
,
70
,
80
};
static
const
rt_uint32_t
speed_unit
[
8
]
=
{
10000
,
100000
,
1000000
,
10000000
,
0
,
0
,
0
,
0
};
{
10000
,
100000
,
1000000
,
10000000
,
0
,
0
,
0
,
0
};
rt_inline
rt_int32_t
sdio_match_card
(
struct
rt_mmcsd_card
*
card
,
const
struct
rt_sdio_device_id
*
id
);
rt_int32_t
sdio_io_send_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
cmd5_resp
)
rt_int32_t
sdio_io_send_op_cond
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
,
rt_uint32_t
*
cmd5_resp
)
{
struct
rt_mmcsd_cmd
cmd
;
rt_int32_t
i
,
err
=
0
;
...
...
@@ -100,9 +117,12 @@ rt_int32_t sdio_io_send_op_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr, rt_
return
err
;
}
rt_int32_t
sdio_io_rw_direct
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
reg_addr
,
rt_uint8_t
*
pdata
,
rt_uint8_t
raw
)
rt_int32_t
sdio_io_rw_direct
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
reg_addr
,
rt_uint8_t
*
pdata
,
rt_uint8_t
raw
)
{
struct
rt_mmcsd_cmd
cmd
;
rt_int32_t
err
;
...
...
@@ -148,8 +168,14 @@ rt_int32_t sdio_io_rw_direct(struct rt_mmcsd_card *card, rt_int32_t rw, rt_uint3
return
0
;
}
rt_int32_t
sdio_io_rw_extended
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
blocks
,
rt_uint32_t
blksize
)
rt_int32_t
sdio_io_rw_extended
(
struct
rt_mmcsd_card
*
card
,
rt_int32_t
rw
,
rt_uint32_t
fn
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
blocks
,
rt_uint32_t
blksize
)
{
struct
rt_mmcsd_req
req
;
struct
rt_mmcsd_cmd
cmd
;
...
...
@@ -214,11 +240,16 @@ rt_inline rt_uint32_t sdio_max_block_size(struct rt_sdio_function *func)
rt_uint32_t
size
=
MIN
(
func
->
card
->
host
->
max_seg_size
,
func
->
card
->
host
->
max_blk_size
);
size
=
MIN
(
size
,
func
->
max_blk_size
);
return
MIN
(
size
,
512u
);
/* maximum size for byte mode */
}
static
rt_int32_t
sdio_io_rw_extended_block
(
struct
rt_sdio_function
*
func
,
rt_int32_t
rw
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
static
rt_int32_t
sdio_io_rw_extended_block
(
struct
rt_sdio_function
*
func
,
rt_int32_t
rw
,
rt_uint32_t
addr
,
rt_int32_t
op_code
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
{
rt_int32_t
ret
;
rt_uint32_t
left_size
;
...
...
@@ -227,13 +258,14 @@ static rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_in
left_size
=
len
;
/* Do the bulk of the transfer using block mode (if supported). */
if
(
func
->
card
->
cccr
.
multi_block
&&
(
len
>
sdio_max_block_size
(
func
)))
{
if
(
func
->
card
->
cccr
.
multi_block
&&
(
len
>
sdio_max_block_size
(
func
)))
{
max_blks
=
MIN
(
func
->
card
->
host
->
max_blk_count
,
func
->
card
->
host
->
max_seg_size
/
func
->
cur_blk_size
);
max_blks
=
MIN
(
max_blks
,
511u
);
while
(
left_size
>
func
->
cur_blk_size
)
{
while
(
left_size
>
func
->
cur_blk_size
)
{
blks
=
left_size
/
func
->
cur_blk_size
;
if
(
blks
>
max_blks
)
blks
=
max_blks
;
...
...
@@ -251,7 +283,8 @@ static rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_in
}
}
while
(
left_size
>
0
)
{
while
(
left_size
>
0
)
{
len
=
MIN
(
left_size
,
sdio_max_block_size
(
func
));
ret
=
sdio_io_rw_extended
(
func
->
card
,
rw
,
func
->
num
,
...
...
@@ -268,9 +301,9 @@ static rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_in
return
0
;
}
rt_uint8_t
sdio_io_readb
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
reg
,
rt_int32_t
*
err
)
rt_uint32_t
reg
,
rt_int32_t
*
err
)
{
rt_uint8_t
data
;
rt_int32_t
ret
;
...
...
@@ -286,12 +319,15 @@ rt_uint8_t sdio_io_readb(struct rt_sdio_function *func,
}
rt_int32_t
sdio_io_writeb
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
reg
,
rt_uint8_t
data
)
rt_uint32_t
reg
,
rt_uint8_t
data
)
{
return
sdio_io_rw_direct
(
func
->
card
,
1
,
func
->
num
,
reg
,
&
data
,
0
);
}
rt_uint16_t
sdio_io_readw
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
)
rt_uint16_t
sdio_io_readw
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
)
{
rt_int32_t
ret
;
rt_uint32_t
dmabuf
;
...
...
@@ -309,14 +345,18 @@ rt_uint16_t sdio_io_readw(struct rt_sdio_function *func, rt_uint32_t addr, rt_in
return
(
rt_uint16_t
)
dmabuf
;
}
rt_int32_t
sdio_io_writew
(
struct
rt_sdio_function
*
func
,
rt_uint16_t
data
,
rt_uint32_t
addr
)
rt_int32_t
sdio_io_writew
(
struct
rt_sdio_function
*
func
,
rt_uint16_t
data
,
rt_uint32_t
addr
)
{
rt_uint32_t
dmabuf
=
data
;
return
sdio_io_rw_extended_block
(
func
,
1
,
addr
,
1
,
(
rt_uint8_t
*
)
&
dmabuf
,
2
);
}
rt_uint32_t
sdio_io_readl
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
)
rt_uint32_t
sdio_io_readl
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_int32_t
*
err
)
{
rt_int32_t
ret
;
rt_uint32_t
dmabuf
;
...
...
@@ -334,7 +374,9 @@ rt_uint32_t sdio_io_readl(struct rt_sdio_function *func, rt_uint32_t addr, rt_in
return
dmabuf
;
}
rt_int32_t
sdio_io_writel
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
data
,
rt_uint32_t
addr
)
rt_int32_t
sdio_io_writel
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
data
,
rt_uint32_t
addr
)
{
rt_uint32_t
dmabuf
=
data
;
...
...
@@ -342,25 +384,33 @@ rt_int32_t sdio_io_writel(struct rt_sdio_function *func, rt_uint32_t data, rt_ui
}
rt_int32_t
sdio_io_read_multi_fifo_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
{
return
sdio_io_rw_extended_block
(
func
,
0
,
addr
,
0
,
buf
,
len
);
}
rt_int32_t
sdio_io_write_multi_fifo_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
{
return
sdio_io_rw_extended_block
(
func
,
1
,
addr
,
0
,
buf
,
len
);
}
rt_int32_t
sdio_io_read_multi_incr_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
{
return
sdio_io_rw_extended_block
(
func
,
0
,
addr
,
1
,
buf
,
len
);
}
rt_int32_t
sdio_io_write_multi_incr_b
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
rt_uint32_t
addr
,
rt_uint8_t
*
buf
,
rt_uint32_t
len
)
{
return
sdio_io_rw_extended_block
(
func
,
1
,
addr
,
1
,
buf
,
len
);
}
...
...
@@ -382,6 +432,7 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card)
if
(
cccr_version
>
SDIO_CCCR_REV_1_20
)
{
rt_kprintf
(
"unrecognised CCCR structure version %d
\n
"
,
cccr_version
);
return
-
RT_ERROR
;
}
...
...
@@ -425,7 +476,8 @@ out:
}
static
rt_int32_t
cistpl_funce_func0
(
struct
rt_mmcsd_card
*
card
,
const
rt_uint8_t
*
buf
,
rt_uint32_t
size
)
const
rt_uint8_t
*
buf
,
rt_uint32_t
size
)
{
if
(
size
<
0x04
||
buf
[
0
]
!=
0
)
return
-
RT_ERROR
;
...
...
@@ -441,7 +493,8 @@ static rt_int32_t cistpl_funce_func0(struct rt_mmcsd_card *card,
}
static
rt_int32_t
cistpl_funce_func
(
struct
rt_sdio_function
*
func
,
const
rt_uint8_t
*
buf
,
rt_uint32_t
size
)
const
rt_uint8_t
*
buf
,
rt_uint32_t
size
)
{
rt_uint32_t
version
;
rt_uint32_t
min_size
;
...
...
@@ -605,8 +658,6 @@ void sdio_free_cis(struct rt_sdio_function *func)
func
->
tuples
=
RT_NULL
;
}
static
rt_int32_t
sdio_read_fbr
(
struct
rt_sdio_function
*
func
)
{
rt_int32_t
ret
;
...
...
@@ -635,7 +686,8 @@ err:
}
static
rt_int32_t
sdio_initialize_function
(
struct
rt_mmcsd_card
*
card
,
rt_uint32_t
func_num
)
static
rt_int32_t
sdio_initialize_function
(
struct
rt_mmcsd_card
*
card
,
rt_uint32_t
func_num
)
{
rt_int32_t
ret
;
struct
rt_sdio_function
*
func
;
...
...
@@ -674,7 +726,6 @@ err:
return
ret
;
}
static
rt_int32_t
sdio_set_highspeed
(
struct
rt_mmcsd_card
*
card
)
{
rt_int32_t
ret
;
...
...
@@ -727,7 +778,6 @@ static rt_int32_t sdio_set_bus_wide(struct rt_mmcsd_card *card)
return
0
;
}
static
rt_int32_t
sdio_register_card
(
struct
rt_mmcsd_card
*
card
)
{
struct
sdio_card
*
sc
;
...
...
@@ -762,7 +812,6 @@ out:
return
0
;
}
static
rt_int32_t
sdio_init_card
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
)
{
rt_int32_t
err
=
0
;
...
...
@@ -878,7 +927,6 @@ err3:
host
->
card
->
sdio_function
[
i
]
=
RT_NULL
;
rt_free
(
host
->
card
);
host
->
card
=
RT_NULL
;
}
}
}
...
...
@@ -900,8 +948,6 @@ err:
return
err
;
}
rt_int32_t
init_sdio
(
struct
rt_mmcsd_host
*
host
,
rt_uint32_t
ocr
)
{
rt_int32_t
err
;
...
...
@@ -943,12 +989,8 @@ err:
rt_kprintf
(
"init SDIO card failed
\n
"
);
return
err
;
}
static
void
sdio_irq_thread
(
void
*
param
)
{
rt_int32_t
i
,
ret
;
...
...
@@ -1046,8 +1088,8 @@ static rt_int32_t sdio_irq_thread_delete(struct rt_mmcsd_card *card)
return
0
;
}
rt_int32_t
sdio_attach_irq
(
struct
rt_sdio_function
*
func
,
rt_sdio_irq_handler_t
*
handler
)
rt_int32_t
sdio_attach_irq
(
struct
rt_sdio_function
*
func
,
rt_sdio_irq_handler_t
*
handler
)
{
rt_int32_t
ret
;
rt_uint8_t
reg
;
...
...
@@ -1063,6 +1105,7 @@ rt_int32_t sdio_attach_irq(struct rt_sdio_function *func, rt_sdio_irq_handler_t
if
(
func
->
irq_handler
)
{
mmcsd_dbg
(
"SDIO: IRQ for already in use.
\n
"
);
return
-
RT_EBUSY
;
}
...
...
@@ -1129,7 +1172,6 @@ void sdio_irq_wakeup(struct rt_mmcsd_host *host)
rt_sem_release
(
host
->
sdio_irq_sem
);
}
rt_int32_t
sdio_enable_func
(
struct
rt_sdio_function
*
func
)
{
rt_int32_t
ret
;
...
...
@@ -1177,7 +1219,6 @@ err:
return
ret
;
}
rt_int32_t
sdio_disable_func
(
struct
rt_sdio_function
*
func
)
{
rt_int32_t
ret
;
...
...
@@ -1210,7 +1251,8 @@ err:
return
-
RT_EIO
;
}
rt_int32_t
sdio_set_block_size
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
blksize
)
rt_int32_t
sdio_set_block_size
(
struct
rt_sdio_function
*
func
,
rt_uint32_t
blksize
)
{
rt_int32_t
ret
;
struct
rt_sdio_function
*
func0
=
func
->
card
->
sdio_function
[
0
];
...
...
@@ -1237,7 +1279,6 @@ rt_int32_t sdio_set_block_size(struct rt_sdio_function *func, rt_uint32_t blksiz
return
0
;
}
rt_inline
rt_int32_t
sdio_match_card
(
struct
rt_mmcsd_card
*
card
,
const
struct
rt_sdio_device_id
*
id
)
{
...
...
@@ -1280,6 +1321,7 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver)
if
(
sd
==
RT_NULL
)
{
rt_kprintf
(
"malloc sdio driver failed
\n
"
);
return
-
RT_ENOMEM
;
}
...
...
@@ -1335,7 +1377,6 @@ rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
return
0
;
}
void
rt_sdio_init
(
void
)
{
rt_list_init
(
&
sdio_cards
);
...
...
components/drivers/serial/serial.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/spi/spi_core.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/spi/spi_dev.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/src/completion.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/src/dataqueue.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/src/pipe.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/src/ringbuffer.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/class/cdc.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/class/cdc_vcom.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/class/mstorage.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/class/mstorage.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/core/core.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbdevice/core/usbdevice.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/class/adk.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/class/adk.h
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/core/core.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/core/driver.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/core/hub.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
components/drivers/usb/usbhost/core/usbhost.c
浏览文件 @
621fbdb9
...
...
@@ -3,9 +3,19 @@
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2011, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录