
Di gnostic Sp ceWireInterf ce
EtherSp ceLink f milyUser M nu l
17.3.CompilingProgramsthat usetheEtherSpaceLink API............ 50
17.4.GettingStarted- aninitial example APIprogram.............. 51
17.5. AdvancedProgrammingConcepts................... 53
17.5.1.TransmittingSpaceWire Data,Extension SequencesandSpecialPackets..... 53
17.5.2.ReceivingSpaceWire Data,Extension Characters andSpecialPackets...... 53
17.5.3.AsynchronousIssuesduringStatusPolling.............. 54
17.5.4.UsingMultiple Threads Safely................... 55
17.5.5. MaximisingtheThroughput of APIPrograms............. 55
17.5.6.AnAdvancedAPIExample. ................... 56
17.6.TheAPI Functions........................ 62
17.6.1.EtherSpaceLink_open() .................. 63
17.6.2.EtherSpaceLink_close() .................. 65
17.6.3.EtherSpaceLink_set_log_file() .............. 66
17.6.4.EtherSpaceLink_set_id() ................. 67
17.6.5. EtherSpaceLink_set_mode() ................ 68
17.6.6.EtherSpaceLink_write_packet() .............. 71
17.6.7.EtherSpaceLink_write_EXTN() ............... 73
17.6.8.EtherSpaceLink_write_buffer_empty() ............ 76
17.6.9. EtherSpaceLink_flush() .................. 77
17.6.10. EtherSpaceLink_set_receive_timeout() ........... 78
17.6.11.EtherSpaceLink_read_packet() ............... 79
17.6.12.EtherSpaceLink_read_packet_callback() .......... 81
17.6.13.EtherSpaceLink_read_packet_special_callback() ...... 82
17.6.14.EtherSpaceLink_read_packet_extension_callback() ..... 84
17.6.15. EtherSpaceLink_callback_packet_type() .......... 86
17.6.16.EtherSpaceLink_read_packet_full() ............ 87
17.6.17.EtherSpaceLink_read_packet_full_nowait() ......... 92
17.6.18.EtherSpaceLink_read_packet_status() ........... 95
17.6.19. EtherSpaceLink_read_packet_wait_for_completion() ..... 96
17.6.20. EtherSpaceLink_set_speed() ................ 97
17.6.21.EtherSpaceLink_set_speed_double() ............ 98
17.6.22.EtherSpaceLink_link_connected() ............. 99
17.6.23.EtherSpaceLink_get_number_of_links() ...........100
17.6.24.EtherSpaceLink_set_active_link() .............101
17.6.25. EtherSpaceLink_get_manufacturer_string() .........102
17.6.26.EtherSpaceLink_get_product_string() ...........103
17.6.27.EtherSpaceLink_get_HWA() .................104
17.6.28.EtherSpaceLink_HWA_to_serial_number_string() .......105
17.6.29. EtherSpaceLink_extract_timetag() .............106
17.6.30. EtherSpaceLink_ER_enable_reporting() ...........107
17.6.31.EtherSpaceLink_EW_enable_reporting() ...........109
17.6.32.EtherSpaceLink_EW_source() ................112
17.6.33.EtherSpaceLink_TT_enable_reporting() ...........114
17.6.34.EtherSpaceLink_EI_ignore_events() ............116
17.6.35. EtherSpaceLink_EI_flow_control() .............118
18. TroubleshootingGuide.......................120
19. The SpaceWireState Machine ....................123
4Links Limited
www.4Links.co.uk
p ge 5of 130
T+44 1908 642001; F+44 1908 363463
Milton Keynes MK3 6EB, UK
Suite EU2, Bletchley P rk