Implemented Low Level Compunications

This commit is contained in:
AlexanderHD27
2024-10-14 09:19:00 +02:00
parent 7eebf619ae
commit b150a905a3
15 changed files with 645 additions and 60 deletions

26
can-interface/a Normal file
View File

@@ -0,0 +1,26 @@
txBuffer[0] = 0b00000011; // Read Instruction
txBuffer[1] = 0x0f; // CANCTRL Register Address
spi_transaction_t transaction0 = { // RESET
.cmd = 0b11000000,
.length = 3 * 8,
.rxlength = 3 * 8,
.tx_buffer = txBuffer,
.rx_buffer = rxBuffer
};
spi_transaction_t transaction1 = { // READ STAT/S
.cmd = 0b10110000,
.length = 2 * 8,
.rxlength = 2 * 8,
.tx_buffer = txBuffer,
.rx_buffer = rxBuffer
};
vTaskDelay(100 / portTICK_PERIOD_MS);
gpio_set_level(EXTERNAL_TRIGGER, false);
spi_device_transmit(mp2125_handle, &transaction0);