Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
b8988227
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,发现更多精彩内容 >>
提交
b8988227
编写于
3月 29, 2023
作者:
R
Rbb666
提交者:
guo
3月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Infineon]Fix spi cs problem
上级
9f38248f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
15 deletion
+13
-15
bsp/Infineon/libraries/HAL_Drivers/drv_spi.c
bsp/Infineon/libraries/HAL_Drivers/drv_spi.c
+10
-10
bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
+3
-5
未找到文件。
bsp/Infineon/libraries/HAL_Drivers/drv_spi.c
浏览文件 @
b8988227
...
...
@@ -38,7 +38,7 @@ struct ifx_sw_spi_cs
#endif
static
struct
ifx_spi
spi_bus_obj
[]
=
{
#if
def BSP_USING_SPI0
#if
defined(BSP_USING_SPI0)
{
.
bus_name
=
"spi0"
,
.
spi_bus
=
&
spi_bus0
,
...
...
@@ -47,7 +47,7 @@ static struct ifx_spi spi_bus_obj[] =
.
mosi_pin
=
GET_PIN
(
0
,
2
),
},
#endif
#if
def BSP_USING_SPI3
#if
defined(BSP_USING_SPI3)
{
.
bus_name
=
"spi3"
,
.
spi_bus
=
&
spi_bus3
,
...
...
@@ -56,7 +56,7 @@ static struct ifx_spi spi_bus_obj[] =
.
mosi_pin
=
GET_PIN
(
6
,
0
),
},
#endif
#if
def BSP_USING_SPI6
#if
defined(BSP_USING_SPI6)
{
.
bus_name
=
"spi6"
,
.
spi_bus
=
&
spi_bus6
,
...
...
@@ -69,7 +69,7 @@ static struct ifx_spi spi_bus_obj[] =
/* private rt-thread spi ops function */
static
rt_err_t
spi_configure
(
struct
rt_spi_device
*
device
,
struct
rt_spi_configuration
*
configuration
);
static
rt_
uint32
_t
spixfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
);
static
rt_
ssize
_t
spixfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
);
static
struct
rt_spi_ops
ifx_spi_ops
=
{
...
...
@@ -146,7 +146,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device,
return
RT_EOK
;
}
static
rt_
uint32
_t
spixfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
)
static
rt_
ssize
_t
spixfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
)
{
RT_ASSERT
(
device
!=
NULL
);
RT_ASSERT
(
message
!=
NULL
);
...
...
@@ -158,9 +158,9 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
struct
ifx_sw_spi_cs
*
cs
=
device
->
parent
.
user_data
;
/* take CS */
if
(
message
->
cs_take
)
if
(
message
->
cs_take
&&
!
(
device
->
config
.
mode
&
RT_SPI_NO_CS
)
&&
(
device
->
cs_pin
!=
PIN_NONE
)
)
{
cyhal_gpio_write
(
cs
->
pin
,
PIN_LOW
);
cyhal_gpio_write
(
device
->
cs_
pin
,
PIN_LOW
);
LOG_D
(
"spi take cs
\n
"
);
}
...
...
@@ -185,12 +185,12 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
}
}
if
(
message
->
cs_release
&&
!
(
device
->
config
.
mode
&
RT_SPI_NO_CS
))
if
(
message
->
cs_release
&&
!
(
device
->
config
.
mode
&
RT_SPI_NO_CS
)
&&
(
device
->
cs_pin
!=
PIN_NONE
)
)
{
if
(
device
->
config
.
mode
&
RT_SPI_CS_HIGH
)
cyhal_gpio_write
(
cs
->
pin
,
PIN_LOW
);
cyhal_gpio_write
(
device
->
cs_
pin
,
PIN_LOW
);
else
cyhal_gpio_write
(
cs
->
pin
,
PIN_HIGH
);
cyhal_gpio_write
(
device
->
cs_
pin
,
PIN_HIGH
);
}
return
message
->
length
;
...
...
bsp/Infineon/psoc6-evaluationkit-062S2/board/Kconfig
浏览文件 @
b8988227
...
...
@@ -112,11 +112,6 @@ menu "On-chip Peripheral Drivers"
menuconfig BSP_USING_SPI0
bool "Enable SPI0 BUS"
default n
if BSP_USING_SPI0
config BSP_USING_SPI0_SAMPLE
bool "Enable SPI0 BUS Sample"
default n
endif
menuconfig BSP_USING_SPI3
bool "Enable SPI3 BUS"
default n
...
...
@@ -125,6 +120,9 @@ menu "On-chip Peripheral Drivers"
bool "Enable SPI3 BUS Sample"
default n
endif
menuconfig BSP_USING_SPI6
bool "Enable SPI6 BUS"
default n
endif
menuconfig BSP_USING_ADC
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录