*/ void desenhaCabecalho(void){ char charVector[50]; /* Draw text, image and basic shapes on the LCD */ ili9325_set_foreground_color(COLOR_BLACK); ili9325_draw_string(10, 5, (uint8_t *)"AULA20-UART"); ili9325_set_foreground_color(COLOR_BLACK); ili9325_draw_string(10, 25, (uint8_t *)"Henrique Rosa v1.0"); //printf("-- Compiled: %s %s --\n\r\n\r", __DATE__, __TIME__); sprintf(charVector, "%s %s", __DATE__, __TIME__); ili9325_set_foreground_color(COLOR_BLACK); ili9325_draw_string(0, 45, (uint8_t *)charVector); ili9325_draw_filled_rectangle(10, 65, ILI9325_LCD_WIDTH - 10, 68); ili9325_draw_filled_rectangle(10, 71, ILI9325_LCD_WIDTH - 10, 74);
/** * \brief Application entry point for smc_lcd example. * * \return Unused (ANSI-C compatibility). */ int main(void) { uint32_t i = 0; uint8_t uc_string_display[30]; sysclk_init(); board_init(); /* LCD display initialization */ _display_init(); /* Clear LCD */ ili9325_fill(COLOR_WHITE); /* Initialize Pir sensor */ re200b_motion_detect_init(ACC_MR_SELMINUS_AD0, ACC_MR_SELPLUS_AD4); while (1) { /* Reset motion detection (enable interrupt, clear variable, * clear status register) */ re200b_motion_detect_enable(); re200b_motion_detect_reset(); acc_get_interrupt_status(ACC); /* Enter sleep mode */ pmc_enable_sleepmode(0); /* Check if a motion was detected */ if (re200b_motion_detection() != 0UL) { /* Disable motion detection */ re200b_motion_detect_disable(); /* Display information about motion detection on LCD */ if ((i*LCD_LINE_HEIGHT) >= BOARD_LCD_HEIGHT) { i = 0; ili9325_fill(COLOR_WHITE); } sprintf((char*)uc_string_display, "Motion Detected:%ul", i); ili9325_draw_string(0, i*LCD_LINE_HEIGHT, uc_string_display); i++; } } }
/** * \brief Application entry point for smc_lcd example. * * \return Unused (ANSI-C compatibility). */ int main(void) { sysclk_init(); board_init(); /* Initialize debug console */ configure_console(); /* Enable peripheral clock */ pmc_enable_periph_clk(ID_SMC); /* Configure SMC interface for Lcd */ smc_set_setup_timing(SMC,ILI9325_LCD_CS,SMC_SETUP_NWE_SETUP(2) | SMC_SETUP_NCS_WR_SETUP(2) | SMC_SETUP_NRD_SETUP(2) | SMC_SETUP_NCS_RD_SETUP(2)); smc_set_pulse_timing(SMC, ILI9325_LCD_CS , SMC_PULSE_NWE_PULSE(4) | SMC_PULSE_NCS_WR_PULSE(4) | SMC_PULSE_NRD_PULSE(10) | SMC_PULSE_NCS_RD_PULSE(10)); smc_set_cycle_timing(SMC, ILI9325_LCD_CS, SMC_CYCLE_NWE_CYCLE(10) | SMC_CYCLE_NRD_CYCLE(22)); #if !defined(SAM4S) smc_set_mode(SMC, ILI9325_LCD_CS, SMC_MODE_READ_MODE | SMC_MODE_WRITE_MODE | SMC_MODE_DBW_8_BIT); #else smc_set_mode(SMC, ILI9325_LCD_CS, SMC_MODE_READ_MODE | SMC_MODE_WRITE_MODE); #endif /* Initialize display parameter */ g_ili9325_display_opt.ul_width = ILI9325_LCD_WIDTH; g_ili9325_display_opt.ul_height = ILI9325_LCD_HEIGHT; g_ili9325_display_opt.foreground_color = COLOR_BLACK; g_ili9325_display_opt.background_color = COLOR_WHITE; /* Switch off backlight */ aat31xx_disable_backlight(); /* Initialize LCD */ ili9325_init(&g_ili9325_display_opt); /* Set backlight level */ aat31xx_set_backlight(AAT31XX_AVG_BACKLIGHT_LEVEL); ili9325_set_foreground_color(COLOR_WHITE); ili9325_draw_filled_rectangle(0, 0, ILI9325_LCD_WIDTH, ILI9325_LCD_HEIGHT); /* Turn on LCD */ ili9325_display_on(); /* Draw text, image and basic shapes on the LCD */ ili9325_set_foreground_color(COLOR_BLACK); ili9325_draw_string(10, 20, (uint8_t *)"ili9325_lcd example"); ili9325_set_foreground_color(COLOR_RED); ili9325_draw_circle(60, 160, 40); ili9325_set_foreground_color(COLOR_GREEN); ili9325_draw_circle(120, 160, 40); ili9325_set_foreground_color(COLOR_BLUE); ili9325_draw_circle(180, 160, 40); ili9325_set_foreground_color(COLOR_VIOLET); ili9325_draw_line(0, 0, 240, 320); while (1) { } }