-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Leka - LekaOS | ||
// Copyright 2022 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "array" | ||
|
||
namespace leka::interface { | ||
|
||
class DACTouch | ||
{ | ||
public: | ||
virtual ~DACTouch() = default; | ||
virtual void writeToAllInputRegister(std::array<uint8_t, 2> value) = 0; | ||
virtual void writeToSpecificInputRegister(uint8_t channel, std::array<uint8_t, 2> value) = 0; | ||
virtual void writeToMemoryRegisterUntilChannelD(uint8_t starting_channel, std::array<uint8_t, 2> value) = 0; | ||
virtual void writeToSpecificMemoryRegister(uint8_t channel, std::array<uint8_t, 2> value) = 0; | ||
|
||
virtual void writeVoltageReference(uint8_t voltageReference) = 0; | ||
virtual void writePowerMode(uint8_t powerMode) = 0; | ||
virtual void writeGain(uint8_t gain) = 0; | ||
|
||
virtual void readMemory(std::array<uint8_t, 24> &value) = 0; | ||
}; | ||
|
||
} // namespace leka::interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Leka - LekaOS | ||
// Copyright 2022 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "CoreBufferedSerial.h" | ||
#include "gmock/gmock.h" | ||
|
||
namespace leka { | ||
|
||
class CoreDACTouchMock : public interface::DACTouch | ||
{ | ||
public: | ||
MOCK_METHOD(void, setVoltageReference, (uint8_t), (override)); | ||
MOCK_METHOD(void, setPowerMode, (uint8_t), (override)); | ||
MOCK_METHOD(void, setGain, (uint8_t), (override)); | ||
|
||
MOCK_METHOD(void, writeToAllInputRegister, (std::array<uint8_t, 2>), (override)); | ||
MOCK_METHOD(void, writeToSpecificInputRegister, (uint8_t, std::array<uint8_t, 2>), (override)); | ||
|
||
MOCK_METHOD(void, writeToMemoryRegisterUntilChannelD, (uint8_t, std::array<uint8_t, 2>), (override)); | ||
MOCK_METHOD(void, writeToSpecificMemoryRegister, (uint8_t, std::array<uint8_t, 2>), (override)); | ||
|
||
MOCK_METHOD(void, readMemory, (std::array<uint8_t, 24> &), (override)); | ||
}; | ||
|
||
} // namespace leka |