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
18
struct
control_state
{
19
uint8_t
game_over
;
20
};
21
27
uint8_t
process_can_frame
(
struct
control_state
*
ctrl
);
28
36
int8_t
tx_joy_btn
(
struct
io_joystick_device
*joy_dev,
37
struct
io_avr_device
*avr_dev,
struct
can_device
*can_dev);
38
44
int8_t
tx_gamestart
(
struct
can_device
*can_dev);
45
51
int8_t
tx_reset
(
struct
can_device
*can_dev);
52
58
int8_t
tx_error
(
struct
can_device
*can_dev);
59
60
#endif
/* CONTROLLER_H_ */
61
can.h
CAN driver.
tx_error
int8_t tx_error(struct can_device *can_dev)
Sends an error message via CAN.
Definition
controller.c:78
process_can_frame
uint8_t process_can_frame(struct control_state *ctrl)
Processes an incoming CAN frame.
Definition
controller.c:15
tx_reset
int8_t tx_reset(struct can_device *can_dev)
Sends a reset message via CAN.
Definition
controller.c:68
tx_joy_btn
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
tx_gamestart
int8_t tx_gamestart(struct can_device *can_dev)
Sends a game start message via CAN.
Definition
controller.c:58
io.h
Driver for joystick, buttons, and OLED.
ctrl
struct control_state ctrl
Definition
main.c:91
can_device
Represents a CAN device, storing the SPI slave controlling the MCP2515.
Definition
can.h:43
control_state
Stores current control state.
Definition
controller.h:18
control_state::game_over
uint8_t game_over
Definition
controller.h:19
io_avr_device
Represents an SPI-connected AVR-I/O board.
Definition
io.h:39
io_joystick_device
Represents a joystick input device.
Definition
io.h:55
include
controller.h
Generated by
1.15.0