summaryrefslogtreecommitdiff
path: root/bsp/stm32/libraries/HAL_Drivers/drivers/drv_fdcan.h
blob: d341fda4deb365ff1a93a652140fbb37074d3768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-02-24     heyuan       the first version
 * 2020-08-17     malongwei    Fix something
 */

#ifndef __DRV_FDCAN_H__
#define __DRV_FDCAN_H__

#include <board.h>
#include <rtdevice.h>

#if defined(RT_USING_CAN) && defined(RT_CAN_USING_CANFD)

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
    const char *name;
    FDCAN_HandleTypeDef fdcanHandle;
    FDCAN_RxHeaderTypeDef RxHeader;
    FDCAN_TxHeaderTypeDef TxHeader;
    uint8_t u8RxDataBuffer[8];
    uint8_t u8TxDataBuffer[8];
    FDCAN_FilterTypeDef FilterConfig; /*FDCAN filter*/
    struct rt_can_device device;      /* inherit from can device */
} stm32_fdcan_t;

typedef struct {
    uint32_t u32Baudrate;
    struct rt_can_bit_timing cam_bit_timing;
}stm32_fdcan_timing_t;

#ifdef __cplusplus
}
#endif

#endif /* RT_USING_CAN */
#endif /* __DRV_FDCAN_H__ */