Back to posts Edit this post
Copy content

24 Jan 11:10

lcd_1
//***************************************************************************** // hello.c - Simple hello world example. // // Maciej Kucia July 2013 // // This is part of revision 1.0 of the EK-LM4F232 Firmware Package. //***************************************************************************** #include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "driverlib/fpu.h" #include "driverlib/sysctl.h" #include "driverlib/rom.h" #include "driverlib/pin_map.h" #include "driverlib/uart.h" #include "grlib/grlib.h" #include "drivers/ili9341_240x320x262K.h" #include "utils/uartstdio.h" #include "driverlib/gpio.h" int main(void) { tContext sContext; tRectangle sRect; // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // ROM_FPULazyStackingEnable(); // // Set the clocking to run directly from the crystal. // ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); // // Initialize the display driver. // ILI9341_240x320x262K_Init(); // // Initialize the graphics context. // GrContextInit(&sContext, &g_sILI9341_240x320x262K); // // Print some text // //GrContextFontSet(&sContext, g_psFontCm12); //GrStringDrawCentered(&sContext, "Witaj", -1, GrContextDpyWidthGet(&sContext) / 2, (GrContextDpyHeightGet(&sContext) / 2), 0); //GrContextForegroundSet(&sContext, ClrCrimson); //GrContextFontSet(&sContext, g_psFontCm20b); //GrStringDrawCentered(&sContext, "PUT", -1, GrContextDpyWidthGet(&sContext) / 2, 20 + (GrContextDpyHeightGet(&sContext) / 2), 0); // Draw Rectangle sRect.i16XMin = 20; sRect.i16YMin = 20; sRect.i16XMax = 140; sRect.i16YMax = 100; GrContextBackgroundSet(&sContext, ClrWhite); GrContextForegroundSet(&sContext, ClrRed); GrRectFill(&sContext, &sRect); GrContextForegroundSet(&sContext, ClrWhite); GrContextFontSet(&sContext, g_psFontCm20b); GrStringDraw(&sContext, "Pole A", -1, 50, 50 , 0); // Draw Rectangle sRect.i16XMin = 180; sRect.i16YMin = 20; sRect.i16XMax = 300; sRect.i16YMax = 100; GrContextBackgroundSet(&sContext, ClrWhite); GrContextForegroundSet(&sContext, ClrGreen); GrRectFill(&sContext, &sRect); GrContextForegroundSet(&sContext, ClrBlack); GrContextFontSet(&sContext, g_psFontCm20b); GrStringDraw(&sContext, "Pole B", -1, 210, 50 , 0); // Draw Rectangle sRect.i16XMin = 20; sRect.i16YMin = 140; sRect.i16XMax = 140; sRect.i16YMax = 220; GrContextBackgroundSet(&sContext, ClrWhite); GrContextForegroundSet(&sContext, ClrBlue); GrRectFill(&sContext, &sRect); GrContextForegroundSet(&sContext, ClrBlack); GrContextFontSet(&sContext, g_psFontCmtt20); GrStringDraw(&sContext, "Pole B", -1, 50, 175 , 0); // Draw Rectangle sRect.i16XMin = 180; sRect.i16YMin = 140; sRect.i16XMax = 300; sRect.i16YMax = 220; GrContextBackgroundSet(&sContext, ClrWhite); GrContextForegroundSet(&sContext, ClrYellow); GrRectFill(&sContext, &sRect); GrContextForegroundSet(&sContext, ClrBlack); GrContextFontSet(&sContext, g_psFontCmsc20); GrStringDraw(&sContext, "Pole B", -1, 210, 175 , 0); while(1){} }

No files