Red Bird Racing VCU v2
 
Loading...
Searching...
No Matches
Debug_can.hpp
Go to the documentation of this file.
1/**
2 * @file Debug_can.hpp
3 * @author Planeson, Chiho, Red Bird Racing
4 * @brief Declaration of the Debug_CAN namespace for CAN debugging functions
5 * @version 2.0.1
6 * @date 2026-03-04
7 * @see Debug_can.cpp
8 */
9
10#ifndef DEBUG_CAN_HPP
11#define DEBUG_CAN_HPP
12
13// ignore -Wpedantic warnings for mcp2515.h
14#pragma GCC diagnostic push
15#pragma GCC diagnostic ignored "-Wpedantic"
16#include <mcp2515.h>
17#pragma GCC diagnostic pop
18
19#include "Enums.hpp"
20
21/**
22 * @brief Namespace for CAN debugging functions
23 */
24namespace Debug_CAN
25{
26 extern MCP2515 *can_interface; /**< Pointer to the MCP2515 CAN controller instance. */
27
28 void initialize(MCP2515 *can_interface);
29
30
31 void send_message(
32 canid_t id,
33 uint8_t data0 = 0x00,
34 uint8_t data1 = 0x00,
35 uint8_t data2 = 0x00,
36 uint8_t data3 = 0x00,
37 uint8_t data4 = 0x00,
38 uint8_t data5 = 0x00,
39 uint8_t data6 = 0x00,
40 uint8_t data7 = 0x00);
41}
42
43#endif // DEBUG_CAN_HPP
Enumeration definitions for the VCU.
Namespace for CAN debugging functions.
Definition: Debug_can.hpp:25
void initialize(MCP2515 *can_interface)
Initializes the Debug_CAN interface. It should be called before using any other Debug_CAN functions.
Definition: Debug_can.cpp:26
void send_message(canid_t id, uint8_t data0=0x00, uint8_t data1=0x00, uint8_t data2=0x00, uint8_t data3=0x00, uint8_t data4=0x00, uint8_t data5=0x00, uint8_t data6=0x00, uint8_t data7=0x00)
Sends arbitrary debug data via CAN with specified message ID and data bytes.
Definition: Debug_can.cpp:46
MCP2515 * can_interface
Definition: Debug_can.cpp:18