当前位置:网站首页>Utilisation de l'écran OLED
Utilisation de l'écran OLED
2022-07-06 20:22:00 【Kshine2017】
1. 0.96Pouces7PinOLEDÉcran
- La partie manquante du texte dans l'image est due à la photo du téléphone,En fait, c'est le texte complet.
- Liens de référence:
https://wenku.baidu.com/view/eb67b928b91aa8114431b90d6c85ec3a87c28b86.html
https://wenku.baidu.com/view/11e968518d9951e79b89680203d8ce2f00666590.html - Explication des broches:
GND GND
VDD VCC 3.3V~5V
PE5 D0 CLKInformations sur l'horloge(SCL) SPI_CLK
PE6 D1 Port de données(SDA) SPI_MOSI
PE7 RES Réinitialiser FréquentIO
PE8 DC Données/Sélection des commandes(D/C) FréquentIO
PE9 CS Sélection de films,Faible niveau actif SPI_CS
- La méthode de sélection de la résistance est la suivante,Correspondant à4LigneSPI.
- IOSimulation4LigneSPI,DriveOLED
void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {
0};
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIOA->BSRR = OLED_DC_Pin;
GPIOA->BSRR = OLED_RES_Pin;
GPIOA->BSRR = GPIO_PIN_5;//SCKRalph!
GPIOA->BSRR = GPIO_PIN_7;//Ralph!
//CS Les broches sont connectées directement GND
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pin = OLED_DC_Pin|OLED_RES_Pin;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
#define MOSI_H GPIOA->BSRR = GPIO_PIN_7 //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, GPIO_PIN_SET) //
#define MOSI_L GPIOA->BRR = GPIO_PIN_7 //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, GPIO_PIN_RESET) //
#define SCK_H GPIOA->BSRR = GPIO_PIN_5 //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET) //
#define SCK_L GPIOA->BRR = GPIO_PIN_5 //HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET) //
//#define MISO
#define NSS_H
#define NSS_L
void delayUS(uint32_t nus)
{
uint16_t i;
for(i=0;i<nus;i++)
{
}
}
//Peut être utiliséSPIDe la façon dont HAL_SPI_Transmit(&hspi1,&data,1,1);
void My_SPI_Transmit(unsigned char data)
{
unsigned char i; //Définir les variables
for(i = 0; i < 8; i++) //Cycle8Une fois
{
SCK_L;
delayUS(1);
if(data&0x80)
MOSI_H;
else
MOSI_L;
data<<=1;
delayUS(1);
SCK_H;
delayUS(1);
}
}
Mesure réelle,Le micro - ordinateur à puce unique fonctionne72MHzDans le cas de,Ci - dessusMy_SPI_Transmit La fonction prend environ 76.4Microsecondes.
Fichier pilote
https://download.csdn.net/download/Kshine2017/85519013
边栏推荐
- 夏志刚介绍
- Web security - payload
- 5. 无线体内纳米网:十大“可行吗?”问题
- 永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
- recyclerview gridlayout 平分中间空白区域
- Tencent architects first, 2022 Android interview written examination summary
- An East SMS login resurrection installation and deployment tutorial
- Unity making plug-ins
- B-杰哥的树(状压树形dp)
- String length limit?
猜你喜欢
rt-thread i2c 使用教程
Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
I've seen many tutorials, but I still can't write a program well. How can I break it?
Leetcode question 283 Move zero
【Yann LeCun点赞B站UP主使用Minecraft制作的红石神经网络】
数字三角形模型 AcWing 1018. 最低通行费
"Penalty kick" games
Notes on beagleboneblack
22-07-05 upload of qiniu cloud storage pictures and user avatars
Ideas and methods of system and application monitoring
随机推荐
Notes on beagleboneblack
设计你的安全架构OKR
青龙面板白屏一键修复
【计网】第三章 数据链路层(3)信道划分介质访问控制
BUUCTF---Reverse---easyre
How to handle the timeout of golang
What programming do children learn?
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
“罚点球”小游戏
Catch ball game 1
Tencent cloud database public cloud market ranks top 2!
Special topic of rotor position estimation of permanent magnet synchronous motor -- fundamental wave model and rotor position angle
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
An East SMS login resurrection installation and deployment tutorial
永磁同步电机转子位置估算专题 —— 基波模型类位置估算概要
爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
AddressSanitizer 技术初体验
Tencent T2 Daniel explained in person and doubled his job hopping salary
电子游戏的核心原理
JMeter server resource indicator monitoring (CPU, memory, etc.)