We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在嵌入式系统中,很多板载芯片都是采用SPI总线进行通信,同一SPI总线上也运行挂载多个相同或者不同型号的芯片。但是要留意不同型号的芯片的SPI通信的时序图,一般会有4种模式。在micropython中,初始化SPI总线时,通过phase和polarity配置即可实现这4种模式。
SPI
micropython
phase
polarity
CPHA (phase) 0--第1时钟边缘采样 1--第2时钟边缘采样 CPLO(polarity) 0--空闲时钟低电平 1--空闲时钟高电平
MODE3
import pyb spi = pyb.SPI(1, pyb.SPI.MASTER,prescaler=256,phase=1,polarity=1)
具体还可参考官方文档 https://docs.micropython.org/en/latest/library/pyb.SPI.html
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在嵌入式系统中,很多板载芯片都是采用
SPI
总线进行通信,同一SPI
总线上也运行挂载多个相同或者不同型号的芯片。但是要留意不同型号的芯片的SPI
通信的时序图,一般会有4种模式。在micropython
中,初始化SPI
总线时,通过phase
和polarity
配置即可实现这4种模式。四种模式
常用芯片模式
示例
MODE3
,可以与所有支持MODE3
的芯片通信。具体还可参考官方文档 https://docs.micropython.org/en/latest/library/pyb.SPI.html
The text was updated successfully, but these errors were encountered: