当前位置:网站首页>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
边栏推荐
- What happened to the kernel after malloc() was transferred? Attached malloc () and free () implementation source
- Linear distance between two points of cesium
- 腾讯云数据库公有云市场稳居TOP 2!
- B-jiege's tree (pressed tree DP)
- 小孩子学什么编程?
- Error analysis ~csdn rebound shell error
- Wonderful coding [hexadecimal conversion]
- Tencent cloud database public cloud market ranks top 2!
- Rhcsa Road
- 解剖生理学复习题·VIII血液系统
猜你喜欢
腾讯架构师首发,2022Android面试笔试总结
Discussion on beegfs high availability mode
Tencent T3 Daniel will teach you hand-in-hand, the internal information of the factory
【Yann LeCun点赞B站UP主使用Minecraft制作的红石神经网络】
永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
An East SMS login resurrection installation and deployment tutorial
小孩子学什么编程?
爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
01 basic introduction - concept nouns
案例 ①|主机安全建设:3个层级,11大能力的最佳实践
随机推荐
AddressSanitizer 技术初体验
Extraction rules and test objectives of performance test points
02 basic introduction - data package expansion
Deep learning classification network -- zfnet
5. Nano - Net in wireless body: Top 10 "is it possible?" Questions
Trends of "software" in robotics Engineering
[network planning] Chapter 3 data link layer (3) channel division medium access control
报错分析~csdn反弹shell报错
Le lancement du jupyter ne répond pas après l'installation d'Anaconda
Error analysis ~csdn rebound shell error
永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
Qinglong panel white screen one key repair
Tencent T4 architect, Android interview Foundation
Leetcode question 448 Find all missing numbers in the array
8086 instruction code summary (table)
Cesium Click to draw a circle (dynamically draw a circle)
Special topic of rotor position estimation of permanent magnet synchronous motor -- Summary of position estimation of fundamental wave model
B-杰哥的树(状压树形dp)