当前位置:网站首页>RT-Thread-GD32的SPI在切换同一总线不同挂载设备时会出现切换后乱发送数据的问题
RT-Thread-GD32的SPI在切换同一总线不同挂载设备时会出现切换后乱发送数据的问题
2022-07-30 06:13:00 【Sky_Lannister】
使用的RT-Thread系统,在一条spi总线上挂载了4个设备,每个设备用的spi模式不同,偶尔还会用到spi引脚当普通引脚使用。
RTT的SPI设备通信切换机制是每次切到另一个不同的子设备前会根据之前注册时的设备模式进行初始化spi,而GD32的spi问题是在切换几次后发送数据会变乱,一开始以为是RTT的问题,但是一直仿真到spi_i2s_data_transmit这个标准库函数,函数形参都一样,但是出来的波形是对不上的,所以感觉是GD32的spi配置BUG,索性在spi_configure中的gd32_spi_init(spi_device);前加了一个spi_i2s_deinit(spi_periph);用来复位spi设备,完美解决
另一个配置spi在普通模式和spi之间切换的小经验是不能多次调用rt_spi_bus_register或者RTT中关于spi初始化的函数,而是切到普通引脚模式就直接配置引脚为输入输出,切到spi模式直接配置引脚复用为spi就可以,注册一次之后直接用就可以
边栏推荐
猜你喜欢
What are the access modifiers, declaration modifiers, and keywords in C#?Literacy articles
Ali two sides: List several tips for Api interface optimization
Universal js time date format conversion
首届人工智能安全大赛正式启动
2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
IDEA search plug-in has no results and the solution has been spinning in circles
Ali Ermian: How many cluster solutions does Redis have?I answered 4
【雷达目标检测】恒定阈值法和恒虚警(CFAR)法及代码实现
uniapp中canvas与v-if更“配”
2020 数学建模之旅
随机推荐
Interview with Ant: How do these technology pioneers do the bottom-level development well?| Excellent technical team interview
DP5340 domestic replacement for CM5340 stereo audio A/D converter chip
golang : Zap log integration
Electron中设置菜单(Menu),主进程向渲染进程共享数据
Playing script killing with AI: actually more involved than me
golang: Gorm configures Mysql multiple data sources
The newcomer deleted data by mistake, and the team leader skillfully used MySQL master-slave replication to delay the recovery of losses
Vue2进阶篇-编程式路由导航、缓存路由组件、路由的激活与失活
Get all interface paths and names in the controller
C语言自定义类型详解
DNS domain name resolution services
02 多线程与高并发 - synchronized 解析
Limit injection record of mysql injection in No. 5 dark area shooting range
BGP:边界网关路由协议 无类别的路径矢量EGP协议
2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
入选“十大硬核科技”,详解可信密态计算(TECC)技术点
stack containing min function (js)
Oracle查看表空间使用率及爆满解决方案
MYSQL 主从恢复锁表后, 处理SQL 线程锁解决.
sizeof