HardFOC Core
API reference
Loading...
Searching...
No Matches
Classes | Namespaces
MockAdc.h File Reference

Scriptable BaseAdc fake for host tests. More...

#include "base/BaseAdc.h"
#include <array>
#include <cstdint>
#include <deque>
#include <vector>

Go to the source code of this file.

Classes

class  hf::host::MockAdc
 
struct  hf::host::MockAdc::Channel
 

Namespaces

namespace  hf
 
namespace  hf::host
 

Detailed Description

Scriptable BaseAdc fake for host tests.

Each channel holds a voltage and a raw count, set independently. When only a voltage is set, the count is derived from the reference voltage and the resolution given at construction (and the other way round). A queued sequence (QueueVoltages) is returned one value per read before falling back to the fixed value. Reads of a channel at or above GetMaxChannels() return ADC_ERR_INVALID_CHANNEL; FailChannel() makes a channel return an error.