Browse Source

Экран по I2C работает нормально. Нужно проверить на основной плате.

unknown 1 month ago
parent
commit
e29d7a027d

+ 0 - 3
desk/libs/thirdparty/oled_ssd1327_new/SSD1327.cpp

@@ -19,9 +19,6 @@ extern uint8_t oled_buf[];
 
 #define abs(x) ((x)>0?(x):-(x))
 
-//extern uint8_t buffer[];
-//#define frameBuffer buffer[];
-
 //SSD1327 ssd1327(0, 0, 0);
 
 SSD1327::SSD1327(int cs, int dc, int rst) {

+ 2 - 0
desk/modules/ssd_1327/i2c_bridge.cpp

@@ -61,6 +61,7 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle)
         __HAL_RCC_GPIOA_CLK_ENABLE();
         __HAL_RCC_GPIOC_CLK_ENABLE();
         
+        // I2C2 SDA
         GPIO_InitStruct.Pin = GPIO_PIN_8;
         GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
@@ -68,6 +69,7 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle)
         GPIO_InitStruct.Alternate = GPIO_AF4_I2C2;
         HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
         
+        // I2C2 CLCK
         GPIO_InitStruct.Pin = GPIO_PIN_4;
         GPIO_InitStruct.Alternate = GPIO_AF4_I2C2;
         HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

+ 7 - 2
desk/modules/ssd_1327/oled_common.cpp

@@ -34,12 +34,10 @@ void init_oled(void)
 #if defined(I2C_BRIDGE)
     i2c_bridge_init();
     i2c_bridge = i2c_get_bridge();
-    //SSD1327_I2cInit(i2c_bridge);
     
 #elif defined(SPI_BRIDGE)
     spi_bridge_init();
     spi_bridge = spi_get_bridge();
-    //SSD1327_SpiInit(spi_bridge);
 #endif
     
     oled_init();
@@ -96,7 +94,12 @@ void init_gpio_oled(void)
     HAL_GPIO_Init(OLED_DC_PORT, &GPIO_InitStruct);
         
     HAL_GPIO_WritePin(OLED_RST_PORT, OLED_RST_PIN, GPIO_PIN_RESET);
+    
+#if defined(I2C_BRIDGE)
+    HAL_GPIO_WritePin(OLED_DC_PORT, OLED_DC_PIN, GPIO_PIN_SET);
+#elif defined(SPI_BRIDGE)
     HAL_GPIO_WritePin(OLED_DC_PORT, OLED_DC_PIN, GPIO_PIN_RESET);
+#endif    
 }
 
 //
@@ -390,9 +393,11 @@ void oled_clear(uint8_t color)
 //
 void oled_dma_end_callback(SPI_HandleTypeDef *hspi)
 {
+#if defined(SPI_BRIDGE)  
 	if (hspi == spi_bridge) {
 		OLED_CS_1;
 	}
+#endif    
 }
 
 

+ 2 - 2
desk/modules/ssd_1327/oled_config.h

@@ -2,10 +2,10 @@
 #define __OLED_CONFIG_H
 
 // Интерфейс экрана
-//#define I2C_BRIDGE
+#define I2C_BRIDGE
 
 // Интерфейс экрана
-#define SPI_BRIDGE
+//#define SPI_BRIDGE
 
 
 #define OLED_RST_PIN    GPIO_PIN_5

BIN
output/desk.bin


+ 0 - 6
project/ewarm/desk/desk.ewp

@@ -2486,12 +2486,6 @@
                     <name>$PROJ_DIR$\..\..\..\desk\libs\thirdparty\oled_ssd1327\logo_grayscale.h</name>
                 </file>
             </group>
-            <group>
-                <name>oled_ssd1327_new</name>
-                <file>
-                    <name>$PROJ_DIR$\..\..\..\desk\libs\thirdparty\oled_ssd1327_new\SSD1327.cpp</name>
-                </file>
-            </group>
         </group>
     </group>
     <group>

+ 0 - 6
project/ewarm/desk/desk.ewt

@@ -3185,12 +3185,6 @@
                     <name>$PROJ_DIR$\..\..\..\desk\libs\thirdparty\oled_ssd1327\logo_grayscale.h</name>
                 </file>
             </group>
-            <group>
-                <name>oled_ssd1327_new</name>
-                <file>
-                    <name>$PROJ_DIR$\..\..\..\desk\libs\thirdparty\oled_ssd1327_new\SSD1327.cpp</name>
-                </file>
-            </group>
         </group>
     </group>
     <group>

File diff suppressed because it is too large
+ 0 - 0
project/ewarm/settings/tuber.wsdt


Some files were not shown because too many files changed in this diff