26 lines
515 B
C
26 lines
515 B
C
#ifndef __HW_CAN_H__
|
|
#define __HW_CAN_H__
|
|
|
|
|
|
#include "main.h"
|
|
#include "stm32f1xx_hal_can.h"
|
|
|
|
/**
|
|
* @brief 初始化CAN
|
|
* @param None
|
|
* @retval None
|
|
*/
|
|
void hwCanInit(void);
|
|
|
|
/**
|
|
* @brief 发送一帧标准帧CAN数据
|
|
* @param id 标准帧ID (11位, 0x000~0x7FF)
|
|
* @param data 待发送数据指针, 最多8字节
|
|
* @param dlc 数据长度 (0~8)
|
|
* @retval 1:成功送入发送邮箱 0:失败(无空闲邮箱)
|
|
*/
|
|
uint8_t hwCanSend(uint32_t id, uint8_t *data, uint8_t dlc);
|
|
|
|
#endif /* __HW_CAN_H__ */
|
|
|