Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit794cb04

Browse files
authored
Merge branch 'main' into setting_up_ci
2 parents101fdaf +32987f1 commit794cb04

File tree

5 files changed

+95
-450
lines changed

5 files changed

+95
-450
lines changed

‎api_drivers/common_api_drivers/display/st7796.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
importlcd_bus# NOQA
77
importdisplay_driver_framework
88

9-
109
_SWRESET=const(0x01)
1110
_SLPOUT=const(0x11)
1211
_CSCON=const(0xF0)
@@ -22,6 +21,8 @@
2221
_NGC=const(0xE1)
2322
_DISPON=const(0x29)
2423

24+
_EM=const(0xB7)
25+
2526
STATE_HIGH=display_driver_framework.STATE_HIGH
2627
STATE_LOW=display_driver_framework.STATE_LOW
2728
STATE_PWM=display_driver_framework.STATE_PWM
@@ -83,9 +84,9 @@ def init(self):
8384

8485
color_size=lv.color_format_get_size(self._color_space)
8586
ifcolor_size==2:# NOQA
86-
pixel_format=0x55
87+
pixel_format=0x05
8788
elifcolor_size==3:
88-
pixel_format=0x77
89+
pixel_format=0x07
8990
else:
9091
raiseRuntimeError(
9192
'ST7796 IC only supports '
@@ -95,6 +96,9 @@ def init(self):
9596
param_buf[0]=pixel_format
9697
self.set_params(_COLMOD,param_mv[:1])
9798

99+
param_buf[0]=0xC6
100+
self.set_params(_EM,param_mv[:1])
101+
98102
param_buf[0]=0x01
99103
self.set_params(_DIC,param_mv[:1])
100104

@@ -126,7 +130,7 @@ def init(self):
126130
self.set_params(_PGC,param_mv[:14])
127131

128132
param_buf[:14]=bytearray([
129-
0xE0,0x09,0x0B,0x06,0x04,0x03,0x2B,
133+
0xF0,0x09,0x0B,0x06,0x04,0x03,0x2D,
130134
0x43,0x42,0x3B,0x16,0x14,0x17,0x1B
131135
])
132136
self.set_params(_NGC,param_mv[:14])

‎builder/esp32.py‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,17 @@ def get_espidf():
225225
board=None
226226
skip_partition_resize=False
227227
partition_size=None
228+
flash_size=8
229+
oct_flash=False
228230

229231

230232
defparse_args(extra_args,lv_cflags,brd):
231233
globalboard
232234
globalboard_variant
233235
globalskip_partition_resize
234236
globalpartition_size
237+
globalflash_size
238+
globaloct_flash
235239

236240
board=brd
237241

@@ -253,6 +257,28 @@ def parse_args(extra_args, lv_cflags, brd):
253257
ifarg.startswith('BOARD_VARIANT'):
254258
raiseRuntimeError(f'BOARD_VARIANT not supported by "{board}"')
255259

260+
ifboard=='ESP32_GENERIC_S3':
261+
esp_argParser=ArgumentParser(prefix_chars='-')
262+
263+
esp_argParser.add_argument(
264+
'--octal-flash',
265+
help='octal spi flash',
266+
dest='oct_flash',
267+
action='store_true'
268+
)
269+
270+
esp_argParser.add_argument(
271+
'--flash-size',
272+
dest='flash_size',
273+
help='flash size',
274+
default=8,
275+
type=int,
276+
action='store'
277+
)
278+
esp_args,extra_args=esp_argParser.parse_known_args(extra_args)
279+
flash_size=esp_args.flash_size
280+
oct_flash=esp_args.oct_flash
281+
256282
esp_argParser=ArgumentParser(prefix_chars='-')
257283

258284
esp_argParser.add_argument(
@@ -505,6 +531,65 @@ def submodules():
505531
defcompile():# NOQA
506532
env=setup_idf_environ()
507533

534+
ifboard=='ESP32_GENERIC_S3':
535+
base_config= [
536+
'CONFIG_ESPTOOLPY_FLASHMODE_QIO=y',
537+
'CONFIG_ESPTOOLPY_FLASHFREQ_80M=y',
538+
'CONFIG_ESPTOOLPY_AFTER_NORESET=y',
539+
'CONFIG_PARTITION_TABLE_CUSTOM=y',
540+
]
541+
542+
ifflash_size==4:
543+
base_config.extend([
544+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y',
545+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
546+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
547+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
548+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB.csv"'
549+
])
550+
elifflash_size==8:
551+
base_config.extend([
552+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
553+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y',
554+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
555+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
556+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"'
557+
])
558+
559+
elifflash_size==16:
560+
base_config.extend([
561+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
562+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
563+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y',
564+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
565+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"'
566+
])
567+
ifflash_size==32:
568+
base_config.extend([
569+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
570+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n',
571+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
572+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y',
573+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-32MiB.csv"'
574+
])
575+
else:
576+
base_config= [
577+
'CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n',
578+
'CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y',
579+
'CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n',
580+
'CONFIG_ESPTOOLPY_FLASHSIZE_32MB=n',
581+
'CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"'
582+
]
583+
584+
ifoct_flash:
585+
base_config[0]='CONFIG_ESPTOOLPY_FLASHMODE_DOUT=y'
586+
base_config.append('CONFIG_ESPTOOLPY_OCT_FLASH=y')
587+
588+
base_config='\n'.join(base_config)
589+
590+
withopen('lib/micropython/ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board','w')asf:
591+
f.write(base_config+'\n')
592+
508593
ifboardin ('ESP32_GENERIC_S2','ESP32_GENERIC_S3'):
509594

510595
mphalport_path='lib/micropython/ports/esp32/mphalport.c'

‎ext_mod/lcd_bus/esp32_src/spi_bus.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include"lcd_types.h"
44
#include"modlcd_bus.h"
55
#include"spi_bus.h"
6-
#include"spi_panel_bus.h"
76

87
// esp-idf includes
98
#include"driver/spi_common.h"
@@ -366,15 +365,15 @@ mp_lcd_err_t spi_init(mp_obj_t obj, uint16_t width, uint16_t height, uint8_t bpp
366365
self->panel_io_config.trans_queue_depth++;
367366
}
368367
}else {
369-
self->panel_io_config.trans_queue_depth=1;
368+
self->panel_io_config.trans_queue_depth=10;
370369
}
371370

372371
mp_lcd_err_tret=spi_bus_initialize(self->host,&self->bus_config,SPI_DMA_CH_AUTO);
373372
if (ret!=0) {
374373
mp_raise_msg_varg(&mp_type_ValueError,MP_ERROR_TEXT("%d(spi_bus_initialize)"),ret);
375374
}
376375

377-
ret=lcdbus_new_panel_io_spi(self->bus_handle,&self->panel_io_config,&self->panel_io_handle.panel_io,double_buffer);
376+
ret=esp_lcd_new_panel_io_spi(self->bus_handle,&self->panel_io_config,&self->panel_io_handle.panel_io);
378377
if (ret!=0) {
379378
mp_raise_msg_varg(&mp_type_ValueError,MP_ERROR_TEXT("%d(esp_lcd_new_panel_io_spi)"),ret);
380379
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp