README: Instructions for CAN

This commit is contained in:
CarlWachter 2024-04-30 15:44:28 +02:00
parent 104d2931be
commit b5180002a7

View File

@ -65,4 +65,18 @@ PS: For not officially supported chips use this as the include:
#include <sta/devices/stm32/mcu/common.hpp>
#define STA_MCU_LITTLE_ENDIAN
#define STA_PLATFORM_STM32
```
```
## 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`.