|
TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
|
Main entry point for the TTK4155 Node 1 firmware. More...
#include <stddef.h>#include <stdlib.h>#include <util/delay.h>#include "can.h"#include "controller.h"#include "io.h"#include "log.h"#include "menu.h"#include "spi.h"#include "timer.h"#include "uart.h"#include "utils.h"#include "xmem.h"Go to the source code of this file.
Macros | |
| #define | BAUD 9600 |
Functions | |
| LOG_MODULE_DEFINE ("main") | |
| int | main () |
Variables | |
| struct USART_config | config = {BAUD, F_CPU} |
| struct io_joystick_device | joy = {0, 1, 67, 69, 247, 247} |
| struct io_oled_device | oled = {SSB2} |
| struct io_avr_device | avr = {SSB3} |
| struct can_device | can = {SSE2} |
| struct io_joystick_position | pos |
| struct io_avr_buttons | btn |
| struct CAN_frame | dummy_msg |
| static struct menu_item | settings_menu [] |
| static struct menu_item | main_menu [] |
| struct menu_cfg | menu |
| struct control_state | ctrl = {0} |
| static enum page_id | last_state = PAGE_WELCOME |
Main entry point for the TTK4155 Node 1 firmware.
This file initializes all peripherals and modules, then enters the main game loop. The loop handles:
Modules used:
Definition in file main.c.
| LOG_MODULE_DEFINE | ( | "main" | ) |
| int main | ( | ) |
Definition at line 97 of file main.c.
| struct io_avr_device avr = {SSB3} |
| struct io_avr_buttons btn |
Definition at line 59 of file main.c.
Referenced by cursor_update(), io_avr_buttons_read(), io_joystick_calibrate(), main(), menu_handler(), page_back(), page_select(), and tx_joy_btn().
| struct can_device can = {SSE2} |
| struct USART_config config = {BAUD, F_CPU} |
| struct control_state ctrl = {0} |
| struct io_joystick_device joy = {0, 1, 67, 69, 247, 247} |
|
static |
|
static |
Definition at line 69 of file main.c.
| struct menu_cfg menu |
Definition at line 76 of file main.c.
Referenced by brightness_display(), calibrate_joystick_display(), cursor_update(), draw_cursor(), game_over_display(), high_scores_display(), main(), menu_handler(), menu_init(), page_back(), page_dispatch(), page_select(), play_game_display(), set_page(), settings_display(), and welcome_display().
| struct io_oled_device oled = {SSB2} |
| struct io_joystick_position pos |
Definition at line 58 of file main.c.
Referenced by io_joystick_read_direction(), and utils_joystick_print_pos().
|
static |
Definition at line 63 of file main.c.