diff --git a/ssd1306.c b/ssd1306.c --- a/ssd1306.c +++ b/ssd1306.c @@ -81,13 +81,10 @@ void WriteData(unsigned char data) void SSD1303_Init(void) { - /* Initialize SPI2 */ - // TODO - /* Generate a reset */ SSD_Reset_Low(); - uint32_t i ; - for(i=5000;--i;); + uint32_t i; + for(i=5000; i>1; i--) SSD_Reset_High(); /************************************************* @@ -95,6 +92,7 @@ void SSD1303_Init(void) *************************************************/ // Lower Column Address WriteCommand(0x00); /* Set Lower Column Address */ + GPIO_SetBits(GPIOA,GPIO_Pin_15); // High Column Address WriteCommand(0x10); /* Set Higher Column Address*/ // Display Start Line @@ -121,7 +119,8 @@ void SSD1303_Init(void) // Set DC-DC WriteCommand(0xAD); /* Set DC-DC */ WriteCommand(0x8B); /* 8B=ON, 8A=Off */ - + + // Display ON/OFF WriteCommand(0xAE); /* AF=ON , AE=OFF*/ // Display Offset