#include "fw_hal.h"
#include "ssd1306.h"
Go to the source code of this file.
◆ GPIO_Init()
Definition at line 43 of file ssd1306_stc8h3k.c.
44{
45
47
49}
#define GPIO_P3_SetMode(__PINS__, __MODE__)
◆ I2C_Init()
I2C clock = FOSC / 2 / (prescaler * 2 + 4) SSD1306 works with i2c clock up to 1.3 MHz, beyond this value, display may fail.
Definition at line 28 of file ssd1306_stc8h3k.c.
29{
30
37
39
41}
#define I2C_SetClockPrescaler(__DIV__)
#define I2C_SetWorkMode(__MODE__)
#define I2C_SetEnabled(__STATE__)
#define I2C_SetPort(__ALTER_PORT__)
◆ main()
Definition at line 51 of file ssd1306_stc8h3k.c.
52{
53 int y1, y2;
55
60
61 while(1)
62 {
69
71
75
79
80 y1 = 64, y2 = 0;
81 while (y1 > 0)
82 {
85 y1 -= 2;
86 y2 += 2;
87 }
89
91 y1 = 127, y2 = 0;
92 while (y1 > 0)
93 {
96 y1 -= 2;
97 y2 += 2;
98 }
100 }
101}
void SYS_Delay(uint16_t t)
void SSD1306_Fill(uint8_t color)
Fills entire LCD with desired color.
void SSD1306_ToggleInvert(void)
Toggles pixels invertion inside internal RAM.
void SSD1306_UpdateScreen(void)
Updates buffer from internal RAM to LCD.
void SSD1306_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c)
Draws line on LCD.