Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MiscDrivers): Replace 2.4" TFT fonts with Liberation fonts #792

Merged
merged 22 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/MAX32662/Demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int main(void)

MXC_TFT_SetBackGroundColor(WHITE);

MXC_TFT_SetFont((int)&SansSerif16x16[0]);
MXC_TFT_SetFont((int)&Liberation_Sans16x16[0]);

error = MXC_RTC_Init(0, 0);
if (error != E_NO_ERROR) {
Expand Down
2 changes: 2 additions & 0 deletions Examples/MAX32662/Demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ endif

IPATH += resources
VPATH += resources/tft_demo

FONTS = LiberationSans16x16
203 changes: 0 additions & 203 deletions Examples/MAX32662/Demo/resources/tft_demo/Arial12x12.c

This file was deleted.

491 changes: 0 additions & 491 deletions Examples/MAX32662/Demo/resources/tft_demo/Arial24x23.c

This file was deleted.

874 changes: 0 additions & 874 deletions Examples/MAX32662/Demo/resources/tft_demo/Arial28x28.c

This file was deleted.

299 changes: 0 additions & 299 deletions Examples/MAX32662/Demo/resources/tft_demo/SansSerif16x16.c

This file was deleted.

395 changes: 0 additions & 395 deletions Examples/MAX32662/Demo/resources/tft_demo/SansSerif19x19.c

This file was deleted.

2 changes: 1 addition & 1 deletion Examples/MAX32672/Demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int main(void)

MXC_TFT_SetBackGroundColor(WHITE);

MXC_TFT_SetFont((int)&SansSerif16x16[0]);
MXC_TFT_SetFont((int)&Liberation_Sans16x16[0]);

error = MXC_RTC_Init(0, 0);
if (error != E_NO_ERROR) {
Expand Down
2 changes: 2 additions & 0 deletions Examples/MAX32672/Demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ endif

IPATH += resources
VPATH += resources/tft_demo

FONTS = LiberationSans16x16
203 changes: 0 additions & 203 deletions Examples/MAX32672/Demo/resources/tft_demo/Arial12x12.c

This file was deleted.

491 changes: 0 additions & 491 deletions Examples/MAX32672/Demo/resources/tft_demo/Arial24x23.c

This file was deleted.

299 changes: 0 additions & 299 deletions Examples/MAX32672/Demo/resources/tft_demo/SansSerif16x16.c

This file was deleted.

395 changes: 0 additions & 395 deletions Examples/MAX32672/Demo/resources/tft_demo/SansSerif19x19.c

This file was deleted.

24 changes: 12 additions & 12 deletions Examples/MAX32690/TFT_Demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,27 @@ void TFT_test(void)
MXC_TFT_SetForeGroundColor(WHITE); // set chars to white
MXC_TFT_ClearScreen();

TFT_Print(buff, sizeof(buff), 3, 10, (int)&Arial12x12[0]); // Use Arial 12x12 font
TFT_Print(buff1, sizeof(buff1), 3, 22, (int)&Arial12x12[0]);
TFT_Print(buff2, sizeof(buff2), 3, 34, (int)&Arial12x12[0]);
TFT_Print(buff, sizeof(buff), 3, 10, (int)&Liberation_Sans12x12[0]);
TFT_Print(buff1, sizeof(buff1), 3, 22, (int)&Liberation_Sans12x12[0]);
TFT_Print(buff2, sizeof(buff2), 3, 34, (int)&Liberation_Sans12x12[0]);
MXC_Delay(1000000);
MXC_TFT_ClearScreen();

TFT_Print(buff, sizeof(buff), 3, 30, (int)&Arial24x23[0]); // Use Arial 24x23 font
TFT_Print(buff1, sizeof(buff1), 3, 54, (int)&Arial24x23[0]);
TFT_Print(buff2, sizeof(buff2), 3, 78, (int)&Arial24x23[0]);
TFT_Print(buff, sizeof(buff), 3, 30, (int)&Liberation_Sans24x24[0]);
TFT_Print(buff1, sizeof(buff1), 3, 54, (int)&Liberation_Sans24x24[0]);
TFT_Print(buff2, sizeof(buff2), 3, 78, (int)&Liberation_Sans24x24[0]);
MXC_Delay(1000000);
MXC_TFT_ClearScreen();

TFT_Print(buff, sizeof(buff), 3, 40, (int)&Arial28x28[0]); // Use Arial 28x28 font
TFT_Print(buff1, sizeof(buff1), 3, 68, (int)&Arial28x28[0]);
TFT_Print(buff2, sizeof(buff2), 3, 96, (int)&Arial28x28[0]);
TFT_Print(buff, sizeof(buff), 3, 40, (int)&Liberation_Sans28x28[0]);
TFT_Print(buff1, sizeof(buff1), 3, 68, (int)&Liberation_Sans28x28[0]);
TFT_Print(buff2, sizeof(buff2), 3, 96, (int)&Liberation_Sans28x28[0]);
MXC_Delay(1000000);
MXC_TFT_ClearScreen();

TFT_Print(buff, sizeof(buff), 3, 80, (int)&SansSerif16x16[0]); // Use Sans Serif 16x16 font
TFT_Print(buff1, sizeof(buff1), 3, 96, (int)&SansSerif16x16[0]);
TFT_Print(buff2, sizeof(buff2), 3, 112, (int)&SansSerif16x16[0]);
TFT_Print(buff, sizeof(buff), 3, 80, (int)&Liberation_Sans16x16[0]);
TFT_Print(buff1, sizeof(buff1), 3, 96, (int)&Liberation_Sans16x16[0]);
TFT_Print(buff2, sizeof(buff2), 3, 112, (int)&Liberation_Sans16x16[0]);
MXC_Delay(1000000);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Examples/MAX32690/TFT_Demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ SBT=0
IPATH += resources
VPATH += resources/tft_demo

FONTS = LiberationSans12x12 LiberationSans24x24 LiberationSans28x28 LiberationSans16x16

ifeq ($(BOARD),FTHR)
$(error ERR_NOTSUPPORTED: This project is not supported for the FTHR board)
endif
203 changes: 0 additions & 203 deletions Examples/MAX32690/TFT_Demo/resources/tft_demo/Arial12x12.c

This file was deleted.

491 changes: 0 additions & 491 deletions Examples/MAX32690/TFT_Demo/resources/tft_demo/Arial24x23.c

This file was deleted.

874 changes: 0 additions & 874 deletions Examples/MAX32690/TFT_Demo/resources/tft_demo/Arial28x28.c

This file was deleted.

299 changes: 0 additions & 299 deletions Examples/MAX32690/TFT_Demo/resources/tft_demo/SansSerif16x16.c

This file was deleted.

395 changes: 0 additions & 395 deletions Examples/MAX32690/TFT_Demo/resources/tft_demo/SansSerif19x19.c

This file was deleted.

201 changes: 0 additions & 201 deletions Examples/MAX78000/CNN/UNet-demo/TFT/fthr/Arial12x12.c

This file was deleted.

489 changes: 0 additions & 489 deletions Examples/MAX78000/CNN/UNet-demo/TFT/fthr/Arial24x23.c

This file was deleted.

873 changes: 0 additions & 873 deletions Examples/MAX78000/CNN/UNet-demo/TFT/fthr/Arial28x28.c

This file was deleted.

297 changes: 0 additions & 297 deletions Examples/MAX78000/CNN/UNet-demo/TFT/fthr/SansSerif16x16.c

This file was deleted.

393 changes: 0 additions & 393 deletions Examples/MAX78000/CNN/UNet-demo/TFT/fthr/SansSerif19x19.c

This file was deleted.

22 changes: 6 additions & 16 deletions Examples/MAX78000/CNN/UNet-demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ int font_2 = urw_gothic_13_white_bg_grey;
#undef USE_SPIDATA // only supported in evkit
int image_bitmap_1 = (int)&img_1_rgb565[0];
int image_bitmap_2 = (int)&logo_rgb565[0];
int font_1 = (int)&SansSerif16x16[0];
int font_2 = (int)&SansSerif16x16[0];
int font_1 = (int)&Liberation_Sans16x16[0];
int font_2 = (int)&Liberation_Sans16x16[0];
#endif

#define FT4222_CLK 60000000
Expand Down Expand Up @@ -509,20 +509,14 @@ int main(void)
MXC_TFT_SetBackGroundColor(4);
//MXC_TFT_ShowImage(1, 1, image_bitmap_2);
memset(buff, 32, TFT_BUFF_SIZE);

TFT_Print(buff, 55, 30, font_2, snprintf(buff, sizeof(buff), "ANALOG DEVICES "));

TFT_Print(buff, 15, 50, font_2, snprintf(buff, sizeof(buff), "U-Net Segmentation Demo "));

TFT_Print(buff, 120, 90, font_1, snprintf(buff, sizeof(buff), "Ver. 1.1.0 "));

TFT_Print(buff, 55, 130, font_1,
snprintf(buff, sizeof(buff), "Building(red), Sky(blue) "));

TFT_Print(buff, 5, 170, font_1,
snprintf(buff, sizeof(buff), "Foliage(green), Unknown(black) "));

TFT_Print(buff, 30, 210, font_2, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO START "));
TFT_Print(buff, 10, 210, font_2, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO START "));
while (!PB_Get(0)) {}

// Enable peripheral, enable CNN interrupt, turn on CNN clock
Expand All @@ -534,9 +528,7 @@ int main(void)

#if defined(USE_SPIDATA)
spi_init();

MXC_TFT_ClearScreen();

TFT_Print(buff, 55, 40, font_1, snprintf(buff, sizeof(buff), "Waiting for SPI data ..."));
#endif
while (1) {
Expand All @@ -548,7 +540,8 @@ int main(void)

MXC_TFT_ClearScreen();

//TFT_Print(buff, 5, 45, font_1, snprintf(buff, sizeof(buff), " Image Mask Overlay"));
//TFT_Print(buff, 5, 45, font_1,
// snprintf(buff, sizeof(buff), " Image Mask Overlay"));

// Reload bias after wakeup
cnn_init(); // Bring state machine into consistent state
Expand Down Expand Up @@ -579,15 +572,12 @@ int main(void)
(float)cnn_time / 1000));

#if !defined(USE_SPIDATA)

TFT_Print(buff, 20, 212, font_1,
snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO CONTINUE "));
TFT_Print(buff, 0, 212, font_1, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO CONTINUE"));
while (!PB_Get(0)) {}
#else
SPI_FLAG = false;
spi_clear_interrupts(MXC_F_SPI_INTFL_SSA);
spi_enable_interrupts(MXC_F_SPI_INTEN_SSA);

#endif
if (PB_Get(1)) {
LED_On(LED1);
Expand Down
4 changes: 4 additions & 0 deletions Examples/MAX78000/CNN/UNet-demo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

# **********************************************************

# Uncomment the line below to build for the MAX78000FTHR
#BOARD=FTHR_RevA

$(info Note: This project is designed and tested for the OV7692 only.)
override CAMERA=OV7692

Expand All @@ -29,6 +32,7 @@ endif
ifeq "$(BOARD)" "FTHR_RevA"
IPATH += TFT/fthr
VPATH += TFT/fthr
FONTS = LiberationSans16x16
endif

ifeq ($(BOARD),Aud01_RevA)
Expand Down
Loading