I have use STM32F0 microcontroller.
I try to integrate the stm32 with OLED(SSD1306:128*64).
It's an I2C communication. The issue is while clearing the display takes some seconds(like 2sec.).
How can I make it faster?
I have attached the issue portion image.
Is there any way to solve the issue?
I think the issue in I2C_TransferHandling function, because its repeatedly call in loop. But no idea about how to solve this issue.
void Display_Clear(void)
{
int i = 0;
Write_inst_oled(SSD1306_SET_COLUMN_ADDR);
Write_inst_oled(0);
Write_inst_oled(127);
Write_inst_oled(SSD1306_SET_PAGE_ADDR);
Write_inst_oled(0);
Write_inst_oled(7);
I2C_TransferHandling(I2C1,(SlaveAddr<<1),1, I2C_Reload_Mode, I2C_Generate_Start_Write);
while(I2C_GetFlagStatus(I2C1, I2C_FLAG_TXIS) == RESET);
Display_SendByte(SSD1306_DATA_CONTINUE);
delay_ms(1);
for (i = 0; i < 1024; i++) // Write Zeros to clear the display
{
I2C_TransferHandling(I2C1,0, 1, I2C_Reload_Mode, I2C_No_StartStop);
while(I2C_GetFlagStatus(I2C1, I2C_FLAG_TXIS) == RESET);
Display_SendByte(0);
delay_ms(1);
}
I2C_TransferHandling(I2C1, (SlaveAddr<<1), 0, I2C_SoftEnd_Mode, I2C_Generate_Start_Write);
Write_inst_oled(SSD1306_SET_COLUMN_ADDR);
Write_inst_oled(0);
Write_inst_oled(127);
Write_inst_oled(SSD1306_SET_PAGE_ADDR);
Write_inst_oled(0);
Write_inst_oled(7);
}