TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
Loading...
Searching...
No Matches
controller.h
Go to the documentation of this file.
1
8
9#ifndef CONTROLLER_H_
10#define CONTROLLER_H_
11
12#include "can.h"
13#include "io.h"
14
19 uint8_t game_over;
20};
21
27uint8_t process_can_frame(struct control_state *ctrl);
28
36int8_t tx_joy_btn(struct io_joystick_device *joy_dev,
37 struct io_avr_device *avr_dev, struct can_device *can_dev);
38
44int8_t tx_gamestart(struct can_device *can_dev);
45
51int8_t tx_reset(struct can_device *can_dev);
52
58int8_t tx_error(struct can_device *can_dev);
59
60#endif /* CONTROLLER_H_ */
61
CAN driver.
int8_t tx_error(struct can_device *can_dev)
Sends an error message via CAN.
Definition controller.c:78
uint8_t process_can_frame(struct control_state *ctrl)
Processes an incoming CAN frame.
Definition controller.c:15
int8_t tx_reset(struct can_device *can_dev)
Sends a reset message via CAN.
Definition controller.c:68
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.
Definition controller.c:34
int8_t tx_gamestart(struct can_device *can_dev)
Sends a game start message via CAN.
Definition controller.c:58
Driver for joystick, buttons, and OLED.
struct control_state ctrl
Definition main.c:91
Represents a CAN device, storing the SPI slave controlling the MCP2515.
Definition can.h:43
Stores current control state.
Definition controller.h:18
uint8_t game_over
Definition controller.h:19
Represents an SPI-connected AVR-I/O board.
Definition io.h:39
Represents a joystick input device.
Definition io.h:55