Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ function(add_g0b1_target TGTNAME)
add_target_common(${TGTNAME} STM32G0B1xx)
target_compile_definitions(${TGTNAME}_fw PRIVATE BOARD_${TGTNAME} STM32G0 CONFIG_M_CAN)
target_compile_options(${TGTNAME}_fw BEFORE PRIVATE ${CPUFLAGS_G0})
target_sources(${TGTNAME}_fw PRIVATE "src/can/m_can.c")
target_sources(${TGTNAME}_fw PRIVATE "src/device/device_g0.c")
target_link_options(${TGTNAME}_fw BEFORE PRIVATE ${CPUFLAGS_G0})
target_link_libraries(${TGTNAME}_fw PRIVATE STM32_HAL_STM32G0B1xx STM32_USB_Device_Library_STM32G0B1xx)
Expand Down
2 changes: 2 additions & 0 deletions include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
struct board_channel_config {
#if defined(CONFIG_BXCAN)
CAN_TypeDef *interface;
#elif defined(CONFIG_M_CAN)
FDCAN_GlobalTypeDef *interface;
#endif
};

Expand Down
5 changes: 5 additions & 0 deletions include/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
struct can_drv_reg_status {
#if defined (CONFIG_BXCAN)
uint32_t esr;
#elif defined(CONFIG_M_CAN)
uint32_t ecr;
uint32_t psr;
#endif
};

Expand All @@ -51,6 +54,8 @@ enum can_channel_flag {
typedef struct can_channel {
#if defined (CONFIG_BXCAN)
CAN_TypeDef *instance;
#elif defined(CONFIG_M_CAN)
FDCAN_HandleTypeDef channel;
#endif
struct can_drv_reg_status reg_status;
struct list_head list_from_host;
Expand Down
Loading
Loading