Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
MCP2515Controller.hpp
Go to the documentation of this file.
1
16
17#ifndef MCP2515CONTROLLER_HPP
18#define MCP2515CONTROLLER_HPP
19
22#include "ISPIController.hpp"
24#include <QObject>
25#include <string>
26
32 Q_OBJECT
33public:
34 explicit MCP2515Controller(const std::string &spiDevice);
35 MCP2515Controller(const std::string &spiDevice,
37
38 ~MCP2515Controller() override;
39
40 bool init() override;
41 void processReading() override;
42 void stopReading() override;
43
45 bool isStopReadingFlagSet() const override;
46
47private:
55 bool stopReadingFlag = false;
58 bool ownsSPIController = false;
59
60 void setupHandlers();
61};
62
63#endif // MCP2515CONTROLLER_HPP
Definition of the CANMessageProcessor class.
Definition of the IMCP2515Controller class.
Definition of the ISPIController interface.
Definition of the MCP2515Configurator class.
Class that processes CAN messages.
Interface for the MCP2515 CAN controller. QObject.
Interface for the SPI controller.
Class that configures the MCP2515 CAN controller.
bool isStopReadingFlagSet() const override
Check if the stop reading flag is set.
void processReading() override
Start reading CAN messages.
~MCP2515Controller() override
Destroy the MCP2515Controller::MCP2515Controller object.
bool stopReadingFlag
Flag to indicate if the reading process should stop.
bool init() override
Initialize the MCP2515 controller.
bool ownsSPIController
Flag to indicate if the SPI controller is owned by the MCP2515Controller.
void stopReading() override
Stop reading CAN messages.
CANMessageProcessor & getMessageProcessor()
MCP2515Configurator configurator
MCP2515Configurator object.
CANMessageProcessor messageProcessor
CANMessageProcessor object.
void setupHandlers()
Send a CAN message.
MCP2515Controller(const std::string &spiDevice)
Construct a new MCP2515Controller::MCP2515Controller object.
ISPIController * spiController
Pointer to the ISPIController object.