38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#include "mcp2521.hpp"
|
|
#include "mcp2521_command.hpp"
|
|
#include "mcp2521_addresses.hpp"
|
|
|
|
class MCP2521 : public MCP2521_Command_Interface {
|
|
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);
|
|
|
|
}; |