27 lines
659 B
C
27 lines
659 B
C
#ifndef FT_CAN_AL_H
|
|
#define FT_CAN_AL_H
|
|
|
|
#if defined(STM32F3)
|
|
#include "stm32f3xx_hal.h"
|
|
#define FTCAN_IS_BXCAN
|
|
#define FTCAN_MAX_FILTER_NO 13
|
|
#else
|
|
#error "Couldn't detect STM family"
|
|
#endif // STM32F3
|
|
|
|
#ifdef FTCAN_IS_BXCAN
|
|
HAL_StatusTypeDef ftcan_init(CAN_HandleTypeDef *handle);
|
|
#endif // CAN_IS_BXCAN
|
|
|
|
HAL_StatusTypeDef ftcan_transmit(uint8_t id, const uint8_t *data,
|
|
size_t datalen);
|
|
|
|
HAL_StatusTypeDef ftcan_add_filter(uint8_t id, uint8_t mask);
|
|
|
|
/**
|
|
* Define this function to be notified of incoming CAN messages
|
|
*/
|
|
void ftcan_msg_received_cb(uint8_t id, size_t datalen, const uint8_t *data);
|
|
|
|
#endif // FT_CAN_AL_H
|