From b5180002a7fb4248761583556a70c6646445c3c7 Mon Sep 17 00:00:00 2001 From: CarlWachter Date: Tue, 30 Apr 2024 15:44:28 +0200 Subject: [PATCH] README: Instructions for CAN --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c99602f..97ea1a7 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,18 @@ PS: For not officially supported chips use this as the include: #include #define STA_MCU_LITTLE_ENDIAN #define STA_PLATFORM_STM32 -``` \ No newline at end of file +``` +## Setting up the CAN Bus + +To enable the CAN Bus two things need to be done: +1. Enable CAN in the IOC with the RX0 and RX1 Interrupts enabled. +2. Add the following code to the `sta/config.hpp` file: +``` +#define STA_CAN_BUS_ENABLE +``` +PS: For not officially supported chips add this: +``` +#define STA_STM32_CAN_HANDLE {YOUR_HCAN_HANDLE} +``` + +After this messages will automatically be forwarded to the task with it's ID. To send messages use the interface defined in `tacos.hpp`. \ No newline at end of file