Zephyr C++ Toolkit
Loading...
Searching...
No Matches
zct::AdcMock Class Reference

#include <AdcMock.hpp>

Inheritance diagram for zct::AdcMock:
Collaboration diagram for zct::AdcMock:

Public Member Functions

 AdcMock (const char *name)
 
 ~AdcMock ()
 
int32_t readMv () override
 
void mockSetMv (int32_t mv)
 
- Public Member Functions inherited from zct::IAdc
 IAdc (const char *name)
 
 ~IAdc ()
 

Protected Attributes

int32_t m_mockMv = 0
 
- Protected Attributes inherited from zct::IAdc
const char * m_name
 

Constructor & Destructor Documentation

◆ AdcMock()

zct::AdcMock::AdcMock ( const char *  name)

◆ ~AdcMock()

zct::AdcMock::~AdcMock ( )

Member Function Documentation

◆ mockSetMv()

void zct::AdcMock::mockSetMv ( int32_t  mv)

Mock the analogue input voltage to the ADC. Calls to readMv() after this call will return this value.

Parameters
mvThe mock ADC reading in mV.

◆ readMv()

int32_t zct::AdcMock::readMv ( )
overridevirtual

Perform a single ADC conversion on the channel and return the result in mV.

Returns
The result of the ADC conversion in mV.

Implements zct::IAdc.

Member Data Documentation

◆ m_mockMv

int32_t zct::AdcMock::m_mockMv = 0
protected

The documentation for this class was generated from the following files: