Implement I2C

This commit is contained in:
AlexanderHD27
2025-01-03 19:54:13 +01:00
parent bac01e3a9b
commit aa9d00bf6e
29 changed files with 1467 additions and 419 deletions

View File

@@ -0,0 +1,27 @@
#include "ctrl_interface.hpp"
#include "ctrl_interface_instructions.hpp"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
void GobotRPC_CI_txCIInstructionTaskFn(void *args) {
GobotRPC_CI *gobotRPC = (GobotRPC_CI *)args;
gobotRPC->txCIInstructionTask();
}
void GobotRPC_CI::txCIInstructionTask() {
while(1) {
CI_Instruction_Transport ciInstruction;
xQueueReceive(ciInstructionQueue, &ciInstruction, portMAX_DELAY);
switch (ciInstruction.type) {
case CI_INSTRUCTION_SEND_TRANMISSION_ERROR:
uint32_t addr = ciInstruction.data[1] | (ciInstruction.data[2] << 8) | (ciInstruction.data[3] << 16) | (ciInstruction.data[4] << 24);
uint8_t rx = ciInstruction.data[0];
send_ErrorTransmission(rx, addr);
break;
}
}
}