You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6 KiB

/*
* @Author: your name
* @Date: 2022-04-15 23:28:17
* @LastEditTime: 2022-04-17 21:20:15
* @LastEditors: Please set LastEditors
* @Description: koroFileHeader查看配置 : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \USERe:\\\smart_waterheater\stm32\HARDWARE\OLED\oled.h
*/
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : 0.69<EFBFBD><EFBFBD>OLED <EFBFBD>ӿ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(STM32F103ZEϵ<EFBFBD><EFBFBD>IIC)
// ˵<EFBFBD><EFBFBD>:
// ----------------------------------------------------------------
// GND <EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
// VCC <EFBFBD><EFBFBD>5V<EFBFBD><EFBFBD>3.3v<EFBFBD><EFBFBD>Դ
// SCL <EFBFBD><EFBFBD>PC14<EFBFBD><EFBFBD>SCL<EFBFBD><EFBFBD>
// SDA <EFBFBD><EFBFBD>PC15<EFBFBD><EFBFBD>SDA<EFBFBD><EFBFBD>
// ----------------------------------------------------------------
//Copyright(C) <EFBFBD>о<EFBFBD>԰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>2014/3/16
//All rights reserved
//////////////////////////////////////////////////////////////////////////////////
#ifndef __OLED_H
#define __OLED_H
#include "sys.h"
#include "stdlib.h"
#define OLED_MODE 0
#define SIZE 8
#define XLevelL 0x00
#define XLevelH 0x10
#define Max_Column 128
#define Max_Row 64
#define Brightness 0xFF
#define X_WIDTH 128
#define Y_WIDTH 64
//-----------------OLED IIC<EFBFBD>˿ڶ<EFBFBD><EFBFBD><EFBFBD>----------------
#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_13)//SCL
#define OLED_SCLK_Set() GPIO_SetBits(GPIOB ,GPIO_Pin_13)
#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_15)//SDA
#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pin_15)
#define OLED_CMD 0 //д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define OLED_DATA 1 //д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//OLED<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD>
void OLED_WR_Byte(unsigned dat,unsigned cmd);
void OLED_Display_On(void);
void OLED_Display_Off(void);
void OLED_Init(void);
void OLED_Clear(void);
void OLED_DrawPoint(u8 x,u8 y,u8 t);
void OLED_Fill(u8 x1,u8 y1,u8 x2,u8 y2,u8 dot);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size);
void OLED_ShowString(u8 x,u8 y, u8 *p,u8 Char_Size);
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_ShowCHinese(u8 x,u8 y,u8 no);
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]);
void Delay_50ms(unsigned int Del_50ms);
void Delay_1ms(unsigned int Del_1ms);
void fill_picture(unsigned char fill_Data);
void Picture(void);
void IIC_Start(void);
void IIC_Stop(void);
void Write_IIC_Command(unsigned char IIC_Command);
void Write_IIC_Data(unsigned char IIC_Data);
void Write_IIC_Byte(unsigned char IIC_Byte);
void IIC_Wait_Ack(void);
#endif