|
TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
|
Data Structures | |
| struct | menu_item |
| Menu item struct. More... | |
| struct | menu_cfg |
| Menu configuration and state. More... | |
Enumerations | |
| enum | page_id { PAGE_WELCOME , PAGE_PLAY_GAME , PAGE_HIGH_SCORES , PAGE_SETTINGS , PAGE_ADJUST_BRIGHTNESS , PAGE_CALIBRATE_JOYSTICK , PAGE_GAME_OVER } |
| Menu page identifiers. More... | |
Functions | |
| int | menu_init (struct menu_cfg *menu) |
| Initializes menu and OLED display. | |
| int | page_dispatch (struct menu_cfg *menu) |
| Dispatches to the current page display function. | |
| int | welcome_display (struct menu_cfg *menu) |
| Displays the welcome page. | |
| int | play_game_display (struct menu_cfg *menu) |
| Displays the play game page. | |
| int | high_scores_display (struct menu_cfg *menu) |
| Displays the high scores page. | |
| int | settings_display (struct menu_cfg *menu) |
| Displays the settings page. | |
| int | brightness_display (struct menu_cfg *menu) |
| int | calibrate_joystick_display (struct menu_cfg *menu) |
| int | game_over_display (struct menu_cfg *menu) |
| int | draw_cursor (struct menu_cfg *menu) |
| Draws the cursor (">") at the current cursor position in the menu. | |
| int | cursor_update (struct menu_cfg *menu, struct io_avr_buttons *btn) |
| Updates the cursor position based on nav button from the IO board. Wraps around if going out of bounds. | |
| int | page_select (struct menu_cfg *menu, struct io_avr_buttons *btn) |
| Selects the current menu item based on nav button from the IO board. | |
| int | set_page (struct menu_cfg *menu, enum page_id page) |
| Sets the current page field in the menu struct to a specified page and calls the page_dispatch function. | |
| int | page_back (struct menu_cfg *menu, struct io_avr_buttons *btn) |
| int | menu_handler (struct menu_cfg *menu, struct io_avr_buttons *btn) |
| Handles menu logic (navigation, selection, page timers). | |
| enum page_id |
#include <menu.h>
Menu page identifiers.
| Enumerator | |
|---|---|
| PAGE_WELCOME | |
| PAGE_PLAY_GAME | |
| PAGE_HIGH_SCORES | |
| PAGE_SETTINGS | |
| PAGE_ADJUST_BRIGHTNESS | |
| PAGE_CALIBRATE_JOYSTICK | |
| PAGE_GAME_OVER | |
Definition at line 19 of file menu.h.
| int brightness_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Definition at line 114 of file menu.c.
Referenced by page_dispatch().
| int calibrate_joystick_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Definition at line 125 of file menu.c.
Referenced by page_dispatch().
| int cursor_update | ( | struct menu_cfg * | menu, |
| struct io_avr_buttons * | btn ) |
#include <menu.h>
Updates the cursor position based on nav button from the IO board. Wraps around if going out of bounds.
| [in] | menu | The menu configuration struct |
| [in] | btn | The button states struct |
Definition at line 178 of file menu.c.
Referenced by menu_handler().
| int draw_cursor | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Draws the cursor (">") at the current cursor position in the menu.
| [in] | menu | The menu configuration struct |
Definition at line 154 of file menu.c.
Referenced by menu_handler(), settings_display(), and welcome_display().
| int game_over_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Definition at line 136 of file menu.c.
Referenced by page_dispatch().
| int high_scores_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Displays the high scores page.
| [in] | menu | The menu configuration struct |
Definition at line 75 of file menu.c.
Referenced by page_dispatch().
| int menu_handler | ( | struct menu_cfg * | menu, |
| struct io_avr_buttons * | btn ) |
#include <menu.h>
Handles menu logic (navigation, selection, page timers).
| menu | Pointer to menu configuration |
| btn | Pointer to button input struct |
Handles menu logic (navigation, selection, page timers).
| [in] | menu | The menu configuration struct |
| [in] | btn | The button states struct |
Definition at line 340 of file menu.c.
Referenced by main().
| int menu_init | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Initializes menu and OLED display.
| menu | Pointer to menu configuration struct |
Initializes menu and OLED display.
| [in] | menu | The menu configuration struct |
Definition at line 16 of file menu.c.
Referenced by main().
| int page_back | ( | struct menu_cfg * | menu, |
| struct io_avr_buttons * | btn ) |
#include <menu.h>
Definition at line 302 of file menu.c.
Referenced by menu_handler().
| int page_dispatch | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Dispatches to the current page display function.
| menu | Pointer to menu configuration struct |
Dispatches to the current page display function.
| [in] | menu | The menu configuration struct |
Definition at line 276 of file menu.c.
Referenced by menu_handler(), menu_init(), and set_page().
| int page_select | ( | struct menu_cfg * | menu, |
| struct io_avr_buttons * | btn ) |
#include <menu.h>
Selects the current menu item based on nav button from the IO board.
| [in] | menu | The menu configuration struct |
| [in] | btn | The button states struct |
Definition at line 216 of file menu.c.
Referenced by menu_handler().
| int play_game_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Displays the play game page.
| [in] | menu | The menu configuration struct |
Definition at line 59 of file menu.c.
Referenced by page_dispatch().
#include <menu.h>
Sets the current page field in the menu struct to a specified page and calls the page_dispatch function.
| [in] | menu | The menu configuration struct |
| [in] | page | The page to set |
Definition at line 257 of file menu.c.
Referenced by page_back(), and page_select().
| int settings_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Displays the settings page.
| [in] | menu | The menu configuration struct |
Definition at line 91 of file menu.c.
Referenced by page_dispatch().
| int welcome_display | ( | struct menu_cfg * | menu | ) |
#include <menu.h>
Displays the welcome page.
| [in] | menu | The menu configuration struct |
Definition at line 30 of file menu.c.
Referenced by page_dispatch().