Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
202bde05
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
202bde05
编写于
6月 13, 2020
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[DeviceDriver][SPI] Fix 3 wires SPI issue.
上级
b2e30a7e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
12 deletion
+14
-12
components/drivers/include/drivers/spi.h
components/drivers/include/drivers/spi.h
+14
-12
未找到文件。
components/drivers/include/drivers/spi.h
浏览文件 @
202bde05
/*
* Copyright (c) 2006-20
18
, RT-Thread Development Team
* Copyright (c) 2006-20
20
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2012-11-23 Bernard Add extern "C"
* 2020-06-13 armink fix the 3 wires issue
*/
#ifndef __SPI_H__
...
...
@@ -18,8 +19,6 @@
extern
"C"
{
#endif
#define RT_SPI_CPHA (1<<0)
/* bit[0]:CPHA, clock phase */
#define RT_SPI_CPOL (1<<1)
/* bit[1]:CPOL, clock polarity */
/**
* At CPOL=0 the base value of the clock is zero
* - For CPHA=0, data are captured on the clock's rising edge (low->high transition)
...
...
@@ -32,26 +31,29 @@ extern "C"{
* - For CPHA=1, data are captured on clock's rising edge and data are propagated
* on a falling edge.
*/
#define RT_SPI_CPHA (1<<0)
/* bit[0]:CPHA, clock phase */
#define RT_SPI_CPOL (1<<1)
/* bit[1]:CPOL, clock polarity */
#define RT_SPI_LSB (0<<2)
/* bit[2]: 0-LSB */
#define RT_SPI_MSB (1<<2)
/* bit[2]: 1-MSB */
#define RT_SPI_MASTER (0<<3)
/* SPI master device */
#define RT_SPI_SLAVE (1<<3)
/* SPI slave device */
#define RT_SPI_CS_HIGH (1<<4)
/* Chipselect active high */
#define RT_SPI_NO_CS (1<<5)
/* No chipselect */
#define RT_SPI_3WIRE (1<<6)
/* SI/SO pin shared */
#define RT_SPI_READY (1<<7)
/* Slave pulls low to pause */
#define RT_SPI_MODE_MASK (RT_SPI_CPHA | RT_SPI_CPOL | RT_SPI_MSB | RT_SPI_SLAVE | RT_SPI_CS_HIGH | RT_SPI_NO_CS | RT_SPI_3WIRE | RT_SPI_READY)
#define RT_SPI_MODE_0 (0 | 0)
/* CPOL = 0, CPHA = 0 */
#define RT_SPI_MODE_1 (0 | RT_SPI_CPHA)
/* CPOL = 0, CPHA = 1 */
#define RT_SPI_MODE_2 (RT_SPI_CPOL | 0)
/* CPOL = 1, CPHA = 0 */
#define RT_SPI_MODE_3 (RT_SPI_CPOL | RT_SPI_CPHA)
/* CPOL = 1, CPHA = 1 */
#define RT_SPI_MODE_MASK (RT_SPI_CPHA | RT_SPI_CPOL | RT_SPI_MSB | RT_SPI_SLAVE)
#define RT_SPI_BUS_MODE_SPI (1<<0)
#define RT_SPI_BUS_MODE_QSPI (1<<1)
#define RT_SPI_CS_HIGH (1<<4)
/* Chipselect active high */
#define RT_SPI_NO_CS (1<<5)
/* No chipselect */
#define RT_SPI_3WIRE (1<<6)
/* SI/SO pin shared */
#define RT_SPI_READY (1<<7)
/* Slave pulls low to pause */
#define RT_SPI_BUS_MODE_SPI (1<<0)
#define RT_SPI_BUS_MODE_QSPI (1<<1)
/**
* SPI message structure
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录