资源简介
附件为ssd1306控制器的驱动oled,调试ok,有需求的可下载。
代码片段和文件信息
#include “DalSsd1306.h“
#include “nrf_log.h“
#include “nrf_log_ctrl.h“
typedef struct
{
OPERATE_HANDLE pvI2cHandle;
}TDalOledMgr;
TDalOledMgr g_tDalOledMgr = {NULL};
#define DAL_OLED_WRITE_CMD 0x00 //write cmd
#define DAL_OLED_WRITE_DATA 0x40 // write data
#define OLED_INIT_TRANSFER_COUNT 1
#define DAL_OLED_RST_PIN_NUM (8) // oled reset pin
#define DAL_OLED_DIS_EN_PIN_NUM (2)
static uint8_t g_u8OledCtrl[] = {DAL_OLED_WRITE_CMDDAL_OLED_WRITE_DATA};
app_twi_transfer_t const g_u8OledWriteCmd = {
.p_data = &g_u8OledCtrl[0]
.length = 1
.operation = (DAL_OLED_SLAVE_ADDR << 1) | 0
.flags = 0
};
app_twi_transfer_t const g_u8OledWriteData = {
.p_data = &g_u8OledCtrl[1]
.length = 1
.operation = (DAL_OLED_SLAVE_ADDR << 1) | 1
.flags = 0
};
// oled init buffer
#ifdef USE_64_X_32_OLED
static uint8_t g_u8OledInitBuffer1[] = {0xAE0x000x120x000XB00x810xFF0xA10xA60xA8 };
static uint8_t g_u8OledInitBuffer2[] = {0x1F0xC80xD30x000xD50x800xD90x1F0xDA0x12};
static uint8_t g_u8OledInitBuffer3[] = {0xDB0X400x8D0x140xAF };
#else
static uint8_t g_u8OledInitBuffer1[] = {0xAE0xD50xF00xA80X270xD30x000x400x8D0x10 };
static uint8_t g_u8OledInitBuffer2[] = {0x200x020xA10xC80xDA0x120xAD0x300x810xFF};
static uint8_t g_u8OledInitBuffer3[] = {0xD90X220xDB0x200xA40xA60x0C0x110xAF};
//static uint8_t g_u8OledInitBuffer1[] = {0xAE0x000x100x400XB00x810x2F0xA10xA6};
//static uint8_t g_u8OledInitBuffer2[] = {0xA80x270xC80xD30x000xD50xF00xD80x050xD90x22};
//static uint8_t g_u8OledInitBuffer3[] = {0xDA0x120xDB0x200x8D0x100xAF };
#endif
app_twi_transfer_t const g_u8OledInit1 =
{
.p_data = &g_u8OledInitBuffer1[0]
.length = sizeof(g_u8OledInitBuffer1)
.operation = (DAL_OLED_SLAVE_ADDR << 1) | 0
.flags = 0
};
app_twi_transfer_t const g_u8OledInit2 =
{
.p_data = &g_u8OledInitBuffer2[0]
.length = sizeof(g_u8OledInitBuffer2)
.operation = (DAL_OLED_SLAVE_ADDR << 1) | 0
.flags = 0
};
app_twi_transfer_t const g_u8OledInit3 =
{
.p_data = &g_u8OledInitBuffer3[0]
.length = sizeof(g_u8OledInitBuffer3)
.operation = (DAL_OLED_SLAVE_ADDR << 1) | 0
.flags = 0
};
//uint8_t g_u8OledGram[DAL_OLED_COLUM][DAL_OLED_PAGE];
static uint32_t u32DalOledInit(void);
static EErrorCodeInf eDalOledOpen(void* pvArgs pvDevIntCallBackFun pfOledIntCb);
static void vDalOledTransBufferCreat(app_twi_transfer_t * ptDataStructuint8_t u8RdOrWrite uint8_t * pu8Datauint32_t u32DataLen);
//static void vDalOledGramRefresh(void) ;
static void vDalOledClearScreen(void);
static uint32_t u32DalOledWriteCmd(uint8_t* u8CmdBufferuint32_t u32CmdLen);
static EErrorCodeInf eDalOledCtrl(EDevCmd eCmd void* pvArg);
static void vDalOledAllOn(void);
/******************************************************************************/
/
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26508 2018-07-19 13:57 SSD1306驱动Oled\DalSsd1306.c
文件 992 2018-06-27 11:26 SSD1306驱动Oled\DalSsd1306.h
目录 0 2018-07-27 13:29 SSD1306驱动Oled
----------- --------- ---------- ----- ----
27500 3
相关资源
- 如何基于STM32系列单片机实现加密保护
- 远程抄表系统中嵌入式GPRS无线通信模
- 电子-基于战舰版RC522IIC.rar
- 电子-STM32硬件I2CMaster接口函数V1.01.z
- 嵌入式系统/ARM技术中的基于ARM的汽车
- 2017最新嵌入式培训机构视频.zip
- 嵌入式系统/ARM技术中的基于嵌入式
- 一种新型基于多点预瞄的最优路径跟
- 基于ARM的一些课程设计
- 东南大学 嵌入式 实验
- Xilinx Zynq-7000嵌入式系统设计及实现
- 基于MCU的嵌入式在线升级系统的设计
- 嵌入式系统设计与应用(第2版) 习题
- rt-thread 完整源代码
- Quectel_LTE&5G_Linux_USB_Driver_User_Guide_V2.
- boa-0.94.13
- 嵌入式系统linux学习心得
- UCOS-II_API函数参考手册(带书签)
- 嵌入式系统原理与设计 机械工业出版
- 华为面试真题-嵌入式软件.pdf
- 嵌入式作业-交通灯使用
- 第十届蓝桥杯嵌入式方向程序设计题
- 第十届蓝桥杯嵌入式比赛备赛 资料汇
- 实验三:键盘显示自己的学号
- MC9S12G128 bootloader
- STM32制作的贪吃蛇小游戏
- 一步一步写嵌入式操作系统--ARM编程的
- 韦东山视频资料整合
- STM32F103ZET6库函数模板
- 《嵌入式Linux驱动开发教程》书中完整
评论
共有 条评论