Initial WIP build

This commit is contained in:
@CarlWachter
2023-10-25 16:19:32 +02:00
commit 18bcba3706
357 changed files with 125194 additions and 0 deletions

35
App/Src/test.cpp Normal file
View File

@@ -0,0 +1,35 @@
/*
* test.cpp
*
* Created on: Oct 24, 2023
* Author: carlw
*/
//#include <sta/bus/can/controller.hpp>
#include <sta/devices/stm32/can.hpp>
//extern STM32CanController(CAN_HandleTypeDef * handle);
extern "C" void testCan(CAN_HandleTypeDef * handle){
sta::STM32CanController canController(handle);
canController.start();
// Create a CanTxHeader for your message
sta::CanTxHeader txHeader;
txHeader.id.format = sta::CanIdFormat::EXT; // Set to EXT for extended ID
txHeader.id.eid = 0xCAFE; // Set the standard ID or extended ID
txHeader.payloadLength = 8; // Set the payload length (max 8 bytes)
// Create your message payload
uint8_t payload[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
// Send the CAN message
while (true){
canController.sendFrame(txHeader, payload);
}
}