freeRTOS操作系统机器人实现
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.1 KiB

3 days ago
/******************************************************************************
(C), 2018-2099, Radkil
******************************************************************************
: bsp_CAN.h
: 稿
: radkil
: 2026513
:
: bsp_CAN.c
:
1. : 2026513
: radkil
:
******************************************************************************/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
#ifndef __BSP_CAN_H__
#define __BSP_CAN_H__
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */
/*==============================================*
* include header files *
*----------------------------------------------*/
#include "bsp_config.h"
#ifdef USE_CAN
#include "main.h"
#include "com.h"
/*==============================================*
* constants or macros define *
*----------------------------------------------*/
#define NewCANSendVersion 0
typedef struct
{
uint32_t m_temp_size;
FDCAN_HandleTypeDef *m_can;
FDCAN_TxHeaderTypeDef *m_cantx;
FDCAN_RxHeaderTypeDef *m_canrx;
uint8_t *m_temp;
}TCANUserData;
/*==============================================*
* project-wide global variables *
*----------------------------------------------*/
/*==============================================*
* routines' or functions' implementations *
*----------------------------------------------*/
extern void CAN_IT_init(TComCtrl *_ptComCtrl);
extern TCANUserData *CAN_userdata_init(FDCAN_HandleTypeDef *_fdCAN, uint32_t _Size, int _iIsLoop);
extern void CAN_RX_IRQHandler(TComCtrl *_ptComCtrl);
extern int CAN_TX_FIFOQ(TComCtrl *_ptComCtrl, uint32_t _iFrameID, char *_pBuffer, uint32_t _iSize);
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __BSP_CAN_H__ */