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"