pdu/Software/Code/Core/Inc/can_communication.h

35 lines
764 B
C

/*
* can_communication.h
*
* Created on: Mar 12, 2025
* Author: janek
*/
#ifndef INC_CAN_COMMUNICATION_H_
#define INC_CAN_COMMUNICATION_H_
#include "channel_control.h"
#include "can_halal.h"
#include "current_monitoring.h"
#define RX_STATUS_HEARTBEAT 0xC7 // IDs of all CAN-packages (may be other IDs next year)
#define RX_STATUS_MSG_ID 0xC8
#define TX_STATUS_MSG_ID 0xC9
#define CUR_CHANNELS_1_ID 0xCA
#define CUR_CHANNELS_2_ID 0xCB
#define CUR_CHANNELS_3_ID 0xCC
#define CUR_CHANNELS_4_ID 0xCD
#define ERROR_ID 0xCE
typedef struct {
enable_gpios iostatus;
uint8_t checksum;
} rx_status_frame;
void can_init(CAN_HandleTypeDef* hcan);
void can_rxupdateFrame();
void can_sendloop();
void can_error_report();
#endif /* INC_CAN_COMMUNICATION_H_ */