当前位置:网站首页>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
边栏推荐
- 解剖生理学复习题·VIII血液系统
- Leetcode question 283 Move zero
- 爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
- 【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
- 【DSP】【第二篇】了解C6678和创建工程
- 8086指令码汇总表(表格)
- Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
- Speech recognition (ASR) paper selection: talcs: an open source Mandarin English code switching corps and a speech
- 枚举根据参数获取值
- 数字三角形模型 AcWing 1018. 最低通行费
猜你喜欢

Tencent byte Alibaba Xiaomi jd.com offer got a soft hand, and the teacher said it was great

Basic knowledge of lists

02 基础入门-数据包拓展
![[cloud native and 5g] micro services support 5g core network](/img/c9/4ccacd1e70285c2ceb50c324e5018c.png)
[cloud native and 5g] micro services support 5g core network

Deep learning classification network -- zfnet

SQL injection 2

Crawler (14) - scrape redis distributed crawler (1) | detailed explanation

深度学习分类网络 -- ZFNet

Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行

Cesium 点击绘制圆形(动态绘制圆形)
随机推荐
Tencent Android development interview, basic knowledge of Android Development
【每周一坑】信息加密 +【解答】正整数分解质因数
How to handle the timeout of golang
报错分析~csdn反弹shell报错
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Function optimization and arrow function of ES6
【每周一坑】输出三角形
mod_ WSGI + pymssql path SQL server seat
Introduction of Xia Zhigang
电子游戏的核心原理
JVM_ Common [interview questions]
01 基础入门-概念名词
逻辑是个好东西
Node.js: express + MySQL实现注册登录,身份认证
AddressSanitizer 技术初体验
【每周一坑】计算100以内质数之和 +【解答】输出三角形
5. 无线体内纳米网:十大“可行吗?”问题
22-07-05 七牛云存储图片、用户头像上传
Initial experience of addresssanitizer Technology
【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN