General CAN driver
To activate a specific CAN peripheral, define flag USE_CANx where x is your CAN peripheral number
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="can">
b'<define name="USE_CANx" value="FALSE" />\n '
b'<configure name="USE_CANFD" value="TRUE" />\n '
</module>
Module configuration options
Configure Options
- name:
USE_CANFD
value: TRUE
Description: Use CANFD or just CAN
Define Options
- name:
USE_CANx
value: FALSE
Description: Enable the CANx port
Module functions
Event Functions
These event functions are called in each cycle of the module event loop.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw can.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="can" dir="mcu_periph" task="mcu">
<doc>
<description>
General CAN driver
To activate a specific CAN peripheral, define flag USE_CANx where x is your CAN peripheral number
</description>
<configure name="USE_CANFD" value="TRUE" description="Use CANFD or just CAN"/>
<define name="USE_CANx" value="FALSE" description="Enable the CANx port"/>
</doc>
<dep>
<depends>mcu</depends>
<conflicts>uavcan</conflicts>
</dep>
<header>
<file name="can.h" dir="mcu_periph"/>
</header>
<event fun="can_event()" cond="ifeq ($(ARCH), stm32)"/>
<makefile>
<configure name="USE_CANFD" default="FALSE"/>
<define name="USE_CANFD" value="$(USE_CANFD)"/>
<file name="can.c" dir="mcu_periph"/>
<file_arch name="can_arch.c" dir="mcu_periph"/>
<test>
<define name="USE_CAN1"/>
</test>
</makefile>
</module>