ISKBoard example project
guowenxue
5 days ago 1105733dc07562240bd061a1d8b0869c8c596805
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**********************************************************************
*   Copyright: (C)2021 LingYun IoT System Studio <www.weike-iot.com>
*      Author: GuoWenxue<guowenxue@gmail.com> QQ: 281143292
* Description: ISKBoard OLED(N091-2832TSWFG02-H14, 128x32) driver
*
*   ChangeLog:
*        Version    Date       Author            Description
*        V1.0.0  2021.08.10  GuoWenxue      Release initial version
***********************************************************************/
 
#ifndef INC_HAL_OLED_H_
#define INC_HAL_OLED_H_
 
#include "stm32l4xx_hal.h"
#include "i2c_bitbang.h"
#include "font_oled.h"
 
#define OLED_CHIPADDR              0x3C      /* OLED chip address */
 
#define X_WIDTH                    128
#define Y_WIDTH                    32
 
#define OLED_FONT16                16
#define OLED_FONT8                 8
 
/*
 *+-------------------------------------------------+
 *|        OLED initial/control function API        |
 *+-------------------------------------------------+
 */
void OLED_Init(void);
void OLED_On(void);
void OLED_Clear(void);
void OLED_Display_On(void);
void OLED_Display_Off(void);
 
/*
 *+-------------------------------------------------+
 *|          OLED display function API              |
 *+-------------------------------------------------+
 */
void OLED_Set_Pos(uint8_t x, uint8_t y);
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size);
void OLED_ShowString(uint8_t x,uint8_t y, char *p,uint8_t font_size);
 
/* Show Chinese on OLED */
void OLED_ShowChinese(const uint8_t (*Hzk)[32], uint8_t x, uint8_t y, uint8_t number);
 
/* Show BMP images(128x64) on OLED, x: 0~127  y:0~7 */
void OLED_DrawBMP(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, const uint8_t * bmp);
 
#endif /* INC_HAL_OLED_H_ */