首先我们打开该工程的OLED_I2C.H文件(本文最下面附链,以STM32F1为例)
#define OLED_I2C I2C1
#define OLED_I2C_CLK RCC_APB1Periph_I2C1
#define OLED_I2C_CLK_INIT RCC_APB1PeriphClockCmd
#define OLED_I2C_SCL_PIN GPIO_Pin_6
#define OLED_I2C_SCL_GPIO_PORT GPIOB
#define OLED_I2C_SCL_GPIO_CLK RCC_AHB1Periph_GPIOB
#define OLED_I2C_SCL_SOURCE GPIO_PinSource6
#define OLED_I2C_SCL_AF GPIO_AF_I2C1
#define OLED_I2C_SDA_PIN GPIO_Pin_7
#define OLED_I2C_SDA_GPIO_PORT GPIOB
#define OLED_I2C_SDA_GPIO_CLK RCC_AHB1Periph_GPIOB
#define OLED_I2C_SDA_SOURCE GPIO_PinSource7
#define OLED_I2C_SDA_AF GPIO_AF_I2C1
void I2C_Configuration(void);
void I2C_WriteByte(uint8_t addr,uint8_t data);
void WriteCmd(unsigned char I2C_Command);
void WriteDat(unsigned char I2C_Data);
void OLED_Init(void);
void OLED_SetPos(unsigned char x, unsigned char y);
void OLED_Fill(unsigned char fill_Data);
void OLED_CLS(void);
void OLED_ON(void);
void OLED_OFF(void);
void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize);
void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N);
void OLED_DrawBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char BMP[]);
|