Replies: 5 comments 13 replies
-
You could try the |
Beta Was this translation helpful? Give feedback.
-
full project as zip file I have modified static const uint8_t u8x8_d_ssd1322_256x64_init_seq[] in u8x8_d_ssd1322.c and added u8g2_stm32f4 (.c + .h) |
Beta Was this translation helpful? Give feedback.
-
#include "main.h"
#include "stm32f4xx_hal.h"
#include "u8g2.h"
#include "u8g2_stm32f4.h"
#define DEVICE_ADDRESS 0x3C
#define TX_TIMEOUT 100
extern SPI_HandleTypeDef hspi2;
extern I2C_HandleTypeDef hi2c1;
uint8_t u8x8_stm32_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
/* STM32 supports HW SPI, Remove unused cases like U8X8_MSG_DELAY_XXX & U8X8_MSG_GPIO_XXX */
switch(msg)
{
case U8X8_MSG_GPIO_AND_DELAY_INIT:
/* Insert codes for initialization */
break;
case U8X8_MSG_DELAY_MILLI:
/* ms Delay */
HAL_Delay(arg_int);
break;
case U8X8_MSG_GPIO_CS:
/* Insert codes for SS pin control */
HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, arg_int);
break;
case U8X8_MSG_GPIO_DC:
/* Insert codes for DC pin control */
HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, arg_int);
break;
case U8X8_MSG_GPIO_RESET:
/* Insert codes for RST pin control */
HAL_GPIO_WritePin(OLED_RST_GPIO_Port, OLED_RST_Pin, arg_int);
break;
}
return 1;
}
uint8_t u8x8_byte_stm32_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
switch(msg) {
case U8X8_MSG_BYTE_SEND:
/* Insert codes to transmit data */
if(HAL_SPI_Transmit(&hspi2, arg_ptr, arg_int, TX_TIMEOUT) != HAL_OK) return 0;
break;
case U8X8_MSG_BYTE_INIT:
/* Insert codes to begin SPI transmission */
break;
case U8X8_MSG_BYTE_SET_DC:
/* Control DC pin, U8X8_MSG_GPIO_DC will be called */
u8x8_gpio_SetDC(u8x8, arg_int);
break;
case U8X8_MSG_BYTE_START_TRANSFER:
/* Select slave, U8X8_MSG_GPIO_CS will be called */
u8x8_gpio_SetCS(u8x8, u8x8->display_info->chip_enable_level);
HAL_Delay(1);
break;
case U8X8_MSG_BYTE_END_TRANSFER:
HAL_Delay(1);
/* Insert codes to end SPI transmission */
u8x8_gpio_SetCS(u8x8, u8x8->display_info->chip_disable_level);
break;
default:
return 0;
}
return 1;
} |
Beta Was this translation helpful? Give feedback.
-
Thanks for the code reply. I did a more closer look to both of the datasheets (SSD1322 vs SSD1362): Although the commands are almost the same, the SSD1362 doesn't need the 0x5c to enable RAM write: Line 205 in cd5b470 Moreover the logic level for the DC line for command arguments is inverted. As a result we need "cad_001" for SSD1362 (instead of "cad_011"). u8g2/tools/codebuild/codebuild.c Line 1847 in cd5b470 I will create a complete new constructor for the SSD1362. |
Beta Was this translation helpful? Give feedback.
-
I created an issue for this topic, let's continue there: #2051 |
Beta Was this translation helpful? Give feedback.
-
Hi,
I wanted to make project with WInstar WEA025664A 256x64 oled display. SSD1362 controller.
unfortunately it is not directly compatible with u8g2.
Does anyone know what controller it is compatible with or closest to?
What would need to be changed?
Could it be added in the next release?
https://www.winstar.com.tw/pl/products/oled-module/graphic-oled-display/wea025664a.html
THX
Beta Was this translation helpful? Give feedback.
All reactions