Class to emulate the behavior of the SPI controller. (Overrided the Can0) More...
#include <MockSPIController.hpp>
Public Member Functions | |
MOCK_METHOD (bool, openDevice,(const std::string &device),(override)) | |
Mocked method to open the SPI device. | |
MOCK_METHOD (void, configure,(uint8_t mode, uint8_t bits, uint32_t speed),(override)) | |
Mocked method to configure the SPI device. | |
MOCK_METHOD (void, writeByte,(uint8_t address, uint8_t data),(override)) | |
Mocked method to write a byte of data to the SPI device. | |
MOCK_METHOD (uint8_t, readByte,(uint8_t address),(override)) | |
Mocked method to read a byte of data from the SPI device. | |
MOCK_METHOD (void, spiTransfer,(const uint8_t *tx, uint8_t *rx, size_t length),(override)) | |
Mocked method to transfer data to the SPI device. | |
MOCK_METHOD (void, closeDevice,(),(override)) | |
Mocked method to close the SPI device. | |
![]() | |
virtual | ~ISPIController ()=default |
virtual bool | openDevice (const std::string &device)=0 |
virtual void | configure (uint8_t mode, uint8_t bits, uint32_t speed)=0 |
virtual void | writeByte (uint8_t address, uint8_t data)=0 |
virtual uint8_t | readByte (uint8_t address)=0 |
virtual void | spiTransfer (const uint8_t *tx, uint8_t *rx, size_t length)=0 |
virtual void | closeDevice ()=0 |
Class to emulate the behavior of the SPI controller. (Overrided the Can0)
Definition at line 31 of file MockSPIController.hpp.
MockSPIController::MOCK_METHOD | ( | bool | , |
openDevice | , | ||
(const std::string &device) | , | ||
(override) | ) |
Mocked method to open the SPI device.
MockSPIController::MOCK_METHOD | ( | uint8_t | , |
readByte | , | ||
(uint8_t address) | , | ||
(override) | ) |
Mocked method to read a byte of data from the SPI device.
MockSPIController::MOCK_METHOD | ( | void | , |
closeDevice | , | ||
() | , | ||
(override) | ) |
Mocked method to close the SPI device.
MockSPIController::MOCK_METHOD | ( | void | , |
configure | , | ||
(uint8_t mode, uint8_t bits, uint32_t speed) | , | ||
(override) | ) |
Mocked method to configure the SPI device.
MockSPIController::MOCK_METHOD | ( | void | , |
spiTransfer | , | ||
(const uint8_t *tx, uint8_t *rx, size_t length) | , | ||
(override) | ) |
Mocked method to transfer data to the SPI device.
MockSPIController::MOCK_METHOD | ( | void | , |
writeByte | , | ||
(uint8_t address, uint8_t data) | , | ||
(override) | ) |
Mocked method to write a byte of data to the SPI device.