sick_dt35/User/device/can.h
2025-04-02 20:51:10 +08:00

20 lines
532 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "can.h"
#include "stm32f3xx_hal.h"
#include <stdint.h>
// CAN 调试结构体
typedef struct {
uint8_t TxData[8]; // 要发送的数据
uint16_t TxID; // 发送的CAN ID
uint8_t TxStatus; // 发送状态0: 成功1: 失败
uint32_t DebugCounter; // 调试计数器
} can_t;
// 外部变量声明
extern can_t can_debug;
// 函数声明
void CAN_Init(CAN_HandleTypeDef *hcan_Cur);
uint8_t CAN_SendData(CAN_HandleTypeDef *hcan_Cur, uint8_t *pData, uint16_t ID);