266 std::stringstream ss;
268 TLOG() <<
"DeviceInterface: trying to connect to " << boost::asio::ip::address_v4(
fDeviceId).to_string();
286 unsigned int pdts_status = 0;
287 unsigned int pdts_control = 0;
288 unsigned int dsp_clock_control = 0;
291 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec << std::endl;
293 TLOG() <<
"The pdts_control read back as 0x" << std::hex << pdts_control << std::dec << std::endl;
295 TLOG() <<
"The dsp_clock_control read back as 0x" << std::hex << dsp_clock_control << std::dec << std::endl;
297 unsigned int presentTimingAddress = (pdts_control >> 16) & 0xFF;
298 unsigned int presentTimingPartition = pdts_control & 0x3;
300 TLOG() <<
"SSP HW presently on partition " << presentTimingPartition <<
", address 0x" << std::hex
301 << presentTimingAddress <<
" with endpoint status 0x" << (pdts_status & 0xF)
302 <<
" and dsp_clock_control at 0x" << dsp_clock_control << std::dec << std::endl;
306 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8 && presentTimingAddress ==
fTimingAddress &&
307 presentTimingPartition ==
fPartitionNumber && (dsp_clock_control & 0xF) == 0x1) {
310 TLOG() <<
"Clock already looks ok... skipping endpoint reset." << std::endl;
313 TLOG() <<
"Syncing SSP LED Calib to PDTS (partition " <<
fPartitionNumber <<
", endpoint address 0x"
316 unsigned int nTries = 0;
320 TLOG() <<
"The dsp_clock_control was set to 0x" << std::hex << 0x30 << std::dec
324 << std::dec << std::endl;
327 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec
330 TLOG() <<
"The pdts_control read back as 0x" << std::hex << pdts_control << std::dec
333 TLOG() <<
"The dsp_clock_control read back as 0x" << std::hex << dsp_clock_control << std::dec
337 TLOG() <<
"The pdts_status value was set to 0x" << std::hex
342 TLOG() <<
"The dsp_clock_control was set to 0x" << std::hex << 0x31 << std::dec << std::endl;
345 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec
347 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8)
349 TLOG() <<
"Timing endpoint sync failed (try " << nTries <<
")" << std::endl;
353 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8) {
354 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status
355 <<
" and the 0xF bit masked value is 0x" << (pdts_status & 0xF) << std::dec
357 TLOG() <<
"Timing endpoint synced!" << std::endl;
359 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status
360 <<
" and the 0xF bit masked value is 0x" << (pdts_status & 0xF) << std::dec
362 TLOG() <<
"Giving up on endpoint sync after 5 tries. Value of pdts_status register was 0x"
363 << std::hex << pdts_status << std::dec << std::endl;
367 TLOG() <<
"Woke up from 2 seconds of sleep and Waiting for endpoint to reach status 0x8..."
370 if ((pdts_status & 0xF) != 0x8) {
371 TLOG() <<
"Waiting for endpoint to reach status 0x8..." << std::endl;
372 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status
373 <<
" and the 0xF bit masked value is 0x" << (pdts_status & 0xF) << std::dec << std::endl;
376 while ((pdts_status & 0xF) != 0x8) {
378 TLOG() <<
"Wrong PDTS status!" << std::endl;
382 TLOG() <<
"Woke up from 2 seconds of sleep and Waiting for endpoint to reach status 0x8..."
385 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status
386 <<
" and the 0xF bit masked value is 0x" << (pdts_status & 0xF) << std::dec << std::endl;
390 TLOG() <<
"Endpoint is in running state, continuing with configuration!" << std::endl;
391 TLOG() <<
"SSP LED Calib Device Interface Configured complete.";