ZJY 1.5" OLED
This commit is contained in:
parent
1938063a29
commit
7195fa4323
|
@ -1,9 +1,9 @@
|
||||||
#ifndef EPD_IMPL_H
|
#ifndef EPD_IMPL_H
|
||||||
#define EPD_IMPL_H
|
#define EPD_IMPL_H
|
||||||
|
|
||||||
#include "epd_common.h"
|
#include "epd-spi/epd_common.h"
|
||||||
|
|
||||||
#define EPD_IMPL_CMD_DC_CHANGE_AT_PARAM 1
|
#define EPD_IMPL_CMD_DC_CHANGE_AT_PARAM 0
|
||||||
|
|
||||||
int epd_impl_init(void);
|
int epd_impl_init(void);
|
||||||
epd_ret_t epd_impl_reset_cb(void *handle);
|
epd_ret_t epd_impl_reset_cb(void *handle);
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "epd_impl.h"
|
#include "epd_impl.h"
|
||||||
#include "lcd_panel_jlx256128g_920.h"
|
#include "epd-spi/panel/oled_zjy150s700.h"
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
@ -409,17 +409,13 @@ static void MX_GPIO_Init(void)
|
||||||
|
|
||||||
/* USER CODE BEGIN 4 */
|
/* USER CODE BEGIN 4 */
|
||||||
|
|
||||||
static lcd_jlx256128g_t s_lcd = {
|
static oled_zjy150s700_t s_oled = {
|
||||||
.cb = {
|
.cb = {
|
||||||
.reset_cb = epd_impl_reset_cb,
|
.reset_cb = epd_impl_reset_cb,
|
||||||
.write_command_cb = epd_impl_write_cmd_cb,
|
.write_command_cb = epd_impl_write_cmd_cb,
|
||||||
.write_data_cb = epd_impl_write_data_cb,
|
.write_data_cb = epd_impl_write_data_cb,
|
||||||
},
|
},
|
||||||
.user_data = NULL,
|
.user_data = NULL,
|
||||||
.config = {
|
|
||||||
.contrast = 310,
|
|
||||||
.mode = LCD_JLX256128G_MODE_GS,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint8_t s_frame[8192];
|
static uint8_t s_frame[8192];
|
||||||
|
@ -437,14 +433,14 @@ void StartDefaultTask(void *argument)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN 5 */
|
/* USER CODE BEGIN 5 */
|
||||||
epd_impl_init();
|
epd_impl_init();
|
||||||
lcd_jlx256128g_init(&s_lcd);
|
oled_zjy150s700_init(&s_oled);
|
||||||
|
|
||||||
memset(s_frame, 0x00, 256);
|
memset(s_frame, 0x00, 256);
|
||||||
memset(&s_frame[256], 0x55, 256);
|
memset(&s_frame[256], 0x55, 256);
|
||||||
memset(&s_frame[512], 0xAA, 256);
|
memset(&s_frame[512], 0xAA, 256);
|
||||||
memset(&s_frame[768], 0xFF, 256);
|
memset(&s_frame[768], 0xFF, 256);
|
||||||
|
|
||||||
lcd_jlx256128g_upload(&s_lcd, NULL, s_frame);
|
oled_zjy150s700_upload(&s_oled, NULL, s_frame);
|
||||||
|
|
||||||
osDelay(1000);
|
osDelay(1000);
|
||||||
|
|
||||||
|
@ -454,7 +450,7 @@ void StartDefaultTask(void *argument)
|
||||||
}
|
}
|
||||||
|
|
||||||
FIL apple_fd;
|
FIL apple_fd;
|
||||||
if(f_open(&apple_fd, "0:/apple/apple_st75256.bin", FA_READ) != FR_OK) {
|
if(f_open(&apple_fd, "0:/apple/apple_ssd1327.bin", FA_READ) != FR_OK) {
|
||||||
printf("Apple not found.\r\n");
|
printf("Apple not found.\r\n");
|
||||||
goto dead_loop;
|
goto dead_loop;
|
||||||
}
|
}
|
||||||
|
@ -465,7 +461,7 @@ void StartDefaultTask(void *argument)
|
||||||
if(f_read(&apple_fd, s_frame, 8192, &br) != FR_OK) {
|
if(f_read(&apple_fd, s_frame, 8192, &br) != FR_OK) {
|
||||||
printf("Read failed.\r\n");
|
printf("Read failed.\r\n");
|
||||||
}
|
}
|
||||||
lcd_jlx256128g_upload(&s_lcd, NULL, s_frame);
|
oled_zjy150s700_upload(&s_oled, NULL, s_frame);
|
||||||
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||||
uint32_t frame_end = osKernelGetTickCount();
|
uint32_t frame_end = osKernelGetTickCount();
|
||||||
if(frame_end - frame_start < 33) {
|
if(frame_end - frame_start < 33) {
|
||||||
|
@ -476,6 +472,8 @@ void StartDefaultTask(void *argument)
|
||||||
dead_loop:
|
dead_loop:
|
||||||
osDelay(5000);
|
osDelay(5000);
|
||||||
|
|
||||||
|
oled_zjy150s700_power(&s_oled, 0);
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3d497800bbb4a069a62d989623ab16ce550ab312
|
Subproject commit cdd4834ea6ba351f5a9d588231a5f375290e2519
|
Loading…
Reference in New Issue
Block a user