当前位置:网站首页>杰理之SPI 从机如何配置驱动程序?【篇】
杰理之SPI 从机如何配置驱动程序?【篇】
2022-06-09 02:17:00 【Rambo-Lamborghini】
答:SPI 主机在 board.c 中配置参数
//1 添加SPI硬件参数,标准spi协议mosi miso clk
SPI1_PLATFORM_DATA_BEGIN(spi1_data)//当使用SPI2则:SPI2_PLATFORM_DATA_BEGIN(spi2_data)
.clk = 80000000, //时钟,可设置,无影响,时钟从机模式跟随主机模式
.mode = SPI_STD_MODE,//spi数据线传输:mosi miso clk
.port = ‘B’,//SPI接口
.attr = SPI_MODE_SLAVE | SPI_SCLK_H_UPL_SMPH | SPI_UNIDIR_MODE,//参数:从机,CLK高 更新数据高,单向模式
SPI1_PLATFORM_DATA_END()//当使用SPI2则:SPI2_PLATFORM_DATA_END()
//2 设备列表添加SPI设备
{“spi1”, &spi_dev_ops, (void *)&spi1_data },
边栏推荐
- 【网络协议】| 【01】网络字节序大端、小端
- Security analysis and demonstration of contract private data leakage
- How Bi makes SaaS products have a "sense of security" and "sensitivity" (Part I)
- Phar deserialization learning swpuctf2018 simplephp
- Database table cannot add content display modification cannot save prompt 1452 error
- C语言学生课程管理系统
- Golang of knowledge sharing -- a function based on whether a folder exists and whether a file exists
- How can golang set its own gopath and import the definition file normally
- How to use superset to seamlessly connect with MRS for self-service analysis
- C language library information management system
猜你喜欢

在业务代码中使用redis实现缓存效果

Don't miss | quota management and application - bank credit card behavior scoring (see for practical operation)
![[MySQL from Xiaobai to expert] Part 6: transaction and JDBC programming in MySQL](/img/e1/0807247eaf70d0fc95c3399352f1c8.png)
[MySQL from Xiaobai to expert] Part 6: transaction and JDBC programming in MySQL

Redis cluster setup

一文说透Sentinel熔断策略、降级规则、流量控制

Hello, people returning to work. Musk has been searching for "workaholics" again. Is telecommuting good or bad?

A practical comprehensive navigation website

How does the technical leader bring down a team?

Navicat tool batch imports JSON format data to Doris

21、ADS使用记录之E类功放设计(中)
随机推荐
C # questions about cache and data flow
Assignment of C language programming practice
Comment le modèle de diffusion a - t - il commencé à surpasser le Gan dans le domaine de la génération d'images?
C语言仓库货物管理系统
Redis集群搭建
21、ADS使用记录之E类功放设计(中)
[understanding of opportunity -22]: Guiguzi - the art of closing Tibet. Collect your talents in time to protect yourself in the workplace, business and business activities
About database: vba+sql uses select * from a where name1 regexp to 'protect', and the error prompt is "operator missing"
Analyze several interview questions: = = and = = =; Binding events; regular expression
C language library card management system
Sectigo certificate price
27 | discussion on high water level and leader epoch
巴菲特的alpha--部分代码
Redis cluster reports an error cluster_ State:fail, how to solve and restore the cluster (IP problem / incomplete slot allocation problem)
[suctf 2018]multisql MySQL preprocessing
What is a security tag based access control mechanism? What are the characteristics?
Why the volatile keyword is required for double check locks
27 | 关于高水位和Leader Epoch的讨论
C language record book
Immediate consumption: spare no effort to crack down on credit investigation and repair, and radical cure of chaos calls for social synergy