Merged i2c-helper in Main

This commit is contained in:
AlexanderHD27
2025-01-12 00:16:00 +01:00
parent f4792de050
commit b5c7e5b4c1
396 changed files with 182143 additions and 14 deletions

View File

@@ -0,0 +1,38 @@
#pragma once
#include <stdint.h>
#include "mcp2521.hpp"
#include "mcp2521_command.hpp"
#include "mcp2521_addresses.hpp"
class MCP2521 : public MCP2521_CommandInterface {
private:
public:
void set_tx_id(MCP2521_TX_BUFFER buffer, uint16_t id, bool extended);
/**
* @brief Loads the Data Length Code register for the specified buffer
*
* @param buffer What Buffer to load the DLC register for
* @param length How many bytes are in the message (0-8)
* @param rtr: Remote Transmission Request
*/
void set_DLC_reg(MCP2521_TX_BUFFER buffer, uint8_t length, bool rtr);
/**
* @brief Loads the data and id into the specified buffer
*
* @param buffer
* @param id
* @param data
* @param length
*/
void prepare_tx(MCP2521_TX_BUFFER buffer, uint32_t id, uint8_t *data, size_t length, bool rtr, bool extended);
void set_mode_of_operation(MCP2521_OPERATION_MODE mode, bool singleshot);
void set_singleshot_mode(bool enable);
void enable_interrupts(bool MessageError, bool ErrorInterrupt, bool WakeUp, bool TXB0, bool TXB1, bool TXB2, bool RXB0, bool RXB1);
rx_info get_rx_id(MCP2521_RX_BUFFER buffer);
};