20#ifndef MOCKSPICONTROLLER_HPP
21#define MOCKSPICONTROLLER_HPP
24#include <gmock/gmock.h>
44 (
const uint8_t *tx, uint8_t *rx,
size_t length), (
override));
Definition of the ISPIController interface.
Interface for the SPI controller.
virtual uint8_t readByte(uint8_t address)=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 void closeDevice()=0
virtual void spiTransfer(const uint8_t *tx, uint8_t *rx, size_t length)=0
virtual bool openDevice(const std::string &device)=0
Class to emulate the behavior of the SPI controller. (Overrided the Can0)
MOCK_METHOD(void, closeDevice,(),(override))
Mocked method to close 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(uint8_t, readByte,(uint8_t address),(override))
Mocked method to read a byte of data from 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(void, spiTransfer,(const uint8_t *tx, uint8_t *rx, size_t length),(override))
Mocked method to transfer data to the SPI device.
MOCK_METHOD(bool, openDevice,(const std::string &device),(override))
Mocked method to open the SPI device.