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(); }
static void init(void) { /* Enable all the interrupts */ IRQ_ENABLE; /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); /* Initialize system timer */ timer_init(); /* Initialize UART1 */ ser_init(&out, SER_UART1); /* Configure UART1 to work at 115.200 bps */ ser_setbaudrate(&out, 115200); /* Initialize LED driver */ LED_INIT(); /* Initialize the OLED display (RIT128x96) */ rit128x96_init(); /* Draw an empty Bitmap on the screen */ gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); /* Refresh the display */ rit128x96_blitBitmap(&lcd_bitmap); /* Initialize the keypad driver */ kbd_init(); /* Initialize the internal flash memory */ flash_init(&flash, 0); /* * Kernel initialization: processes (allow to create and dispatch * processes using proc_new()). */ proc_init(); }
/*extern "C"*/ void lcd_gfx_qt_init(Bitmap *lcd_bitmap) { //FIXME INIT_WALL(wall_before_raster); //FIXME INIT_WALL(wall_after_raster); gfx_bitmapInit(lcd_bitmap, lcd_raster, EmulLCD::WIDTH, EmulLCD::HEIGHT); gfx_bitmapClear(lcd_bitmap); }
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(); } }