μHAL
acq::Controller Class Reference

#include <acq.h>

Inheritance diagram for acq::Controller:
Collaboration diagram for acq::Controller:

Public Member Functions

 Controller (struct pcie_bars &)
 
acq_error start_acquisition ()
 
void stop_acquisition ()
 
template<class Data >
std::vector< Data > get_result ()
 
template<class Data >
std::vector< Data > result (std::optional< std::chrono::milliseconds > wait_time=std::nullopt)
 
acq_status get_acq_status ()
 
template<typename T >
void print_csv (FILE *f, std::vector< T > &res)
 
- Public Member Functions inherited from RegisterController
void set_devinfo (const struct sdb_device_info &) override
 
virtual void write_params ()
 
- Public Member Functions inherited from RegisterDecoderBase
void check_devinfo_is_set () const
 
virtual void set_devinfo (const struct sdb_device_info &)
 

Public Attributes

unsigned channel = 0
 
unsigned pre_samples = 4
 
unsigned post_samples = 0
 
unsigned number_shots = 1
 
std::string trigger_type = "now"
 
unsigned data_trigger_threshold = 0
 
bool data_trigger_polarity_neg = true
 
unsigned data_trigger_sel = 0
 
unsigned data_trigger_filt = 1
 
unsigned data_trigger_channel = 0
 
unsigned trigger_delay = 0
 
- Public Attributes inherited from RegisterDecoderBase
const device_match_fn match_devinfo_lambda
 

Private Types

enum class  acq_step { stop , started , done }
 

Private Member Functions

void get_internal_values ()
 
void encode_params () override
 
bool acquisition_ready ()
 
void set_devinfo_callback () override
 

Private Attributes

size_t ram_start_addr
 
size_t ram_end_addr
 
unsigned channel_atom_width
 
unsigned channel_num_atoms
 
unsigned sample_size
 
unsigned alignment
 
unsigned acq_pre_samples
 
unsigned acq_post_samples
 
std::unique_ptr< struct acq_core > regs_storage
 
struct acq_core & regs
 
enum acq::Controller::acq_step m_step = acq_step::stop
 

Additional Inherited Members

- Protected Member Functions inherited from RegisterController
 RegisterController (struct pcie_bars &bars, const struct sdb_device_info &)
 
virtual void set_devinfo_callback ()
 
virtual void encode_params ()=0
 
virtual void unset_commands ()
 
- Protected Member Functions inherited from RegisterDecoderBase
void set_read_dest (auto &dest)
 
 RegisterDecoderBase (struct pcie_bars &, const struct sdb_device_info &)
 
virtual void read ()
 
- Protected Attributes inherited from RegisterDecoderBase
size_t read_size
 
void * read_dest
 
struct pcie_barsbars
 
struct sdb_device_info devinfo
 
size_t addr
 

Detailed Description

For most users, the Core class isn't relevant, since it simply provides the current state of this core's registers, which doesn't reflect any hardware state beyond the acquisition state machine. This class is the relevant one, because it provides an interface to control an acquisition, and obtain its data.

It can also be used to control an acquisition asynchronously and safely, while still registering the configuration for the next acquisition.

Member Function Documentation

◆ encode_params()

void acq::Controller::encode_params ( )
overrideprivatevirtual

Child classes must implement this function to encode their configuration parameters into hardware registers

Implements RegisterController.

◆ get_acq_status()

acq_status acq::Controller::get_acq_status ( )

Get acquisition status. For asynchronous use

◆ set_devinfo_callback()

void acq::Controller::set_devinfo_callback ( )
overrideprivatevirtual

Child classes can implement this function to capture one-time values from hardware and perform any other necessary initialization

Reimplemented from RegisterController.


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