static void init(void) { /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize LED driver */ LED_INIT(); /* Initialize system timer */ timer_init(); /* * Kernel initialization: processes (allow to create and dispatch * processes using proc_new()). */ proc_init(); /* Init spi on dma to drive lcd */ spi_dma_init(&spi); spi_dma_setclock(LCD_SPICLOCK); /* Initialize the dispaly */ lcd_ili9225_init(&spi.fd); /* Init the backligth display leds */ LCD_BACKLIGHT_INIT(); lcd_setBacklight(LCD_BACKLIGHT_MAX); /* Draw an empty Bitmap on the screen */ gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); /* Refresh the display */ lcd_ili9225_blitBitmap(&lcd_bitmap); /* Initialize the keypad driver */ kbd_init(); }
/*----------------------------------------------------------------------------*/ void init_disp(void) { init_disp_buf(); seg_init(); com_init(); LCD_BACKLIGHT_INIT(); LCD_BACKLIGHT_ON(); }
int main(void) { IRQ_ENABLE; kdbg_init(); LED_INIT(); timer_init(); proc_init(); spi_dma_init(&spi); spi_dma_setclock(LCD_SPICLOCK); lcd_ili9225_init(&spi.fd); LCD_BACKLIGHT_INIT(); lcd_setBacklight(lcd_brightness); gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); gfx_setFont(&lcd_bitmap, &font_luBS14); lcd_ili9225_blitBitmap(&lcd_bitmap); kbd_init(); hp_proc = proc_new(hp_process, NULL, PROC_STACK_SIZE, hp_stack); lp_proc = proc_new(lp_process, NULL, PROC_STACK_SIZE, lp_stack); led_proc = proc_new(led_process, NULL, PROC_STACK_SIZE, led_stack); proc_setPri(hp_proc, 2); proc_setPri(lp_proc, 1); lcd_ili9225_blitBitmap24(0, 50, BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, bmp_logo); timer_delay(3000); while (1) { menu_handle(&main_menu); cpu_relax(); } }