EoWo Datasource running
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
@@ -15,8 +15,8 @@ app = pg.mkQApp("Plotting MARTe2 AtcaIop Data")
|
|||||||
#mw = QtWidgets.QMainWindow()
|
#mw = QtWidgets.QMainWindow()
|
||||||
#mw.resize(800,800)
|
#mw.resize(800,800)
|
||||||
|
|
||||||
MAX_SAMPLES = 50000
|
#MAX_SAMPLES = 50000
|
||||||
ADC_CHANNELS = 4
|
#ADC_CHANNELS = 4
|
||||||
DECIM_RATE = 200
|
DECIM_RATE = 200
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description = 'Script to support the QA activities')
|
parser = argparse.ArgumentParser(description = 'Script to support the QA activities')
|
||||||
@@ -27,7 +27,7 @@ parser.add_argument('-c', '--crange', nargs='+',type=int, help='Channel plots (1
|
|||||||
parser.add_argument('-i', '--irange', nargs='+',type=int,default=[1, 12])
|
parser.add_argument('-i', '--irange', nargs='+',type=int,default=[1, 12])
|
||||||
#parser.add_argument('pulse','-', nargs='+', help='<Required> Set flag', required=True)
|
#parser.add_argument('pulse','-', nargs='+', help='<Required> Set flag', required=True)
|
||||||
parser.add_argument('-s', '--shot', type=int, help='Mds+ pulse Number ([1, ...])', default=100)
|
parser.add_argument('-s', '--shot', type=int, help='Mds+ pulse Number ([1, ...])', default=100)
|
||||||
parser.add_argument('-m', '--maxsamples', type=int, help='Max samples to plot', default=50000)
|
parser.add_argument('-m', '--maxpoints', type=int, help='Max points to plot', default=50000)
|
||||||
parser.add_argument('-z', '--zero', action='store_true',help='Zero integral Lines') #, default='')
|
parser.add_argument('-z', '--zero', action='store_true',help='Zero integral Lines') #, default='')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@@ -60,8 +60,7 @@ for i in range(start, stop):
|
|||||||
mdsNode = tree.getNode(f"ATCAIOP1.ADC{i}RAW")
|
mdsNode = tree.getNode(f"ATCAIOP1.ADC{i}RAW")
|
||||||
dataAdc = mdsNode.getData().data()
|
dataAdc = mdsNode.getData().data()
|
||||||
timeData = mdsNode.getDimensionAt(0).data()
|
timeData = mdsNode.getDimensionAt(0).data()
|
||||||
#y = dataAdc[ :args.maxsamples, 0]
|
y = dataAdc[ :args.maxpoints, 0]
|
||||||
y = dataAdc[ :MAX_SAMPLES, 0]
|
|
||||||
x = DECIM_RATE * np.arange(len(y)) / 2.0e6
|
x = DECIM_RATE * np.arange(len(y)) / 2.0e6
|
||||||
p1.plot(x,y, pen=pg.mkPen(i, width=2), name=f"Ch {i+1}")
|
p1.plot(x,y, pen=pg.mkPen(i, width=2), name=f"Ch {i+1}")
|
||||||
#p1.setLabel('bottom', "Y Axis", units='s')
|
#p1.setLabel('bottom', "Y Axis", units='s')
|
||||||
@@ -79,7 +78,7 @@ for i in range(start, stop):
|
|||||||
dataAdcInt = mdsNode.getData().data()
|
dataAdcInt = mdsNode.getData().data()
|
||||||
timeData = mdsNode.getDimensionAt(0).data()
|
timeData = mdsNode.getDimensionAt(0).data()
|
||||||
total_samples = DECIM_RATE * len(dataAdcInt[:, 0])
|
total_samples = DECIM_RATE * len(dataAdcInt[:, 0])
|
||||||
y = dataAdcInt[ :args.maxsamples, 0] / 2.0e6 # LSB * sec
|
y = dataAdcInt[ :args.maxpoints, 0] / 2.0e6 # LSB * sec
|
||||||
if(args.zero):
|
if(args.zero):
|
||||||
y = y - dataAdcInt[0, 0] / 2.0e6 # LSB * sec
|
y = y - dataAdcInt[0, 0] / 2.0e6 # LSB * sec
|
||||||
wo = (dataAdcInt[-1, 0] - dataAdcInt[0, 0]) /total_samples
|
wo = (dataAdcInt[-1, 0] - dataAdcInt[0, 0]) /total_samples
|
||||||
@@ -96,5 +95,10 @@ p4.setLabel('bottom', "Time", units='s')
|
|||||||
#updatePlot()
|
#updatePlot()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
pg.exec()
|
import sys
|
||||||
|
if sys.flags.interactive != 1 or not hasattr(QtCore, 'PYQT_VERSION'):
|
||||||
|
pg.QtGui.QApplication.exec_()
|
||||||
|
|
||||||
|
#iprint("xwc")
|
||||||
|
#pg.exec()
|
||||||
# vim: syntax=python ts=4 sw=4 sts=4 sr et
|
# vim: syntax=python ts=4 sw=4 sts=4 sr et
|
||||||
|
|||||||
2
Configurations/README.md
Normal file
2
Configurations/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Replace lines with sed
|
||||||
|
`sed -i "s/BoardId =.*/BoardId = 9/g" RTApp-AtcaIop-ppr9.cfg`
|
||||||
@@ -563,6 +563,36 @@ $IsttokApp = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
+AtcaGAMEoWoOutput = {
|
||||||
|
Class = "IOGAM"
|
||||||
|
InputSignals = {
|
||||||
|
EoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "int32"
|
||||||
|
}
|
||||||
|
WoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "float32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OutputSignals = {
|
||||||
|
EO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
Type = int32
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Trigger = 1
|
||||||
|
}
|
||||||
|
WO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = float32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+GAMConvert2Volt = {
|
+GAMConvert2Volt = {
|
||||||
Class = "ConversionGAM"
|
Class = "ConversionGAM"
|
||||||
InputSignals = {
|
InputSignals = {
|
||||||
@@ -1129,10 +1159,25 @@ $IsttokApp = {
|
|||||||
+Timings = {
|
+Timings = {
|
||||||
Class = "TimingDataSource"
|
Class = "TimingDataSource"
|
||||||
}
|
}
|
||||||
|
+AtcaIopConfigEoWo_2 = {
|
||||||
|
Class = AtcaIop::AtcaIopConfigEoWo
|
||||||
|
//CPUMask = "0xC"
|
||||||
|
DeviceName = "/dev/atca_v6"
|
||||||
|
BoardId = 2 //Mandatory
|
||||||
|
Signals = {
|
||||||
|
EO = {
|
||||||
|
Type = int32 //Mandatory. Only type that is supported.
|
||||||
|
}
|
||||||
|
WO = {
|
||||||
|
Type = float32 //Mandatory. Only type that is supported.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+AtcaIop_0_DAC = {
|
+AtcaIop_0_DAC = {
|
||||||
Class = "AtcaIop::AtcaIopDAC"
|
Class = "AtcaIop::AtcaIopDAC"
|
||||||
//CPUMask = "0xC"
|
//CPUMask = "0xC"
|
||||||
DeviceName = "/dev/atca_v6_dac_9"
|
DeviceName = "/dev/atca_v6"
|
||||||
|
BoardId = 2 //Mandatory
|
||||||
//NumberOfChannels = 2
|
//NumberOfChannels = 2
|
||||||
Signals = {
|
Signals = {
|
||||||
DAC0 = {
|
DAC0 = {
|
||||||
@@ -1149,12 +1194,13 @@ $IsttokApp = {
|
|||||||
+AtcaIop_0_ADC = {
|
+AtcaIop_0_ADC = {
|
||||||
Class = "AtcaIop::AtcaIopADC"
|
Class = "AtcaIop::AtcaIopADC"
|
||||||
CPUMask = "0xC"
|
CPUMask = "0xC"
|
||||||
DeviceName = "/dev/atca_v6_9"
|
DeviceName = "/dev/atca_v6"
|
||||||
DeviceDmaName = "/dev/atca_v6_dmart_9"
|
BoardId = 2 //Mandatory
|
||||||
|
DeviceDmaName = "/dev/atca_v6_dmart_2"
|
||||||
NumberOfChannels = "12"
|
NumberOfChannels = "12"
|
||||||
IsMaster = "1"
|
IsMaster = "1"
|
||||||
SleepNature = "Busy"
|
SleepNature = "Busy"
|
||||||
SleepPercentage = "0"
|
SleepPercentage = "20"
|
||||||
ADCFrequency = "2000000"
|
ADCFrequency = "2000000"
|
||||||
RTDecimation = "200"
|
RTDecimation = "200"
|
||||||
ChopperPeriod = "2000"
|
ChopperPeriod = "2000"
|
||||||
@@ -1227,6 +1273,66 @@ $IsttokApp = {
|
|||||||
}
|
}
|
||||||
ADC6Integral = {
|
ADC6Integral = {
|
||||||
Type = "int64"
|
Type = "int64"
|
||||||
|
+AtcaGAMEoWoOutput = {
|
||||||
|
Class = "IOGAM"
|
||||||
|
InputSignals = {
|
||||||
|
EoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "int32"
|
||||||
|
+AtcaGAMEoWoOutput = {
|
||||||
|
Class = "IOGAM"
|
||||||
|
InputSignals = {
|
||||||
|
EoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "int32"
|
||||||
|
}
|
||||||
|
WoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "float32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OutputSignals = {
|
||||||
|
EO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
Type = int32
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Trigger = 1
|
||||||
|
}
|
||||||
|
WO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = float32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WoArr = {
|
||||||
|
DataSource = "DDB1"
|
||||||
|
NumberOfDimensions = "1"
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = "float32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OutputSignals = {
|
||||||
|
EO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
Type = int32
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Trigger = 1
|
||||||
|
}
|
||||||
|
WO = {
|
||||||
|
DataSource = AtcaIopConfigEoWo_2
|
||||||
|
NumberOfElements = "16"
|
||||||
|
Type = float32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ADC7Integral = {
|
ADC7Integral = {
|
||||||
Type = "int64"
|
Type = "int64"
|
||||||
@@ -1547,7 +1653,8 @@ $IsttokApp = {
|
|||||||
+Thread1 = {
|
+Thread1 = {
|
||||||
Class = "RealTimeThread"
|
Class = "RealTimeThread"
|
||||||
CPUs = "0x4"
|
CPUs = "0x4"
|
||||||
Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput"}
|
//Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput"}
|
||||||
|
Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "AtcaGAMEoWoOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput" "GAMCAInput"}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "AtcaIopADC.h"
|
#include "AtcaIopADC.h"
|
||||||
#include "atca-v6-iop-ioctl.h"
|
#include "atca-v6-iop-ioctl.h"
|
||||||
|
|
||||||
|
#define DEBUG_POLL 1
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* Static definitions */
|
/* Static definitions */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
@@ -77,9 +78,9 @@ struct atca_wo_config {
|
|||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
AtcaIopADC::AtcaIopADC() :
|
AtcaIopADC::AtcaIopADC() :
|
||||||
DataSourceI(), MessageI(), EmbeddedServiceMethodBinderI(), executor(*this) {
|
DataSourceI(), MessageI(), EmbeddedServiceMethodBinderI(), executor(*this) {
|
||||||
//boardId = 2u;
|
|
||||||
deviceName = "";
|
deviceName = "";
|
||||||
deviceDmaName = "";
|
boardId = 2u;
|
||||||
|
//deviceDmaName = "";
|
||||||
boardFileDescriptor = -1;
|
boardFileDescriptor = -1;
|
||||||
boardDmaDescriptor = -1;
|
boardDmaDescriptor = -1;
|
||||||
mappedDmaBase = NULL;
|
mappedDmaBase = NULL;
|
||||||
@@ -93,6 +94,8 @@ AtcaIopADC::AtcaIopADC() :
|
|||||||
counterAndTimer[1] = 0u;
|
counterAndTimer[1] = 0u;
|
||||||
sleepNature = Busy;
|
sleepNature = Busy;
|
||||||
sleepPercentage = 0u;
|
sleepPercentage = 0u;
|
||||||
|
execCounter = 0u;
|
||||||
|
pollTimout = 0u;
|
||||||
adcPeriod = 0.;
|
adcPeriod = 0.;
|
||||||
uint32 k;
|
uint32 k;
|
||||||
for (k=0u; k<ATCA_IOP_N_ADCs; k++) {
|
for (k=0u; k<ATCA_IOP_N_ADCs; k++) {
|
||||||
@@ -153,12 +156,20 @@ bool AtcaIopADC::Initialise(StructuredDataI& data) {
|
|||||||
REPORT_ERROR(ErrorManagement::ParametersError, "The DeviceName shall be specified");
|
REPORT_ERROR(ErrorManagement::ParametersError, "The DeviceName shall be specified");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ok) {
|
||||||
|
ok = data.Read("BoardId", boardId);
|
||||||
|
if (!ok) {
|
||||||
|
REPORT_ERROR(ErrorManagement::ParametersError, "The BoardId shall be specified");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = data.Read("DeviceDmaName", deviceDmaName);
|
ok = data.Read("DeviceDmaName", deviceDmaName);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
REPORT_ERROR(ErrorManagement::ParametersError, "The DeviceDmaName shall be specified");
|
REPORT_ERROR(ErrorManagement::ParametersError, "The DeviceDmaName shall be specified");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = data.Read("NumberOfChannels", numberOfChannels);
|
ok = data.Read("NumberOfChannels", numberOfChannels);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
@@ -343,7 +354,8 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
|
|||||||
StreamString fullDeviceName;
|
StreamString fullDeviceName;
|
||||||
//Configure the board
|
//Configure the board
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Printf("%s", deviceName.Buffer());
|
ok = fullDeviceName.Printf("%s_%d", deviceName.Buffer(), boardId);
|
||||||
|
//ok = fullDeviceName.Printf("%s", deviceName.Buffer());
|
||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Seek(0LLU);
|
ok = fullDeviceName.Seek(0LLU);
|
||||||
@@ -359,7 +371,8 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
|
|||||||
}
|
}
|
||||||
ok = fullDeviceName.Seek(0LLU);
|
ok = fullDeviceName.Seek(0LLU);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Printf("%s", deviceDmaName.Buffer());
|
ok = fullDeviceName.Printf("%s_dmart_%d", deviceName.Buffer(), boardId);
|
||||||
|
//ok = fullDeviceName.Printf("%s", deviceName.Buffer());
|
||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Seek(0LLU);
|
ok = fullDeviceName.Seek(0LLU);
|
||||||
@@ -538,6 +551,10 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
|
|||||||
timerPeriodUsecTime = static_cast<uint32>(periodUsec);
|
timerPeriodUsecTime = static_cast<uint32>(periodUsec);
|
||||||
float64 sleepTimeT = (static_cast<float64>(HighResolutionTimer::Frequency()) / cycleFrequency);
|
float64 sleepTimeT = (static_cast<float64>(HighResolutionTimer::Frequency()) / cycleFrequency);
|
||||||
sleepTimeTicks = static_cast<uint64>(sleepTimeT);
|
sleepTimeTicks = static_cast<uint64>(sleepTimeT);
|
||||||
|
/*
|
||||||
|
* [Information - AtcaIopADC.cpp:548]: The timer will be set using a cycle frequency of 10000.000000 Hz
|
||||||
|
* [Information - AtcaIopADC.cpp:554]: The timer will be set using a sleepTimeTicks of 100000 (ns)
|
||||||
|
*/
|
||||||
REPORT_ERROR(ErrorManagement::Information,
|
REPORT_ERROR(ErrorManagement::Information,
|
||||||
"The timer will be set using a sleepTimeTicks of %d (ns)", sleepTimeTicks);
|
"The timer will be set using a sleepTimeTicks of %d (ns)", sleepTimeTicks);
|
||||||
}
|
}
|
||||||
@@ -613,6 +630,9 @@ bool AtcaIopADC::PrepareNextState(const char8* const currentStateName, const cha
|
|||||||
ok = executor.Start();
|
ok = executor.Start();
|
||||||
REPORT_ERROR(ErrorManagement::Information, "Executor Start");
|
REPORT_ERROR(ErrorManagement::Information, "Executor Start");
|
||||||
}
|
}
|
||||||
|
if (executor.GetStatus() == EmbeddedThreadI::RunningState) {
|
||||||
|
REPORT_ERROR(ErrorManagement::Information, " ADC currentStateName %s, nextStateName %s", currentStateName, nextStateName);
|
||||||
|
}
|
||||||
counterAndTimer[0] = 0u;
|
counterAndTimer[0] = 0u;
|
||||||
//counterAndTimer[1] = 0u;
|
//counterAndTimer[1] = 0u;
|
||||||
return ok;
|
return ok;
|
||||||
@@ -638,19 +658,32 @@ ErrorManagement::ErrorType AtcaIopADC::Execute(ExecutionInfo& info) {
|
|||||||
uint64 deltaTicks = sleepTimeTicks - sleepTicksCorrection;
|
uint64 deltaTicks = sleepTimeTicks - sleepTicksCorrection;
|
||||||
//volatile int32 currentDMA = 0u;
|
//volatile int32 currentDMA = 0u;
|
||||||
oldestBufferIdx = GetOldestBufferIdx();
|
oldestBufferIdx = GetOldestBufferIdx();
|
||||||
|
float32 totalSleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
|
||||||
|
#ifdef DEBUG_POLL
|
||||||
|
if((execCounter++)%4096 == 0) {
|
||||||
|
REPORT_ERROR(ErrorManagement::Information, "Executor sleepTime: %f pollTimout: %d", totalSleepTime, pollTimout);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (sleepNature == Busy) {
|
if (sleepNature == Busy) {
|
||||||
if (sleepPercentage == 0u) {
|
if (sleepPercentage > 0u) {
|
||||||
|
//float32 sleepTime = totalSleepTime * 0.5;
|
||||||
|
float32 sleepTime = totalSleepTime * (static_cast<float32>(sleepPercentage) / 100.F);
|
||||||
|
Sleep::NoMore(sleepTime);
|
||||||
//currentDMA =
|
//currentDMA =
|
||||||
PollDma(startTicks + deltaTicks + 100000u); // TODO check max wait
|
//if(PollDma(startTicks + deltaTicks + 100000u) < 0)
|
||||||
//while ((HighResolutionTimer::Counter() - startTicks) < deltaTicks) {
|
//while ((HighResolutionTimer::Counter() - startTicks) < deltaTicks) {
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
if(PollDma(startTicks + deltaTicks + sleepTimeTicks + 10000u) < 0)
|
||||||
|
pollTimout++; // TODO check max wait
|
||||||
|
/*
|
||||||
else {
|
else {
|
||||||
float32 totalSleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
|
float32 totalSleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
|
||||||
uint32 busyPercentage = (100u - sleepPercentage);
|
uint32 busyPercentage = (100u - sleepPercentage);
|
||||||
float32 busyTime = totalSleepTime * (static_cast<float32>(busyPercentage) / 100.F);
|
float32 busyTime = totalSleepTime * (static_cast<float32>(busyPercentage) / 100.F);
|
||||||
Sleep::SemiBusy(totalSleepTime, busyTime);
|
Sleep::SemiBusy(totalSleepTime, busyTime);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float32 sleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
|
float32 sleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
|
||||||
@@ -691,6 +724,9 @@ uint32 AtcaIopADC::GetStackSize() const {
|
|||||||
uint32 AtcaIopADC::GetSleepPercentage() const {
|
uint32 AtcaIopADC::GetSleepPercentage() const {
|
||||||
return sleepPercentage;
|
return sleepPercentage;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* waitLimitTicks in ns
|
||||||
|
* */
|
||||||
|
|
||||||
int32 AtcaIopADC::PollDma(uint64 waitLimitTicks) const {
|
int32 AtcaIopADC::PollDma(uint64 waitLimitTicks) const {
|
||||||
uint32 buffIdx = oldestBufferIdx;
|
uint32 buffIdx = oldestBufferIdx;
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace MARTe {
|
|||||||
/**
|
/**
|
||||||
* The board identifier
|
* The board identifier
|
||||||
*/
|
*/
|
||||||
//uint32 boardId;
|
uint32 boardId;
|
||||||
/**
|
/**
|
||||||
* The numberOfChannels
|
* The numberOfChannels
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +264,7 @@ namespace MARTe {
|
|||||||
/**
|
/**
|
||||||
* The board device name
|
* The board device name
|
||||||
*/
|
*/
|
||||||
StreamString deviceDmaName;
|
//StreamString deviceDmaName;
|
||||||
/**
|
/**
|
||||||
* The board file descriptor
|
* The board file descriptor
|
||||||
*/
|
*/
|
||||||
@@ -294,6 +294,12 @@ namespace MARTe {
|
|||||||
*/
|
*/
|
||||||
AtcaIopADCSleepNature sleepNature;
|
AtcaIopADCSleepNature sleepNature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debugging
|
||||||
|
*/
|
||||||
|
uint32 execCounter;
|
||||||
|
uint32 pollTimout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current counter and timer
|
* Current counter and timer
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ namespace MARTe {
|
|||||||
AtcaIopConfigEoWo::~AtcaIopConfigEoWo() {
|
AtcaIopConfigEoWo::~AtcaIopConfigEoWo() {
|
||||||
if (boardFileDescriptor != -1) {
|
if (boardFileDescriptor != -1) {
|
||||||
uint32 statusReg = 0;
|
uint32 statusReg = 0;
|
||||||
//REPORT_ERROR(ErrorManagement::Information, " Close Device Status Reg %d, 0x%x", rc, statusReg);
|
|
||||||
close(boardFileDescriptor);
|
close(boardFileDescriptor);
|
||||||
REPORT_ERROR(ErrorManagement::Information, "Close device %d OK. Status Reg 0x%x,", boardFileDescriptor, statusReg);
|
REPORT_ERROR(ErrorManagement::Information, "Close device %d OK. Status Reg 0x%x,", boardFileDescriptor, statusReg);
|
||||||
}
|
}
|
||||||
@@ -206,6 +205,9 @@ namespace MARTe {
|
|||||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: the counter and the timer are always reset irrespectively of the states being changed.*/
|
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: the counter and the timer are always reset irrespectively of the states being changed.*/
|
||||||
bool AtcaIopConfigEoWo::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) {
|
bool AtcaIopConfigEoWo::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) {
|
||||||
REPORT_ERROR(ErrorManagement::Information, " EoWo currentStateName %s, nextStateName %s", currentStateName, nextStateName);
|
REPORT_ERROR(ErrorManagement::Information, " EoWo currentStateName %s, nextStateName %s", currentStateName, nextStateName);
|
||||||
|
//if (currentStateName == "Idle") {
|
||||||
|
// REPORT_ERROR(ErrorManagement::Information, "OffState");
|
||||||
|
//}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,7 +353,6 @@ namespace MARTe {
|
|||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
//Allocate memory
|
//Allocate memory
|
||||||
//channelsMemory = new float32[ATCA_IOP_MAX_DAC_CHANNELS];
|
|
||||||
eoValues = new int32[ATCA_IOP_MAX_ADC_CHANNELS];
|
eoValues = new int32[ATCA_IOP_MAX_ADC_CHANNELS];
|
||||||
woValues = new float32[ATCA_IOP_MAX_ADC_CHANNELS];
|
woValues = new float32[ATCA_IOP_MAX_ADC_CHANNELS];
|
||||||
}
|
}
|
||||||
@@ -362,11 +363,15 @@ namespace MARTe {
|
|||||||
|
|
||||||
bool AtcaIopConfigEoWo::Synchronise() {
|
bool AtcaIopConfigEoWo::Synchronise() {
|
||||||
uint32 i;
|
uint32 i;
|
||||||
int32 w;
|
int32 w = 1;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
#ifdef DEBUG_POLL
|
||||||
if((synchCounter++)%4096 == 0) {
|
if((synchCounter++)%4096 == 0) {
|
||||||
REPORT_ERROR(ErrorManagement::Information, " Synchronise");
|
//i = (synchCounter/4096) & 0xF;
|
||||||
|
REPORT_ERROR(ErrorManagement::Information, "Synchronise eo0:%d wo0%0.3f", eoValues[0], woValues[0]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
//write(boardFileDescriptor, &w, 4);
|
||||||
/*
|
/*
|
||||||
if (channelsMemory != NULL_PTR(float32 *)) {
|
if (channelsMemory != NULL_PTR(float32 *)) {
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ namespace MARTe {
|
|||||||
numberOfDACsEnabled = 0u;
|
numberOfDACsEnabled = 0u;
|
||||||
//isMaster = 0u;
|
//isMaster = 0u;
|
||||||
deviceName = "";
|
deviceName = "";
|
||||||
|
boardId = 2u;
|
||||||
triggerSet = false;
|
triggerSet = false;
|
||||||
uint32 n;
|
uint32 n;
|
||||||
for (n = 0u; n < ATCA_IOP_MAX_DAC_CHANNELS; n++) {
|
for (n = 0u; n < ATCA_IOP_MAX_DAC_CHANNELS; n++) {
|
||||||
@@ -198,6 +199,12 @@ namespace MARTe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
|
ok = data.Read("BoardId", boardId);
|
||||||
|
if (!ok) {
|
||||||
|
REPORT_ERROR(ErrorManagement::ParametersError, "The BoardId shall be specified");
|
||||||
|
}
|
||||||
|
}
|
||||||
//if (!data.Read("IsMaster", isMaster)) {
|
//if (!data.Read("IsMaster", isMaster)) {
|
||||||
// REPORT_ERROR(ErrorManagement::Warning, "IsMaster not specified. Using default: %d", isMaster);
|
// REPORT_ERROR(ErrorManagement::Warning, "IsMaster not specified. Using default: %d", isMaster);
|
||||||
//}
|
//}
|
||||||
@@ -303,7 +310,8 @@ namespace MARTe {
|
|||||||
StreamString fullDeviceName;
|
StreamString fullDeviceName;
|
||||||
//Configure the board
|
//Configure the board
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Printf("%s", deviceName.Buffer());
|
ok = fullDeviceName.Printf("%s_dac_%d", deviceName.Buffer(), boardId);
|
||||||
|
//ok = fullDeviceName.Printf("%s", deviceName.Buffer());
|
||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = fullDeviceName.Seek(0LLU);
|
ok = fullDeviceName.Seek(0LLU);
|
||||||
|
|||||||
@@ -182,6 +182,10 @@ namespace MARTe {
|
|||||||
* The board device name
|
* The board device name
|
||||||
*/
|
*/
|
||||||
StreamString deviceName;
|
StreamString deviceName;
|
||||||
|
/**
|
||||||
|
* The board identifier
|
||||||
|
*/
|
||||||
|
uint32 boardId;
|
||||||
/**
|
/**
|
||||||
* The board file descriptor
|
* The board file descriptor
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user