247
OLED_write(((x_pos & 0x0F) | Set_Lower_Column_Start_Address_CMD), CMD);
OLED_write((((x_pos & 0xF0) >> 0x04) | Set_Higher_Column_Start_Address_CMD),
CMD);
}
void OLED_fill(unsigned char bmp_data)
{
unsigned char x_pos = 0;
unsigned char page = 0;
for(page = y_min; page < y_max; page++)
{
OLED_write((Set_Page_Start_Address_CMD + page), CMD);
OLED_write(Set_Lower_Column_Start_Address_CMD, CMD);
OLED_write(Set_Higher_Column_Start_Address_CMD, CMD);
for(x_pos = x_min; x_pos < x_max; x_pos++)
{
OLED_write(bmp_data, DAT);
}
}
}
void OLED_clear_screen(void)
{
OLED_fill(0x00);
}
void OLED_cursor(unsigned char x_pos, unsigned char y_pos)
{
unsigned char i = 0;
if(y_pos != 0)
{
if(x_pos == 1)
{
OLED_gotoxy(0x00, (y_pos + 0x02));
}
else
{
OLED_gotoxy((0x50 + ((x_pos - 0x02) * 0x06)), (y_pos + 0x02));
}
for(i = 0; i < 6; i++)
{
OLED_write(0xFF, DAT);
}
}
}
void OLED_print_char(unsigned char x_pos, unsigned char y_pos, unsigned char ch)
{
unsigned char chr = 0;
unsigned char s = 0;