29#include <util/delay.h>
59struct io_avr_buttons
btn;
152 if (
ctrl.game_over) {
Handles CAN communication for game control, joystick, and buttons.
int8_t can_init(struct can_device *dev)
Initialize a CAN device.
uint8_t process_can_frame(struct control_state *ctrl)
Processes an incoming CAN frame.
int8_t tx_joy_btn(struct io_joystick_device *joy_dev, struct io_avr_device *avr_dev, struct can_device *can_dev)
Transmits joystick positions and button states via CAN.
int8_t tx_gamestart(struct can_device *can_dev)
Sends a game start message via CAN.
int io_avr_init(struct io_avr_device *dev)
int io_avr_buttons_read(struct io_avr_device *dev, struct io_avr_buttons *btn)
#define LOG_CRITICAL(msg)
#define LOG_MODULE_DEFINE(name)
int menu_init(struct menu_cfg *menu)
Initializes menu and OLED display.
int menu_handler(struct menu_cfg *menu, struct io_avr_buttons *btn)
Handles menu logic (navigation, selection, page timers).
page_id
Menu page identifiers.
@ PAGE_CALIBRATE_JOYSTICK
int tim1_CTC_init(void)
Initialize Timer1 in CTC mode on OC1A.
int USART_init(struct USART_config *config)
Initialize USART0 with the given configuration.
#define STATUS_ASSERT(status)
Macro to assert a status and flash a debug LED.
int SRAM_test(void)
Tests external SRAM and prints a report.
int xmem_init(void)
Initializes external SRAM (2KB or 3KB depending on XMEM_3KB).
Driver for joystick, buttons, and OLED.
Logging interface for debug messages.
struct control_state ctrl
struct io_avr_buttons btn
struct io_joystick_position pos
static enum page_id last_state
struct CAN_frame dummy_msg
struct io_joystick_device joy
static struct menu_item settings_menu[]
static struct menu_item main_menu[]
struct io_oled_device oled
struct USART_config config
Represents a full CAN frame for sending/receiving.
USART configuration structure.
Represents a CAN device, storing the SPI slave controlling the MCP2515.
Stores current control state.
Represents an SPI-connected AVR-I/O board.
Represents a joystick input device.
Represents the position of a joystick relative to center.
Represents an OLED display device controlled via SPI.
Timer driver (for ADC clock).
UART communication driver.
Utility and helper functions for joystick, LED debugging, and mapping.
External SRAM interface for ATmega microcontrollers.