Scope
FPGAIO6587.h
1 #pragma once
2 
3 #include "helpers/FPGAException.h"
4 
5 // Forward declaration
6 typedef uint32_t NiFpga_Session;
7 
8 namespace scope {
9 
11 class FPGAIO6587 {
12 
13 protected:
16 
19 
22 
25 
27  const uint32_t clock_source_control;
28 
31 
33  const uint32_t commit_control;
34 
36  const uint32_t acquisition_reset_control;
37 
39  std::array<uint16_t, 9> regndata;
40 
44 
45 protected:
51  void ClockFrequencySetup(const double& _clock_freq);
52 
53 public:
62  FPGAIO6587(const uint32_t& _clock_ready
63  , const uint32_t& _clock_write_data
64  , const uint32_t& _clock_write
65  , const uint32_t& _xpoint_ready
66  , const uint32_t& _clock_source
67  , const uint32_t& _xpoint_write
68  , const uint32_t& _commit_control
69  , const uint32_t& _acquisition_reset_control);
70 
72  bool CheckIOModule(NiFpga_Session _session);
73 
78  void WriteOnboardClockFrequency(NiFpga_Session _session, const double& _clock_freq);
79 
89  void SetClockSource(NiFpga_Session _session, const uint8_t& _clock_source = 3);
90 
94  void InitializeAcquisition(NiFpga_Session _session);
95 };
96 
97 }
const uint32_t onboard_clock_write_control
the clock write control on the FPGA vi
Definition: FPGAIO6587.h:21
void WriteOnboardClockFrequency(NiFpga_Session _session, const double &_clock_freq)
Writes the program for the Si570 clock chip to the device.
Definition: FPGAIO6587.cpp:67
Handels the NI FlexRIO adapter module IO-6587.
Definition: FPGAIO6587.h:11
const uint32_t xpoint_switch_write_control
the xpoint switch write control on the FPGA vi
Definition: FPGAIO6587.h:30
bool CheckIOModule(NiFpga_Session _session)
Necessary calls at the moment not supported by NI FPGA API 12.0, see CheckIOModule.vi for what to do.
Definition: FPGAIO6587.cpp:27
const uint32_t xpoint_switch_ready_indicator
the xpoint switch ready indicator on the FPGA vi
Definition: FPGAIO6587.h:24
void ClockFrequencySetup(const double &_clock_freq)
Generates value for programming the Si570 clock chip.
Definition: FPGAIO6587.cpp:31
void InitializeAcquisition(NiFpga_Session _session)
Commits the clock frequency and clock source writings and resets the IO module acquisition circuit...
Definition: FPGAIO6587.cpp:116
const uint32_t acquisition_reset_control
the acquisition reset control on the FPGA vi
Definition: FPGAIO6587.h:36
std::array< uint16_t, 9 > regndata
register data for writing to the clock chip
Definition: FPGAIO6587.h:39
const uint32_t clock_source_control
the clocksource control on the FPGA vi
Definition: FPGAIO6587.h:27
const uint32_t commit_control
the commit control on the FPGA vi
Definition: FPGAIO6587.h:33
const uint32_t onboard_clock_write_data_control
the clock write data control on the FPGA vi
Definition: FPGAIO6587.h:18
FPGAIO6587(const uint32_t &_clock_ready, const uint32_t &_clock_write_data, const uint32_t &_clock_write, const uint32_t &_xpoint_ready, const uint32_t &_clock_source, const uint32_t &_xpoint_write, const uint32_t &_commit_control, const uint32_t &_acquisition_reset_control)
Definition: FPGAIO6587.cpp:8
void SetClockSource(NiFpga_Session _session, const uint8_t &_clock_source=3)
Possible clock sources (see SetClockSource.vi from NI examples) .
Definition: FPGAIO6587.cpp:93
FPGAStatusSafe iostatus
Current status of the module.
Definition: FPGAIO6587.h:43
const uint32_t onboard_clock_ready_indicator
the clock ready indicator on the FPGA vi
Definition: FPGAIO6587.h:15