59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
/*!\file
|
||
* \brief Файл содержит драйвер обработки микросхемы AD7685.
|
||
*/
|
||
/*
|
||
* ADS1259PulseModeAdcReader.h
|
||
*
|
||
* Created on: 25 авг. 2019 г.
|
||
* Author: user
|
||
*/
|
||
|
||
#ifndef SOURCE_DRIVER_CHIPSET_ADS1259PULSEMODEADCREADER_H_
|
||
#define SOURCE_DRIVER_CHIPSET_ADS1259PULSEMODEADCREADER_H_
|
||
|
||
#include "ADS1259.hh"
|
||
#include "PackagerADS1259.hh"
|
||
|
||
#include "../SpiPortRoutineOperation.hpp"
|
||
|
||
#include "../../common/Counter.hpp"
|
||
|
||
#include <memory_resource>
|
||
|
||
namespace driver { namespace chipset {
|
||
|
||
class ADS1259PulseModeAdcReader {
|
||
public:
|
||
typedef PackagerADS1259::AdcResultPackager AdcReaderPackager;
|
||
|
||
typedef SpiOperationPack< PackagerADS1259::Packager::Frame, Counter<uint16_t> > Operation;
|
||
typedef SpiOperationPack< PackagerADS1259::AdcResultPackager::Frame, Counter<uint16_t> > ReadAdcOperation;
|
||
|
||
public:
|
||
void process();
|
||
|
||
template<typename ResulType = uint32_t>
|
||
const ResulType & get_adc_code() const { return adc_code; }
|
||
|
||
ADS1259PulseModeAdcReader(Operation start_operation, ReadAdcOperation read_operation)
|
||
: adc_packager(), start_adc_operation(start_operation), read_adc_operation(read_operation),
|
||
start_conv(false), adc_code(0) {}
|
||
|
||
private:
|
||
|
||
AdcReaderPackager adc_packager;
|
||
ReadAdcOperation read_adc_operation;
|
||
|
||
Operation start_adc_operation;
|
||
bool start_conv;
|
||
|
||
bool read();
|
||
uint32_t adc_code;
|
||
|
||
};
|
||
|
||
} /* namespace chipset */
|
||
} /* namespace driver */
|
||
|
||
#endif /* SOURCE_DRIVER_CHIPSET_ADS1259PULSEMODEADCREADER_H_ */
|