gui.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * gui.c
  3. *
  4. * Created on: Jan 12, 2021
  5. * Author: David Original work by Jose (PTDreamer), 2017
  6. */
  7. #include "boot_screen.h"
  8. #include "gui.h"
  9. #include "main_screen.h"
  10. #include "settings_screen.h"
  11. #include "calibration_screen.h"
  12. #include "oled.h"
  13. #include "screen.h"
  14. #include "debug_screen.h"
  15. u8g2_t u8g2;
  16. void guiInit(void) {
  17. u8g2_SetupDisplay(&u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_001, u8x8_dummy_cb, u8x8_dummy_cb); // Use 128x64 ssd1306 settings, dummy functions (u8g2 won't send data to screen)
  18. u8g2_SetupBuffer(&u8g2, oled.buffer, 8, u8g2_ll_hvline_vertical_top_lsb, U8G2_R0); //
  19. u8g2_SetFontMode(&u8g2,1); // Set font transparent
  20. u8g2_SetFontDirection(&u8g2, 0); // No rotation
  21. u8g2_SetFontPosTop(&u8g2); // Take upper font ref. as start drawing position
  22. oled_addScreen(&Screen_boot, screen_boot);
  23. boot_screen_setup(&Screen_boot);
  24. oled_addScreen(&Screen_main,screen_main);
  25. main_screen_setup(&Screen_main);
  26. oled_addScreen(&Screen_settingsmenu,screen_settingsmenu);
  27. settings_screen_setup(&Screen_settingsmenu);
  28. //settings_screen_setup();
  29. #ifdef ENABLE_DEBUG_SCREEN
  30. oled_addScreen(&Screen_debug,screen_debug);
  31. debug_screen_setup(&Screen_debug);
  32. oled_addScreen(&Screen_debug2,screen_debug2);
  33. debug2_screen_setup(&Screen_debug2);
  34. #endif
  35. oled_addScreen(&Screen_edit_calibration,screen_edit_calibration);
  36. calibration_screen_setup(&Screen_edit_calibration);
  37. }