From 8f779136fa84fa2ccc402c8f8ceb874d57e41836 Mon Sep 17 00:00:00 2001 From: balika011 Date: Mon, 10 Mar 2025 20:16:20 +0100 Subject: [PATCH 1/7] restructure firmware to be more inline with pro --- software/sys_controller/Makefile | 70 ++++++++++--------- .../sys_controller/{ossc => }/av_controller.c | 0 .../{ossc => config}/sysconfig.h | 0 .../{ => ic_drivers}/it6613/EDID.c | 0 .../{ => ic_drivers}/it6613/HDMI_COMMON.h | 0 .../{ => ic_drivers}/it6613/HDMI_TX.c | 0 .../{ => ic_drivers}/it6613/HDMI_TX.h | 0 .../{ => ic_drivers}/it6613/edid.h | 0 .../{ => ic_drivers}/it6613/hdmitx.h | 0 .../{ => ic_drivers}/it6613/hdmitx_nios2.c | 0 .../{ => ic_drivers}/it6613/it6613.c | 0 .../{ => ic_drivers}/it6613/it6613.h | 0 .../{ => ic_drivers}/it6613/it6613_drv.c | 0 .../{ => ic_drivers}/it6613/it6613_drv.h | 0 .../{ => ic_drivers}/it6613/it6613_sys.c | 0 .../{ => ic_drivers}/it6613/it6613_sys.h | 0 .../{ => ic_drivers}/it6613/typedef.h | 0 .../{ => ic_drivers}/pcm1862/pcm1862.c | 0 .../{ => ic_drivers}/pcm1862/pcm1862.h | 0 .../{ => ic_drivers}/pcm1862/pcm1862_regs.h | 0 .../{ => ic_drivers}/spi_charlcd/lcd.c | 0 .../{ => ic_drivers}/spi_charlcd/lcd.h | 0 .../{ => ic_drivers}/ths7353/ths7353.c | 0 .../{ => ic_drivers}/ths7353/ths7353.h | 0 .../{ => ic_drivers}/tvp7002/tvp7002.c | 0 .../{ => ic_drivers}/tvp7002/tvp7002.h | 0 .../{ => ic_drivers}/tvp7002/tvp7002_regs.h | 0 .../{ossc => inc}/av_controller.h | 0 .../sys_controller/{ossc => inc}/avconfig.h | 0 .../sys_controller/{ossc => inc}/controls.h | 0 .../{ossc => inc}/fat16_export.h | 0 .../sys_controller/{ossc => inc}/firmware.h | 0 .../sys_controller/{memory => inc}/flash.h | 0 software/sys_controller/{ossc => inc}/menu.h | 0 .../sys_controller/{memory => inc}/sdcard.h | 0 .../sys_controller/{ossc => inc}/userdata.h | 0 software/sys_controller/{ossc => inc}/utils.h | 0 .../{ossc => inc}/video_modes.h | 0 .../sys_controller/{ossc => src}/avconfig.c | 0 .../sys_controller/{ossc => src}/controls.c | 0 .../{ossc => src}/fat16_export.c | 0 .../sys_controller/{ossc => src}/firmware.c | 0 .../sys_controller/{memory => src}/flash.c | 0 software/sys_controller/{ossc => src}/menu.c | 0 .../sys_controller/{memory => src}/sdcard.c | 0 .../sys_controller/{ossc => src}/userdata.c | 0 software/sys_controller/{ossc => src}/utils.c | 0 .../{ossc => src}/video_modes.c | 0 .../{ossc => src}/video_modes_list.c | 0 49 files changed, 36 insertions(+), 34 deletions(-) rename software/sys_controller/{ossc => }/av_controller.c (100%) rename software/sys_controller/{ossc => config}/sysconfig.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/EDID.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/HDMI_COMMON.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/HDMI_TX.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/HDMI_TX.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/edid.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/hdmitx.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/hdmitx_nios2.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613_drv.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613_drv.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613_sys.c (100%) rename software/sys_controller/{ => ic_drivers}/it6613/it6613_sys.h (100%) rename software/sys_controller/{ => ic_drivers}/it6613/typedef.h (100%) rename software/sys_controller/{ => ic_drivers}/pcm1862/pcm1862.c (100%) rename software/sys_controller/{ => ic_drivers}/pcm1862/pcm1862.h (100%) rename software/sys_controller/{ => ic_drivers}/pcm1862/pcm1862_regs.h (100%) rename software/sys_controller/{ => ic_drivers}/spi_charlcd/lcd.c (100%) rename software/sys_controller/{ => ic_drivers}/spi_charlcd/lcd.h (100%) rename software/sys_controller/{ => ic_drivers}/ths7353/ths7353.c (100%) rename software/sys_controller/{ => ic_drivers}/ths7353/ths7353.h (100%) rename software/sys_controller/{ => ic_drivers}/tvp7002/tvp7002.c (100%) rename software/sys_controller/{ => ic_drivers}/tvp7002/tvp7002.h (100%) rename software/sys_controller/{ => ic_drivers}/tvp7002/tvp7002_regs.h (100%) rename software/sys_controller/{ossc => inc}/av_controller.h (100%) rename software/sys_controller/{ossc => inc}/avconfig.h (100%) rename software/sys_controller/{ossc => inc}/controls.h (100%) rename software/sys_controller/{ossc => inc}/fat16_export.h (100%) rename software/sys_controller/{ossc => inc}/firmware.h (100%) rename software/sys_controller/{memory => inc}/flash.h (100%) rename software/sys_controller/{ossc => inc}/menu.h (100%) rename software/sys_controller/{memory => inc}/sdcard.h (100%) rename software/sys_controller/{ossc => inc}/userdata.h (100%) rename software/sys_controller/{ossc => inc}/utils.h (100%) rename software/sys_controller/{ossc => inc}/video_modes.h (100%) rename software/sys_controller/{ossc => src}/avconfig.c (100%) rename software/sys_controller/{ossc => src}/controls.c (100%) rename software/sys_controller/{ossc => src}/fat16_export.c (100%) rename software/sys_controller/{ossc => src}/firmware.c (100%) rename software/sys_controller/{memory => src}/flash.c (100%) rename software/sys_controller/{ossc => src}/menu.c (100%) rename software/sys_controller/{memory => src}/sdcard.c (100%) rename software/sys_controller/{ossc => src}/userdata.c (100%) rename software/sys_controller/{ossc => src}/utils.c (100%) rename software/sys_controller/{ossc => src}/video_modes.c (100%) rename software/sys_controller/{ossc => src}/video_modes_list.c (100%) diff --git a/software/sys_controller/Makefile b/software/sys_controller/Makefile index 0292e9e..7afd78c 100644 --- a/software/sys_controller/Makefile +++ b/software/sys_controller/Makefile @@ -142,35 +142,35 @@ ACDS_VERSION := 14.1 ELF := sys_controller.elf # Paths to C, C++, and assembly source files. -C_SRCS += it6613/EDID.c -C_SRCS += it6613/HDMI_TX.c -C_SRCS += it6613/hdmitx_nios2.c -C_SRCS += it6613/it6613.c -C_SRCS += it6613/it6613_drv.c -C_SRCS += it6613/it6613_sys.c -C_SRCS += tvp7002/tvp7002.c -C_SRCS += ths7353/ths7353.c -C_SRCS += pcm1862/pcm1862.c -C_SRCS += spi_charlcd/lcd.c -C_SRCS += memory/flash.c -C_SRCS += memory/sdcard.c -C_SRCS += ossc/av_controller.c -C_SRCS += ossc/avconfig.c -C_SRCS += ossc/controls.c -C_SRCS += ossc/firmware.c -C_SRCS += ossc/fat16_export.c +C_SRCS += av_controller.c +C_SRCS += src/avconfig.c +C_SRCS += src/utils.c +C_SRCS += src/controls.c ifeq ($(OSDLANG),JP) -C_SRCS += ossc/menu_sjis.c +C_SRCS += src/menu_sjis.c else -C_SRCS += ossc/menu.c +C_SRCS += src/menu.c endif +C_SRCS += src/video_modes.c +C_SRCS += src/flash.c +C_SRCS += src/firmware.c ifeq ($(OSDLANG),JP) -C_SRCS += ossc/userdata_sjis.c +C_SRCS += src/userdata_sjis.c else -C_SRCS += ossc/userdata.c +C_SRCS += src/userdata.c endif -C_SRCS += ossc/utils.c -C_SRCS += ossc/video_modes.c +C_SRCS += src/sdcard.c +C_SRCS += src/fat16_export.c +C_SRCS += ic_drivers/it6613/EDID.c +C_SRCS += ic_drivers/it6613/HDMI_TX.c +C_SRCS += ic_drivers/it6613/hdmitx_nios2.c +C_SRCS += ic_drivers/it6613/it6613.c +C_SRCS += ic_drivers/it6613/it6613_drv.c +C_SRCS += ic_drivers/it6613/it6613_sys.c +C_SRCS += ic_drivers/tvp7002/tvp7002.c +C_SRCS += ic_drivers/ths7353/ths7353.c +C_SRCS += ic_drivers/pcm1862/pcm1862.c +C_SRCS += ic_drivers/spi_charlcd/lcd.c C_SRCS += ulibSD/sd_io.c C_SRCS += ulibSD/spi_io.c CXX_SRCS := @@ -217,14 +217,16 @@ BSP_ROOT_DIR := ../sys_controller_bsp/ # List of application specific include directories, library directories and library names APP_INCLUDE_DIRS += /usr/lib/picolibc/riscv64-unknown-elf/include -APP_INCLUDE_DIRS += it6613 -APP_INCLUDE_DIRS += tvp7002 -APP_INCLUDE_DIRS += ths7353 -APP_INCLUDE_DIRS += pcm1862 -APP_INCLUDE_DIRS += spi_charlcd +APP_INCLUDE_DIRS += config +APP_INCLUDE_DIRS += inc +APP_INCLUDE_DIRS += ic_drivers/it6613 +APP_INCLUDE_DIRS += ic_drivers/tvp7002 +APP_INCLUDE_DIRS += ic_drivers/ths7353 +APP_INCLUDE_DIRS += ic_drivers/pcm1862 +APP_INCLUDE_DIRS += ic_drivers/spi_charlcd +>>>>>>> 6015591 (restructure firmware to be more inline with pro) APP_INCLUDE_DIRS += memory APP_INCLUDE_DIRS += ulibSD -APP_INCLUDE_DIRS += ossc APP_LIBRARY_DIRS := APP_LIBRARY_NAMES := @@ -976,7 +978,7 @@ clean : clean_elf_derived_files endif clean : - @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) ossc/menu_sjis.c ossc/userdata_sjis.c + @$(RM) -r $(ELF) $(OBJDUMP_NAME) $(LINKER_MAP_NAME) $(OBJ_ROOT_DIR) $(RUNTIME_ROOT_DIR) $(FORCE_REBUILD_DEP_LIST) src/menu_sjis.c src/userdata_sjis.c @$(ECHO) [$(APP_NAME) clean complete] # Clean just the BSP. @@ -1133,11 +1135,11 @@ print-elf-name: #------------------------------------------------------------------------------ # CUSTOM TARGETS #------------------------------------------------------------------------------ -ossc/menu_sjis.c: ossc/menu.c - iconv -f UTF-8 -t SHIFT-JIS ossc/menu.c > ossc/menu_sjis.c +src/menu_sjis.c: src/menu.c + iconv -f UTF-8 -t SHIFT-JIS src/menu.c > src/menu_sjis.c -ossc/userdata_sjis.c: ossc/userdata.c - iconv -f UTF-8 -t SHIFT-JIS ossc/userdata.c > ossc/userdata_sjis.c +src/userdata_sjis.c: src/userdata.c + iconv -f UTF-8 -t SHIFT-JIS src/userdata.c > src/userdata_sjis.c mem_init/flash.hex: sys_controller.elf $(RV_OBJCOPY) --change-addresses -0x02080000 -O binary --gap-fill 0 $< mem_init/flash.bin diff --git a/software/sys_controller/ossc/av_controller.c b/software/sys_controller/av_controller.c similarity index 100% rename from software/sys_controller/ossc/av_controller.c rename to software/sys_controller/av_controller.c diff --git a/software/sys_controller/ossc/sysconfig.h b/software/sys_controller/config/sysconfig.h similarity index 100% rename from software/sys_controller/ossc/sysconfig.h rename to software/sys_controller/config/sysconfig.h diff --git a/software/sys_controller/it6613/EDID.c b/software/sys_controller/ic_drivers/it6613/EDID.c similarity index 100% rename from software/sys_controller/it6613/EDID.c rename to software/sys_controller/ic_drivers/it6613/EDID.c diff --git a/software/sys_controller/it6613/HDMI_COMMON.h b/software/sys_controller/ic_drivers/it6613/HDMI_COMMON.h similarity index 100% rename from software/sys_controller/it6613/HDMI_COMMON.h rename to software/sys_controller/ic_drivers/it6613/HDMI_COMMON.h diff --git a/software/sys_controller/it6613/HDMI_TX.c b/software/sys_controller/ic_drivers/it6613/HDMI_TX.c similarity index 100% rename from software/sys_controller/it6613/HDMI_TX.c rename to software/sys_controller/ic_drivers/it6613/HDMI_TX.c diff --git a/software/sys_controller/it6613/HDMI_TX.h b/software/sys_controller/ic_drivers/it6613/HDMI_TX.h similarity index 100% rename from software/sys_controller/it6613/HDMI_TX.h rename to software/sys_controller/ic_drivers/it6613/HDMI_TX.h diff --git a/software/sys_controller/it6613/edid.h b/software/sys_controller/ic_drivers/it6613/edid.h similarity index 100% rename from software/sys_controller/it6613/edid.h rename to software/sys_controller/ic_drivers/it6613/edid.h diff --git a/software/sys_controller/it6613/hdmitx.h b/software/sys_controller/ic_drivers/it6613/hdmitx.h similarity index 100% rename from software/sys_controller/it6613/hdmitx.h rename to software/sys_controller/ic_drivers/it6613/hdmitx.h diff --git a/software/sys_controller/it6613/hdmitx_nios2.c b/software/sys_controller/ic_drivers/it6613/hdmitx_nios2.c similarity index 100% rename from software/sys_controller/it6613/hdmitx_nios2.c rename to software/sys_controller/ic_drivers/it6613/hdmitx_nios2.c diff --git a/software/sys_controller/it6613/it6613.c b/software/sys_controller/ic_drivers/it6613/it6613.c similarity index 100% rename from software/sys_controller/it6613/it6613.c rename to software/sys_controller/ic_drivers/it6613/it6613.c diff --git a/software/sys_controller/it6613/it6613.h b/software/sys_controller/ic_drivers/it6613/it6613.h similarity index 100% rename from software/sys_controller/it6613/it6613.h rename to software/sys_controller/ic_drivers/it6613/it6613.h diff --git a/software/sys_controller/it6613/it6613_drv.c b/software/sys_controller/ic_drivers/it6613/it6613_drv.c similarity index 100% rename from software/sys_controller/it6613/it6613_drv.c rename to software/sys_controller/ic_drivers/it6613/it6613_drv.c diff --git a/software/sys_controller/it6613/it6613_drv.h b/software/sys_controller/ic_drivers/it6613/it6613_drv.h similarity index 100% rename from software/sys_controller/it6613/it6613_drv.h rename to software/sys_controller/ic_drivers/it6613/it6613_drv.h diff --git a/software/sys_controller/it6613/it6613_sys.c b/software/sys_controller/ic_drivers/it6613/it6613_sys.c similarity index 100% rename from software/sys_controller/it6613/it6613_sys.c rename to software/sys_controller/ic_drivers/it6613/it6613_sys.c diff --git a/software/sys_controller/it6613/it6613_sys.h b/software/sys_controller/ic_drivers/it6613/it6613_sys.h similarity index 100% rename from software/sys_controller/it6613/it6613_sys.h rename to software/sys_controller/ic_drivers/it6613/it6613_sys.h diff --git a/software/sys_controller/it6613/typedef.h b/software/sys_controller/ic_drivers/it6613/typedef.h similarity index 100% rename from software/sys_controller/it6613/typedef.h rename to software/sys_controller/ic_drivers/it6613/typedef.h diff --git a/software/sys_controller/pcm1862/pcm1862.c b/software/sys_controller/ic_drivers/pcm1862/pcm1862.c similarity index 100% rename from software/sys_controller/pcm1862/pcm1862.c rename to software/sys_controller/ic_drivers/pcm1862/pcm1862.c diff --git a/software/sys_controller/pcm1862/pcm1862.h b/software/sys_controller/ic_drivers/pcm1862/pcm1862.h similarity index 100% rename from software/sys_controller/pcm1862/pcm1862.h rename to software/sys_controller/ic_drivers/pcm1862/pcm1862.h diff --git a/software/sys_controller/pcm1862/pcm1862_regs.h b/software/sys_controller/ic_drivers/pcm1862/pcm1862_regs.h similarity index 100% rename from software/sys_controller/pcm1862/pcm1862_regs.h rename to software/sys_controller/ic_drivers/pcm1862/pcm1862_regs.h diff --git a/software/sys_controller/spi_charlcd/lcd.c b/software/sys_controller/ic_drivers/spi_charlcd/lcd.c similarity index 100% rename from software/sys_controller/spi_charlcd/lcd.c rename to software/sys_controller/ic_drivers/spi_charlcd/lcd.c diff --git a/software/sys_controller/spi_charlcd/lcd.h b/software/sys_controller/ic_drivers/spi_charlcd/lcd.h similarity index 100% rename from software/sys_controller/spi_charlcd/lcd.h rename to software/sys_controller/ic_drivers/spi_charlcd/lcd.h diff --git a/software/sys_controller/ths7353/ths7353.c b/software/sys_controller/ic_drivers/ths7353/ths7353.c similarity index 100% rename from software/sys_controller/ths7353/ths7353.c rename to software/sys_controller/ic_drivers/ths7353/ths7353.c diff --git a/software/sys_controller/ths7353/ths7353.h b/software/sys_controller/ic_drivers/ths7353/ths7353.h similarity index 100% rename from software/sys_controller/ths7353/ths7353.h rename to software/sys_controller/ic_drivers/ths7353/ths7353.h diff --git a/software/sys_controller/tvp7002/tvp7002.c b/software/sys_controller/ic_drivers/tvp7002/tvp7002.c similarity index 100% rename from software/sys_controller/tvp7002/tvp7002.c rename to software/sys_controller/ic_drivers/tvp7002/tvp7002.c diff --git a/software/sys_controller/tvp7002/tvp7002.h b/software/sys_controller/ic_drivers/tvp7002/tvp7002.h similarity index 100% rename from software/sys_controller/tvp7002/tvp7002.h rename to software/sys_controller/ic_drivers/tvp7002/tvp7002.h diff --git a/software/sys_controller/tvp7002/tvp7002_regs.h b/software/sys_controller/ic_drivers/tvp7002/tvp7002_regs.h similarity index 100% rename from software/sys_controller/tvp7002/tvp7002_regs.h rename to software/sys_controller/ic_drivers/tvp7002/tvp7002_regs.h diff --git a/software/sys_controller/ossc/av_controller.h b/software/sys_controller/inc/av_controller.h similarity index 100% rename from software/sys_controller/ossc/av_controller.h rename to software/sys_controller/inc/av_controller.h diff --git a/software/sys_controller/ossc/avconfig.h b/software/sys_controller/inc/avconfig.h similarity index 100% rename from software/sys_controller/ossc/avconfig.h rename to software/sys_controller/inc/avconfig.h diff --git a/software/sys_controller/ossc/controls.h b/software/sys_controller/inc/controls.h similarity index 100% rename from software/sys_controller/ossc/controls.h rename to software/sys_controller/inc/controls.h diff --git a/software/sys_controller/ossc/fat16_export.h b/software/sys_controller/inc/fat16_export.h similarity index 100% rename from software/sys_controller/ossc/fat16_export.h rename to software/sys_controller/inc/fat16_export.h diff --git a/software/sys_controller/ossc/firmware.h b/software/sys_controller/inc/firmware.h similarity index 100% rename from software/sys_controller/ossc/firmware.h rename to software/sys_controller/inc/firmware.h diff --git a/software/sys_controller/memory/flash.h b/software/sys_controller/inc/flash.h similarity index 100% rename from software/sys_controller/memory/flash.h rename to software/sys_controller/inc/flash.h diff --git a/software/sys_controller/ossc/menu.h b/software/sys_controller/inc/menu.h similarity index 100% rename from software/sys_controller/ossc/menu.h rename to software/sys_controller/inc/menu.h diff --git a/software/sys_controller/memory/sdcard.h b/software/sys_controller/inc/sdcard.h similarity index 100% rename from software/sys_controller/memory/sdcard.h rename to software/sys_controller/inc/sdcard.h diff --git a/software/sys_controller/ossc/userdata.h b/software/sys_controller/inc/userdata.h similarity index 100% rename from software/sys_controller/ossc/userdata.h rename to software/sys_controller/inc/userdata.h diff --git a/software/sys_controller/ossc/utils.h b/software/sys_controller/inc/utils.h similarity index 100% rename from software/sys_controller/ossc/utils.h rename to software/sys_controller/inc/utils.h diff --git a/software/sys_controller/ossc/video_modes.h b/software/sys_controller/inc/video_modes.h similarity index 100% rename from software/sys_controller/ossc/video_modes.h rename to software/sys_controller/inc/video_modes.h diff --git a/software/sys_controller/ossc/avconfig.c b/software/sys_controller/src/avconfig.c similarity index 100% rename from software/sys_controller/ossc/avconfig.c rename to software/sys_controller/src/avconfig.c diff --git a/software/sys_controller/ossc/controls.c b/software/sys_controller/src/controls.c similarity index 100% rename from software/sys_controller/ossc/controls.c rename to software/sys_controller/src/controls.c diff --git a/software/sys_controller/ossc/fat16_export.c b/software/sys_controller/src/fat16_export.c similarity index 100% rename from software/sys_controller/ossc/fat16_export.c rename to software/sys_controller/src/fat16_export.c diff --git a/software/sys_controller/ossc/firmware.c b/software/sys_controller/src/firmware.c similarity index 100% rename from software/sys_controller/ossc/firmware.c rename to software/sys_controller/src/firmware.c diff --git a/software/sys_controller/memory/flash.c b/software/sys_controller/src/flash.c similarity index 100% rename from software/sys_controller/memory/flash.c rename to software/sys_controller/src/flash.c diff --git a/software/sys_controller/ossc/menu.c b/software/sys_controller/src/menu.c similarity index 100% rename from software/sys_controller/ossc/menu.c rename to software/sys_controller/src/menu.c diff --git a/software/sys_controller/memory/sdcard.c b/software/sys_controller/src/sdcard.c similarity index 100% rename from software/sys_controller/memory/sdcard.c rename to software/sys_controller/src/sdcard.c diff --git a/software/sys_controller/ossc/userdata.c b/software/sys_controller/src/userdata.c similarity index 100% rename from software/sys_controller/ossc/userdata.c rename to software/sys_controller/src/userdata.c diff --git a/software/sys_controller/ossc/utils.c b/software/sys_controller/src/utils.c similarity index 100% rename from software/sys_controller/ossc/utils.c rename to software/sys_controller/src/utils.c diff --git a/software/sys_controller/ossc/video_modes.c b/software/sys_controller/src/video_modes.c similarity index 100% rename from software/sys_controller/ossc/video_modes.c rename to software/sys_controller/src/video_modes.c diff --git a/software/sys_controller/ossc/video_modes_list.c b/software/sys_controller/src/video_modes_list.c similarity index 100% rename from software/sys_controller/ossc/video_modes_list.c rename to software/sys_controller/src/video_modes_list.c From 9f0c62c80ab4c6234fa90edefbbdb7037ee876c0 Mon Sep 17 00:00:00 2001 From: balika011 Date: Mon, 10 Mar 2025 20:21:38 +0100 Subject: [PATCH 2/7] update gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index d181a4d..abafe3d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,8 @@ software/sys_controller/sys_controller.map software/sys_controller/sys_controller.elf .qsys_edit/* PLLJ_PLLSPE_INFO.txt +tools/bin2hex +software/sys_controller_bsp/bsp_timestamp +*.a +software/sys_controller/mem_init/sys_onchip_memory2_0.bin +software/sys_controller/mem_init/sys_onchip_memory2_0.hex \ No newline at end of file From 6b554e408831fa24272410253a3c3886ffccfd23 Mon Sep 17 00:00:00 2001 From: balika011 Date: Mon, 10 Mar 2025 20:36:26 +0100 Subject: [PATCH 3/7] rename spi_charlcd to st7032 --- software/sys_controller/Makefile | 6 ++-- .../{spi_charlcd/lcd.c => st7032/st7032.c} | 9 +++--- .../sys_controller/ic_drivers/st7032/st7032.h | 32 +++++++++++++++++++ .../{ic_drivers/spi_charlcd => inc}/lcd.h | 7 ++-- software/sys_controller/src/controls.c | 2 ++ software/sys_controller/src/firmware.c | 2 ++ software/sys_controller/src/lcd.c | 31 ++++++++++++++++++ software/sys_controller/src/menu.c | 1 + software/sys_controller/src/userdata.c | 2 ++ 9 files changed, 79 insertions(+), 13 deletions(-) rename software/sys_controller/ic_drivers/{spi_charlcd/lcd.c => st7032/st7032.c} (95%) create mode 100644 software/sys_controller/ic_drivers/st7032/st7032.h rename software/sys_controller/{ic_drivers/spi_charlcd => inc}/lcd.h (91%) create mode 100644 software/sys_controller/src/lcd.c diff --git a/software/sys_controller/Makefile b/software/sys_controller/Makefile index 7afd78c..29f3a79 100644 --- a/software/sys_controller/Makefile +++ b/software/sys_controller/Makefile @@ -161,6 +161,7 @@ C_SRCS += src/userdata.c endif C_SRCS += src/sdcard.c C_SRCS += src/fat16_export.c +C_SRCS += src/lcd.c C_SRCS += ic_drivers/it6613/EDID.c C_SRCS += ic_drivers/it6613/HDMI_TX.c C_SRCS += ic_drivers/it6613/hdmitx_nios2.c @@ -170,7 +171,7 @@ C_SRCS += ic_drivers/it6613/it6613_sys.c C_SRCS += ic_drivers/tvp7002/tvp7002.c C_SRCS += ic_drivers/ths7353/ths7353.c C_SRCS += ic_drivers/pcm1862/pcm1862.c -C_SRCS += ic_drivers/spi_charlcd/lcd.c +C_SRCS += ic_drivers/st7032/st7032.c C_SRCS += ulibSD/sd_io.c C_SRCS += ulibSD/spi_io.c CXX_SRCS := @@ -223,8 +224,7 @@ APP_INCLUDE_DIRS += ic_drivers/it6613 APP_INCLUDE_DIRS += ic_drivers/tvp7002 APP_INCLUDE_DIRS += ic_drivers/ths7353 APP_INCLUDE_DIRS += ic_drivers/pcm1862 -APP_INCLUDE_DIRS += ic_drivers/spi_charlcd ->>>>>>> 6015591 (restructure firmware to be more inline with pro) +APP_INCLUDE_DIRS += ic_drivers/st7032 APP_INCLUDE_DIRS += memory APP_INCLUDE_DIRS += ulibSD APP_LIBRARY_DIRS := diff --git a/software/sys_controller/ic_drivers/spi_charlcd/lcd.c b/software/sys_controller/ic_drivers/st7032/st7032.c similarity index 95% rename from software/sys_controller/ic_drivers/spi_charlcd/lcd.c rename to software/sys_controller/ic_drivers/st7032/st7032.c index 21f375e..07283f8 100644 --- a/software/sys_controller/ic_drivers/spi_charlcd/lcd.c +++ b/software/sys_controller/ic_drivers/st7032/st7032.c @@ -1,5 +1,6 @@ // // Copyright (C) 2015-2016 Markus Hiienkari +// Copyright (C) 2025 Balázs Triszka // // This file is part of Open Source Scan Converter project. // @@ -20,14 +21,12 @@ #include #include #include "lcd.h" +#include "st7032.h" #include "alt_types.h" #include "altera_avalon_pio_regs.h" #include "i2c_opencores.h" #include "av_controller.h" -#define LCD_CMD 0x00 -#define LCD_DATA 0x40 - #define WRDELAY 20 #define CLEARDELAY 800 @@ -38,7 +37,7 @@ static void lcd_cmd(alt_u8 cmd, alt_u16 postdelay) { usleep(postdelay); } -void lcd_init() +void st7032_init() { sys_ctrl &= ~(LCD_CS_N|LCD_RS); IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); @@ -59,7 +58,7 @@ void lcd_init() IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); } -void lcd_write(char *row1, char *row2) +void st7032_write(char *row1, char *row2) { alt_u8 i, rowlen; diff --git a/software/sys_controller/ic_drivers/st7032/st7032.h b/software/sys_controller/ic_drivers/st7032/st7032.h new file mode 100644 index 0000000..7d1f722 --- /dev/null +++ b/software/sys_controller/ic_drivers/st7032/st7032.h @@ -0,0 +1,32 @@ +// +// Copyright (C) 2015-2016 Markus Hiienkari +// Copyright (C) 2025 Balázs Triszka +// +// This file is part of Open Source Scan Converter project. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef ST7032_H_ +#define ST7032_H_ + +#include "system.h" +#include +#include "sysconfig.h" + +void st7032_init(); + +void st7032_write(char *row1, char *row2); + +#endif /* st7032_H_ */ diff --git a/software/sys_controller/ic_drivers/spi_charlcd/lcd.h b/software/sys_controller/inc/lcd.h similarity index 91% rename from software/sys_controller/ic_drivers/spi_charlcd/lcd.h rename to software/sys_controller/inc/lcd.h index 966e34c..5f88e1d 100644 --- a/software/sys_controller/ic_drivers/spi_charlcd/lcd.h +++ b/software/sys_controller/inc/lcd.h @@ -1,5 +1,6 @@ // // Copyright (C) 2015-2016 Markus Hiienkari +// Copyright (C) 2025 Balázs Triszka // // This file is part of Open Source Scan Converter project. // @@ -20,14 +21,10 @@ #ifndef LCD_H_ #define LCD_H_ -#include "system.h" -#include -#include "sysconfig.h" - #define LCD_ROW_LEN 16 void lcd_init(); void lcd_write(char *row1, char *row2); -#endif /* LCD_H_ */ +#endif /* LCD_H_ */ \ No newline at end of file diff --git a/software/sys_controller/src/controls.c b/software/sys_controller/src/controls.c index 3fb9071..f85a83d 100644 --- a/software/sys_controller/src/controls.c +++ b/software/sys_controller/src/controls.c @@ -19,6 +19,8 @@ #include #include +#include +#include "system.h" #include "alt_types.h" #include "controls.h" #include "menu.h" diff --git a/software/sys_controller/src/firmware.c b/software/sys_controller/src/firmware.c index 0e9b6b1..d8ae1a5 100644 --- a/software/sys_controller/src/firmware.c +++ b/software/sys_controller/src/firmware.c @@ -19,6 +19,8 @@ #include #include +#include +#include "system.h" #include "firmware.h" #include "sdcard.h" #include "flash.h" diff --git a/software/sys_controller/src/lcd.c b/software/sys_controller/src/lcd.c new file mode 100644 index 0000000..fdbd8f1 --- /dev/null +++ b/software/sys_controller/src/lcd.c @@ -0,0 +1,31 @@ +// +// Copyright (C) 2025 Balázs Triszka +// +// This file is part of Open Source Scan Converter project. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#include "lcd.h" +#include "st7032.h" + +void lcd_init() +{ + st7032_init(); +} + +void lcd_write(char *row1, char *row2) +{ + st7032_write(row1, row2); +} \ No newline at end of file diff --git a/software/sys_controller/src/menu.c b/software/sys_controller/src/menu.c index 7e07dd5..f0d198d 100644 --- a/software/sys_controller/src/menu.c +++ b/software/sys_controller/src/menu.c @@ -18,6 +18,7 @@ // #include +#include #include "menu.h" #include "av_controller.h" #include "firmware.h" diff --git a/software/sys_controller/src/userdata.c b/software/sys_controller/src/userdata.c index 5a6064d..5941155 100644 --- a/software/sys_controller/src/userdata.c +++ b/software/sys_controller/src/userdata.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include "system.h" #include "userdata.h" #include "fat16_export.h" #include "flash.h" From 933dbbaa757b4ffe8ec2fe26e96b96ad1eefe9ba Mon Sep 17 00:00:00 2001 From: balika011 Date: Mon, 10 Mar 2025 22:07:09 +0100 Subject: [PATCH 4/7] add SH1107 driver TODO: auto detect --- software/sys_controller/Makefile | 5 + .../sys_controller/ic_drivers/sh1107/font12.h | 1337 +++++++++++++++++ .../sys_controller/ic_drivers/sh1107/sh1107.c | 139 ++ .../sys_controller/ic_drivers/sh1107/sh1107.h | 31 + software/sys_controller/src/lcd.c | 9 + 5 files changed, 1521 insertions(+) create mode 100644 software/sys_controller/ic_drivers/sh1107/font12.h create mode 100644 software/sys_controller/ic_drivers/sh1107/sh1107.c create mode 100644 software/sys_controller/ic_drivers/sh1107/sh1107.h diff --git a/software/sys_controller/Makefile b/software/sys_controller/Makefile index 29f3a79..456014b 100644 --- a/software/sys_controller/Makefile +++ b/software/sys_controller/Makefile @@ -172,6 +172,7 @@ C_SRCS += ic_drivers/tvp7002/tvp7002.c C_SRCS += ic_drivers/ths7353/ths7353.c C_SRCS += ic_drivers/pcm1862/pcm1862.c C_SRCS += ic_drivers/st7032/st7032.c +C_SRCS += ic_drivers/sh1107/sh1107.c C_SRCS += ulibSD/sd_io.c C_SRCS += ulibSD/spi_io.c CXX_SRCS := @@ -198,6 +199,9 @@ endif ifeq ($(OSDLANG),JP) APP_CFLAGS_DEFINED_SYMBOLS += -DOSDLANG_JP endif +ifeq ($(HAS_SH1107),y) +APP_CFLAGS_DEFINED_SYMBOLS += -DHAS_SH1107 +endif APP_CFLAGS_UNDEFINED_SYMBOLS := APP_CFLAGS_OPTIMIZATION := -Os APP_CFLAGS_DEBUG_LEVEL := @@ -225,6 +229,7 @@ APP_INCLUDE_DIRS += ic_drivers/tvp7002 APP_INCLUDE_DIRS += ic_drivers/ths7353 APP_INCLUDE_DIRS += ic_drivers/pcm1862 APP_INCLUDE_DIRS += ic_drivers/st7032 +APP_INCLUDE_DIRS += ic_drivers/sh1107 APP_INCLUDE_DIRS += memory APP_INCLUDE_DIRS += ulibSD APP_LIBRARY_DIRS := diff --git a/software/sys_controller/ic_drivers/sh1107/font12.h b/software/sys_controller/ic_drivers/sh1107/font12.h new file mode 100644 index 0000000..836e427 --- /dev/null +++ b/software/sys_controller/ic_drivers/sh1107/font12.h @@ -0,0 +1,1337 @@ +#ifndef _FONT12_H +#define _FONT12_H + +static const uint8_t Font12_Table[] = +{ + // @0 ' ' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @12 '!' (7 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @24 '"' (7 pixels wide) + 0x00, // + 0x36, // ## ## + 0x12, // # # + 0x12, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @36 '#' (7 pixels wide) + 0x00, // + 0x28, // # # + 0x28, // # # + 0x14, // # # + 0x3e, // ##### + 0x14, // # # + 0x3e, // ##### + 0x14, // # # + 0x0a, // # # + 0x0a, // # # + 0x00, // + 0x00, // + + // @48 '$' (7 pixels wide) + 0x00, // + 0x08, // # + 0x1c, // ### + 0x02, // # + 0x02, // # + 0x1c, // ### + 0x12, // # # + 0x0e, // ### + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + + // @60 '%' (7 pixels wide) + 0x00, // + 0x04, // # + 0x0a, // # # + 0x04, // # + 0x30, // ## + 0x0e, // ### + 0x10, // # + 0x28, // # # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + + // @72 '&' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x04, // # + 0x04, // # + 0x2a, // # # # + 0x12, // # # + 0x2c, // ## # + 0x00, // + 0x00, // + 0x00, // + + // @84 ''' (7 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @96 '(' (7 pixels wide) + 0x00, // + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x00, // + + // @108 ')' (7 pixels wide) + 0x00, // + 0x04, // # + 0x04, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x04, // # + 0x04, // # + 0x00, // + + // @120 '*' (7 pixels wide) + 0x00, // + 0x08, // # + 0x3e, // ##### + 0x08, // # + 0x14, // # # + 0x14, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @132 '+' (7 pixels wide) + 0x00, // + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x7f, // ####### + 0x08, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @144 ',' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x08, // # + 0x0c, // ## + 0x04, // # + 0x00, // + + // @156 '-' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @168 '.' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x0c, // ## + 0x0c, // ## + 0x00, // + 0x00, // + 0x00, // + + // @180 '/' (7 pixels wide) + 0x00, // + 0x20, // # + 0x20, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x04, // # + 0x04, // # + 0x02, // # + 0x00, // + 0x00, // + + // @192 '0' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @204 '1' (7 pixels wide) + 0x00, // + 0x0c, // ## + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @216 '2' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x20, // # + 0x10, // # + 0x08, // # + 0x04, // # + 0x22, // # # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @228 '3' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x20, // # + 0x18, // ## + 0x20, // # + 0x20, // # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @240 '4' (7 pixels wide) + 0x00, // + 0x30, // ## + 0x28, // # # + 0x28, // # # + 0x24, // # # + 0x22, // # # + 0x7e, // ###### + 0x20, // # + 0x70, // ### + 0x00, // + 0x00, // + 0x00, // + + // @252 '5' (7 pixels wide) + 0x00, // + 0x3c, // #### + 0x04, // # + 0x04, // # + 0x1c, // ### + 0x20, // # + 0x20, // # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @264 '6' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x04, // # + 0x02, // # + 0x1e, // #### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @276 '7' (7 pixels wide) + 0x00, // + 0x3e, // ##### + 0x22, // # # + 0x20, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @288 '8' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @300 '9' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x3c, // #### + 0x20, // # + 0x10, // # + 0x0e, // ### + 0x00, // + 0x00, // + 0x00, // + + // @312 ':' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x0c, // ## + 0x0c, // ## + 0x00, // + 0x00, // + 0x0c, // ## + 0x0c, // ## + 0x00, // + 0x00, // + 0x00, // + + // @324 ';' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x18, // ## + 0x18, // ## + 0x00, // + 0x00, // + 0x18, // ## + 0x0c, // ## + 0x04, // # + 0x00, // + 0x00, // + + // @336 '<' (7 pixels wide) + 0x00, // + 0x00, // + 0x30, // ## + 0x08, // # + 0x06, // ## + 0x01, // # + 0x06, // ## + 0x08, // # + 0x30, // ## + 0x00, // + 0x00, // + 0x00, // + + // @348 '=' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x3e, // ##### + 0x00, // + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @360 '>' (7 pixels wide) + 0x00, // + 0x00, // + 0x03, // ## + 0x04, // # + 0x18, // ## + 0x20, // # + 0x18, // ## + 0x04, // # + 0x03, // ## + 0x00, // + 0x00, // + 0x00, // + + // @372 '?' (7 pixels wide) + 0x00, // + 0x00, // + 0x18, // ## + 0x24, // # # + 0x20, // # + 0x10, // # + 0x08, // # + 0x00, // + 0x0c, // ## + 0x00, // + 0x00, // + 0x00, // + + // @384 '@' (7 pixels wide) + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x32, // # ## + 0x2a, // # # # + 0x2a, // # # # + 0x32, // # ## + 0x02, // # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + + // @396 'A' (7 pixels wide) + 0x00, // + 0x0c, // ## + 0x08, // # + 0x14, // # # + 0x14, // # # + 0x14, // # # + 0x3e, // ##### + 0x22, // # # + 0x77, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @408 'B' (7 pixels wide) + 0x00, // + 0x1f, // ##### + 0x22, // # # + 0x22, // # # + 0x1e, // #### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1f, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @420 'C' (7 pixels wide) + 0x00, // + 0x3c, // #### + 0x22, // # # + 0x02, // # + 0x02, // # + 0x02, // # + 0x02, // # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @432 'D' (7 pixels wide) + 0x00, // + 0x0f, // #### + 0x12, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x12, // # # + 0x0f, // #### + 0x00, // + 0x00, // + 0x00, // + + // @444 'E' (7 pixels wide) + 0x00, // + 0x3f, // ###### + 0x22, // # # + 0x0a, // # # + 0x0e, // ### + 0x0a, // # # + 0x02, // # + 0x22, // # # + 0x3f, // ###### + 0x00, // + 0x00, // + 0x00, // + + // @456 'F' (7 pixels wide) + 0x00, // + 0x7e, // ###### + 0x44, // # # + 0x14, // # # + 0x1c, // ### + 0x14, // # # + 0x04, // # + 0x04, // # + 0x0e, // ### + 0x00, // + 0x00, // + 0x00, // + + // @468 'G' (7 pixels wide) + 0x00, // + 0x3c, // #### + 0x22, // # # + 0x02, // # + 0x02, // # + 0x72, // # ### + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @480 'H' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x22, // # # + 0x3e, // ##### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x77, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @492 'I' (7 pixels wide) + 0x00, // + 0x3e, // ##### + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @504 'J' (7 pixels wide) + 0x00, // + 0x3c, // #### + 0x10, // # + 0x10, // # + 0x10, // # + 0x12, // # # + 0x12, // # # + 0x12, // # # + 0x0c, // ## + 0x00, // + 0x00, // + 0x00, // + + // @516 'K' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x12, // # # + 0x0a, // # # + 0x0e, // ### + 0x12, // # # + 0x22, // # # + 0x67, // ### ## + 0x00, // + 0x00, // + 0x00, // + + // @528 'L' (7 pixels wide) + 0x00, // + 0x0e, // ### + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x24, // # # + 0x24, // # # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @540 'M' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x36, // ## ## + 0x36, // ## ## + 0x2a, // # # # + 0x2a, // # # # + 0x22, // # # + 0x22, // # # + 0x77, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @552 'N' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x26, // ## # + 0x26, // ## # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x32, // # ## + 0x37, // ### ## + 0x00, // + 0x00, // + 0x00, // + + // @564 'O' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @576 'P' (7 pixels wide) + 0x00, // + 0x1e, // #### + 0x24, // # # + 0x24, // # # + 0x24, // # # + 0x1c, // ### + 0x04, // # + 0x04, // # + 0x0e, // ### + 0x00, // + 0x00, // + 0x00, // + + // @588 'Q' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x38, // ### + 0x00, // + 0x00, // + + // @600 'R' (7 pixels wide) + 0x00, // + 0x1f, // ##### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1e, // #### + 0x12, // # # + 0x22, // # # + 0x47, // ### # + 0x00, // + 0x00, // + 0x00, // + + // @612 'S' (7 pixels wide) + 0x00, // + 0x2c, // ## # + 0x32, // # ## + 0x02, // # + 0x1c, // ### + 0x20, // # + 0x20, // # + 0x26, // ## # + 0x1a, // # ## + 0x00, // + 0x00, // + 0x00, // + + // @624 'T' (7 pixels wide) + 0x00, // + 0x7f, // ####### + 0x49, // # # # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @636 'U' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @648 'V' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x22, // # # + 0x14, // # # + 0x14, // # # + 0x14, // # # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @660 'W' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x22, // # # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x14, // # # + 0x00, // + 0x00, // + 0x00, // + + // @672 'X' (7 pixels wide) + 0x00, // + 0x63, // ## ## + 0x22, // # # + 0x14, // # # + 0x08, // # + 0x08, // # + 0x14, // # # + 0x22, // # # + 0x63, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @684 'Y' (7 pixels wide) + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x14, // # # + 0x14, // # # + 0x08, // # + 0x08, // # + 0x08, // # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @696 'Z' (7 pixels wide) + 0x00, // + 0x3e, // ##### + 0x22, // # # + 0x10, // # + 0x08, // # + 0x08, // # + 0x04, // # + 0x22, // # # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @708 '[' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x1c, // ### + 0x00, // + + // @720 '\' (7 pixels wide) + 0x00, // + 0x02, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x00, // + 0x00, // + + // @732 ']' (7 pixels wide) + 0x00, // + 0x1c, // ### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x1c, // ### + 0x00, // + + // @744 '^' (7 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x14, // # # + 0x22, // # # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @756 '_' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x7f, // ####### + + // @768 '`' (7 pixels wide) + 0x00, // + 0x08, // # + 0x10, // # + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + + // @780 'a' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x3c, // #### + 0x22, // # # + 0x22, // # # + 0x7c, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @792 'b' (7 pixels wide) + 0x00, // + 0x03, // ## + 0x02, // # + 0x1a, // # ## + 0x26, // ## # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1f, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @804 'c' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x3c, // #### + 0x22, // # # + 0x02, // # + 0x02, // # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @816 'd' (7 pixels wide) + 0x00, // + 0x30, // ## + 0x20, // # + 0x2c, // ## # + 0x32, // # ## + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x7c, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @828 'e' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x3e, // ##### + 0x02, // # + 0x02, // # + 0x3c, // #### + 0x00, // + 0x00, // + 0x00, // + + // @840 'f' (7 pixels wide) + 0x00, // + 0x38, // ### + 0x04, // # + 0x3e, // ##### + 0x04, // # + 0x04, // # + 0x04, // # + 0x04, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @852 'g' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x6c, // ## ## + 0x32, // # ## + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x3c, // #### + 0x20, // # + 0x1c, // ### + 0x00, // + + // @864 'h' (7 pixels wide) + 0x00, // + 0x03, // ## + 0x02, // # + 0x1a, // # ## + 0x26, // ## # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x77, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @876 'i' (7 pixels wide) + 0x00, // + 0x08, // # + 0x00, // + 0x0e, // ### + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @888 'j' (7 pixels wide) + 0x00, // + 0x08, // # + 0x00, // + 0x1e, // #### + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x10, // # + 0x0e, // ### + 0x00, // + + // @900 'k' (7 pixels wide) + 0x00, // + 0x03, // ## + 0x02, // # + 0x3a, // # ### + 0x12, // # # + 0x0e, // ### + 0x0a, // # # + 0x12, // # # + 0x3b, // ## ### + 0x00, // + 0x00, // + 0x00, // + + // @912 'l' (7 pixels wide) + 0x00, // + 0x0c, // ## + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @924 'm' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x17, // ### # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x7f, // ####### + 0x00, // + 0x00, // + 0x00, // + + // @936 'n' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x1b, // ## ## + 0x26, // ## # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x77, // ### ### + 0x00, // + 0x00, // + 0x00, // + + // @948 'o' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x1c, // ### + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1c, // ### + 0x00, // + 0x00, // + 0x00, // + + // @960 'p' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x1b, // ## ## + 0x26, // ## # + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x1e, // #### + 0x02, // # + 0x07, // ### + 0x00, // + + // @972 'q' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x6c, // ## ## + 0x32, // # ## + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x3c, // #### + 0x20, // # + 0x70, // ### + 0x00, // + + // @984 'r' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x36, // ## ## + 0x0c, // ## + 0x04, // # + 0x04, // # + 0x04, // # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @996 's' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x3c, // #### + 0x22, // # # + 0x1c, // ### + 0x20, // # + 0x22, // # # + 0x1e, // #### + 0x00, // + 0x00, // + 0x00, // + + // @1008 't' (7 pixels wide) + 0x00, // + 0x00, // + 0x04, // # + 0x3e, // ##### + 0x04, // # + 0x04, // # + 0x04, // # + 0x44, // # # + 0x38, // ### + 0x00, // + 0x00, // + 0x00, // + + // @1020 'u' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x33, // ## ## + 0x22, // # # + 0x22, // # # + 0x22, // # # + 0x32, // # ## + 0x6c, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @1032 'v' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x22, // # # + 0x14, // # # + 0x14, // # # + 0x08, // # + 0x00, // + 0x00, // + 0x00, // + + // @1044 'w' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x2a, // # # # + 0x2a, // # # # + 0x2a, // # # # + 0x14, // # # + 0x00, // + 0x00, // + 0x00, // + + // @1056 'x' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x33, // ## ## + 0x12, // # # + 0x0c, // ## + 0x0c, // ## + 0x12, // # # + 0x33, // ## ## + 0x00, // + 0x00, // + 0x00, // + + // @1068 'y' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x77, // ### ### + 0x22, // # # + 0x24, // # # + 0x14, // # # + 0x18, // ## + 0x08, // # + 0x08, // # + 0x1e, // #### + 0x00, // + + // @1080 'z' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x3e, // ##### + 0x12, // # # + 0x08, // # + 0x04, // # + 0x22, // # # + 0x3e, // ##### + 0x00, // + 0x00, // + 0x00, // + + // @1092 '{' (7 pixels wide) + 0x00, // + 0x10, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x04, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x00, // + + // @1104 '|' (7 pixels wide) + 0x00, // + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x00, // + 0x00, // + + // @1116 '}' (7 pixels wide) + 0x00, // + 0x04, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x10, // # + 0x08, // # + 0x08, // # + 0x08, // # + 0x04, // # + 0x00, // + + // @1128 '~' (7 pixels wide) + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x24, // # # + 0x1a, // # ## + 0x00, // + 0x00, // + 0x00, // + 0x00, // + 0x00, // +}; + +#endif \ No newline at end of file diff --git a/software/sys_controller/ic_drivers/sh1107/sh1107.c b/software/sys_controller/ic_drivers/sh1107/sh1107.c new file mode 100644 index 0000000..47ef303 --- /dev/null +++ b/software/sys_controller/ic_drivers/sh1107/sh1107.c @@ -0,0 +1,139 @@ +// +// Copyright (C) 2025 Balázs Triszka +// +// This file is part of Open Source Scan Converter project. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#include +#include +#include "lcd.h" +#include "sh1107.h" +#include "alt_types.h" +#include "altera_avalon_pio_regs.h" +#include "i2c_opencores.h" +#include "av_controller.h" +#include "font12.h" + +#define OLED_WIDTH 128 +#define OLED_HEIGHT 64 + +extern alt_u32 sys_ctrl; + +static void OLED_Write(uint8_t value) +{ + SPI_write(I2CA_BASE, &value, 1); +} + +void sh1107_init() +{ + sys_ctrl &= ~(LCD_CS_N | LCD_RS); + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + + alt_u8 init[] = { + 0xae, /*turn off OLED display*/ + 0x00, /*set lower column address*/ + 0x10, /*set higher column address*/ + 0xb0, /*set page address*/ + 0xdc, 0x00, /*set display start line*/ + 0x81, /*contract control*/ + 0x6f, /*128*/ + 0x21, /* Set Memory addressing mode (0x20/0x21) */ + 0xa1, /*set segment remap*/ + 0xc0, /*Com scan direction*/ + 0xa4, /*Disable Entire Display On (0xA4/0xA5)*/ + 0xa6, /*normal / reverse*/ + 0xa8, /*multiplex ratio*/ + 0x3f, /*duty = 1/64*/ + 0xd3, 0x60, /*set display offset*/ + 0xd5, 0x41, /*set osc division*/ + 0xd9, 0x22, /*set pre-charge period*/ + 0xdb, 0x35, /*set vcomh*/ + 0xad, /*set charge pump enable*/ + 0x8a /*Set DC-DC enable (a=0:disable; a=1:enable) */ + }; + SPI_write(I2CA_BASE, init, sizeof(init)); + + // Clear the screen + OLED_Write(0xb0); + for (alt_u8 i = 0; i < OLED_HEIGHT; i++) + { + sys_ctrl &= ~LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + OLED_Write(0x00 + (i & 0x0f)); + OLED_Write(0x10 + (i >> 4)); + + sys_ctrl |= LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + for (alt_u8 i = 0; i < OLED_WIDTH / 8; i++) + OLED_Write(0); + } + + sys_ctrl &= ~LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + + // Turn on + OLED_Write(0xaf); + + sys_ctrl |= LCD_CS_N; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); +} + +void sh1107_write(char *row1, char *row2) +{ + sys_ctrl &= ~(LCD_CS_N | LCD_RS); + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + + alt_u8 row1len = strnlen(row1, LCD_ROW_LEN); + + for (alt_u8 i = 0; i < 12; i++) + { + sys_ctrl &= ~LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + OLED_Write(0xb0); + OLED_Write(0x00 + ((i + 13) & 0x0f)); + OLED_Write(0x10 + ((i + 13) >> 4)); + + sys_ctrl |= LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + for (alt_u8 j = 0; j < row1len; j++) + OLED_Write(Font12_Table[(row1[j] - 0x20) * 12 + i]); + + for (alt_u8 j = row1len; j < LCD_ROW_LEN; j++) + OLED_Write(Font12_Table[i]); + } + + alt_u8 row2len = strnlen(row2, LCD_ROW_LEN); + + for (alt_u8 i = 0; i < 12; i++) + { + sys_ctrl &= ~LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + OLED_Write(0xb0); + OLED_Write(0x00 + ((i + 39) & 0x0f)); + OLED_Write(0x10 + ((i + 39) >> 4)); + + sys_ctrl |= LCD_RS; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); + for (alt_u8 j = 0; j < row2len; j++) + OLED_Write(Font12_Table[(row2[j] - 0x20) * 12 + i]); + + for (alt_u8 j = row2len; j < LCD_ROW_LEN; j++) + OLED_Write(Font12_Table[i]); + } + + sys_ctrl |= LCD_CS_N; + IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); +} diff --git a/software/sys_controller/ic_drivers/sh1107/sh1107.h b/software/sys_controller/ic_drivers/sh1107/sh1107.h new file mode 100644 index 0000000..1d102a8 --- /dev/null +++ b/software/sys_controller/ic_drivers/sh1107/sh1107.h @@ -0,0 +1,31 @@ +// +// Copyright (C) 2025 Balázs Triszka +// +// This file is part of Open Source Scan Converter project. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#ifndef SH1107_H_ +#define SH1107_H_ + +#include "system.h" +#include +#include "sysconfig.h" + +void sh1107_init(); + +void sh1107_write(char *row1, char *row2); + +#endif /* sh1107_H_ */ diff --git a/software/sys_controller/src/lcd.c b/software/sys_controller/src/lcd.c index fdbd8f1..7529009 100644 --- a/software/sys_controller/src/lcd.c +++ b/software/sys_controller/src/lcd.c @@ -19,13 +19,22 @@ #include "lcd.h" #include "st7032.h" +#include "sh1107.h" void lcd_init() { +#ifndef HAS_SH1107 st7032_init(); +#else + sh1107_init(); +#endif } void lcd_write(char *row1, char *row2) { +#ifndef HAS_SH1107 st7032_write(row1, row2); +#else + sh1107_write(row1, row2); +#endif } \ No newline at end of file From 8ed64b5cba67366ca823ac57d05d4bb86f248996 Mon Sep 17 00:00:00 2001 From: balika011 Date: Mon, 10 Mar 2025 22:11:46 +0100 Subject: [PATCH 5/7] remove deprecated ENABLE_AUDIO option --- README.md | 1 - software/sys_controller/Makefile | 3 --- software/sys_controller/av_controller.c | 18 ++---------------- software/sys_controller/inc/firmware.h | 10 ++-------- software/sys_controller/src/avconfig.c | 2 -- software/sys_controller/src/menu.c | 4 ---- 6 files changed, 4 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 5448321..0938283 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ make [OPTIONS] [TARGET] ~~~~ OPTIONS may include following definitions: * OSDLANG=JP (Japanese language menu) -* ENABLE_AUDIO=y (Includes audio setup code for v1.6 PCB / DIY audio add-on board) TARGET is typically one of the following: * all (Default target. Compiles an ELF file) diff --git a/software/sys_controller/Makefile b/software/sys_controller/Makefile index 456014b..7018270 100644 --- a/software/sys_controller/Makefile +++ b/software/sys_controller/Makefile @@ -193,9 +193,6 @@ CREATE_LINKER_MAP := 1 # Common arguments for ALT_CFLAGSs APP_CFLAGS_DEFINED_SYMBOLS := -DPICOLIBC_INTEGER_PRINTF_SCANF -ifeq ($(ENABLE_AUDIO),y) -APP_CFLAGS_DEFINED_SYMBOLS += -DENABLE_AUDIO -endif ifeq ($(OSDLANG),JP) APP_CFLAGS_DEFINED_SYMBOLS += -DOSDLANG_JP endif diff --git a/software/sys_controller/av_controller.c b/software/sys_controller/av_controller.c index 0e34ee7..de6d7c6 100644 --- a/software/sys_controller/av_controller.c +++ b/software/sys_controller/av_controller.c @@ -155,7 +155,6 @@ void ui_disp_status(alt_u8 refresh_osd_timer) { } } -#ifdef ENABLE_AUDIO inline void SetupAudio(tx_mode_t mode) { // shut down audio-tx before setting new config (recommended for changing audio-tx config) @@ -177,7 +176,6 @@ inline void SetupAudio(tx_mode_t mode) #endif } } -#endif inline void TX_enable(tx_mode_t mode) { @@ -202,9 +200,7 @@ inline void TX_enable(tx_mode_t mode) cm.cc.hdmi_vrr = tc.hdmi_vrr; } -#ifdef ENABLE_AUDIO SetupAudio(mode); -#endif // start TX SetAVMute(FALSE); @@ -418,7 +414,6 @@ status_t get_status(tvp_sync_input_t syncinput) if (tc.full_vs_bypass != cm.cc.full_vs_bypass) tvp_set_full_vs_bypass(tc.full_vs_bypass); -#ifdef ENABLE_AUDIO if ((tc.audio_dw_sampl != cm.cc.audio_dw_sampl) || #ifdef MANUAL_CTS update_cur_vm || @@ -434,7 +429,6 @@ status_t get_status(tvp_sync_input_t syncinput) pcm_set_stereo_mode(tc.audio_mono); SetupAudio(cm.cc.tx_mode); } -#endif cm.cc = tc; update_cur_vm = 0; @@ -685,10 +679,8 @@ void program_mode() TX_enable(cm.cc.tx_mode); } else if (cm.cc.tx_mode!=TX_DVI) { HDMITX_SetAVIInfoFrame(vmode_out.vic, (cm.cc.tx_mode == TX_HDMI_RGB) ? F_MODE_RGB444 : F_MODE_YUV444, 0, 0, cm.cc.hdmi_itc, vm_conf.hdmitx_pixr_ifr); -#ifdef ENABLE_AUDIO #ifdef MANUAL_CTS SetupAudio(cm.cc.tx_mode); -#endif #endif } } @@ -807,12 +799,10 @@ int init_hw() InitIT6613(); -#ifdef ENABLE_AUDIO if (pcm1862_init()) { printf("PCM1862 found\n"); pcm1862_active = 1; } -#endif /*if (init_flash() != 0) { printf("Error: could not find flash\n"); @@ -869,7 +859,7 @@ void print_vm_stats() { sniprintf((char*)osd->osd_array.data[++row][0], OSD_CHAR_COLS, "Profile:"); sniprintf((char*)osd->osd_array.data[row][1], OSD_CHAR_COLS, "%u: %s", profile_sel, (target_profile_name[0] == 0) ? "" : target_profile_name); sniprintf((char*)osd->osd_array.data[++row][0], OSD_CHAR_COLS, "FW:"); - sniprintf((char*)osd->osd_array.data[row][1], OSD_CHAR_COLS, "%u.%.2u" FW_SUFFIX1 FW_SUFFIX2 " @ " __DATE__, FW_VER_MAJOR, FW_VER_MINOR); + sniprintf((char*)osd->osd_array.data[row][1], OSD_CHAR_COLS, "%u.%.2u" FW_SUFFIX " @ " __DATE__, FW_VER_MAJOR, FW_VER_MINOR); osd->osd_config.status_refresh = 1; osd->osd_row_color.mask = 0; @@ -965,7 +955,7 @@ int main() if (init_stat >= 0) { printf("### DIY VIDEO DIGITIZER / SCANCONVERTER INIT OK ###\n\n"); - sniprintf(row1, LCD_ROW_LEN+1, "OSSC fw. %u.%.2u" FW_SUFFIX1 FW_SUFFIX2, FW_VER_MAJOR, FW_VER_MINOR); + sniprintf(row1, LCD_ROW_LEN+1, " OSSC fw. %u.%.2u" FW_SUFFIX, FW_VER_MAJOR, FW_VER_MINOR); #ifndef DEBUG strncpy(row2, "2014-2025 marqs", LCD_ROW_LEN+1); #else @@ -1127,11 +1117,9 @@ int main() cm.sync_active = 0; ths_source_sel(target_ths, (cm.cc.video_lpf > 1) ? (VIDEO_LPF_MAX-cm.cc.video_lpf) : THS_LPF_BYPASS); tvp_powerdown(); -#ifdef ENABLE_AUDIO DisableAudioOutput(); if (pcm1862_active) pcm_source_sel(target_pcm); -#endif tvp_source_sel(target_tvp, target_tvp_sync, target_format); cm.clkcnt = 0; //TODO: proper invalidate sys_ctrl &= ~VSYNC_I_TYPE; @@ -1204,9 +1192,7 @@ int main() IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl); tvp_powerup(); program_mode(); -#ifdef ENABLE_AUDIO SetupAudio(cm.cc.tx_mode); -#endif } else { printf("Sync lost\n"); cm.clkcnt = 0; //TODO: proper invalidate diff --git a/software/sys_controller/inc/firmware.h b/software/sys_controller/inc/firmware.h index e5f4677..15c8d6c 100644 --- a/software/sys_controller/inc/firmware.h +++ b/software/sys_controller/inc/firmware.h @@ -32,16 +32,10 @@ #define INITCFG_VER_MAJOR 1 #define INITCFG_VER_MINOR 0 -#ifdef ENABLE_AUDIO -#define FW_SUFFIX1 "a" -#else -#define FW_SUFFIX1 "" -#endif - #ifdef OSDLANG_JP -#define FW_SUFFIX2 "j" +#define FW_SUFFIX "j" #else -#define FW_SUFFIX2 "" +#define FW_SUFFIX "" #endif #define FW_UPDATE_RETRIES 3 diff --git a/software/sys_controller/src/avconfig.c b/software/sys_controller/src/avconfig.c index e675787..df4fd32 100644 --- a/software/sys_controller/src/avconfig.c +++ b/software/sys_controller/src/avconfig.c @@ -59,10 +59,8 @@ const avconfig_t tc_default = { .c_gain = DEFAULT_COARSE_GAIN, }, .mask_br = 8, -#ifdef ENABLE_AUDIO .audio_dw_sampl = DEFAULT_ON, .audio_gain = AUDIO_GAIN_0DB, -#endif .link_av = AV_LAST, }; diff --git a/software/sys_controller/src/menu.c b/software/sys_controller/src/menu.c index f0d198d..ab1c16e 100644 --- a/software/sys_controller/src/menu.c +++ b/software/sys_controller/src/menu.c @@ -228,7 +228,6 @@ MENU(menu_compatibility, P99_PROTECT({ \ { "Default HDMI VIC", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.default_vic, OPT_NOWRAP, 0, HDMI_1080p50, value_disp } } }, })) -#ifdef ENABLE_AUDIO MENU(menu_audio, P99_PROTECT({ \ { LNG("Down-sampling","ダウンサンプリング"), OPT_AVCONFIG_SELECTION, { .sel = { &tc.audio_dw_sampl, OPT_WRAP, SETTING_ITEM(audio_dw_sampl_desc) } } }, { LNG("Swap left/right","ヒダリ/ミギスワップ"), OPT_AVCONFIG_SELECTION, { .sel = { &tc.audio_swap_lr, OPT_WRAP, SETTING_ITEM(off_on_desc) } } }, @@ -236,9 +235,6 @@ MENU(menu_audio, P99_PROTECT({ \ { "Pre-ADC gain", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.audio_gain, OPT_NOWRAP, 0, AUDIO_GAIN_MAX, aud_db_disp } } }, })) #define AUDIO_MENU { LNG("Audio options >","オーディオオプション >"), OPT_SUBMENU, { .sub = { &menu_audio, NULL, NULL } } }, -#else -#define AUDIO_MENU -#endif MENU(menu_settings, P99_PROTECT({ \ { LNG("Link prof->input","Link prof->input"), OPT_AVCONFIG_NUMVALUE, { .num = { &tc.link_av, OPT_WRAP, AV1_RGBs, AV_LAST, link_av_desc } } }, From 41549e09571aecdfcb4f1618c9c044b3978b8d2b Mon Sep 17 00:00:00 2001 From: marqs Date: Sat, 19 Apr 2025 12:32:51 +0300 Subject: [PATCH 6/7] use ndmreset after reprogram --- scripts/rv-reprogram.tcl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/rv-reprogram.tcl b/scripts/rv-reprogram.tcl index 15ba4a0..23577bc 100644 --- a/scripts/rv-reprogram.tcl +++ b/scripts/rv-reprogram.tcl @@ -79,13 +79,11 @@ for {set i 0} {$i<$chunks} {incr i} { #master_read_to_file $claim_path mem_init/flash_readback.bin $flash_imem_base $bin_size #master_read_to_file $claim_path mem_init/ram_readback.bin 0x010000 65536 -close_service master $claim_path - - -set jtag_debug_list [get_service_paths jtag_debug] -set jd [ lindex $jtag_debug_list 0 ] -open_service jtag_debug $jd puts "Resetting system" -jtag_debug_reset_system $jd -close_service jtag_debug $jd -puts "Done" +master_write_32 $claim_path 0x40 0x00000003 +after 1 +master_write_32 $claim_path 0x40 0x00000001 +master_write_32 $claim_path 0x40 0x00000000 + +close_service master $claim_path +puts "Done" \ No newline at end of file From 21f8bc540662e2a861940ef3149209d112ff39be Mon Sep 17 00:00:00 2001 From: marqs Date: Sat, 19 Apr 2025 12:33:10 +0300 Subject: [PATCH 7/7] update Codelite project file --- software/ossc_sw.project | 153 +++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 70 deletions(-) diff --git a/software/ossc_sw.project b/software/ossc_sw.project index 18a971a..36d4066 100644 --- a/software/ossc_sw.project +++ b/software/ossc_sw.project @@ -1,5 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33,77 +115,8 @@ - ./ + /home/markus/Code/ossc/software/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -