"""A Python wrapper module to wrap around manufacturer provided library header file 'mhdefin.h'. The header file used
is from software version 3.1.0.
Please find the header file in the dedicated software package for the MultiHarp instrument at
https://www.picoquant.com/dl_software/MultiHarp150/MultiHarp150_160_V3_1.zip"""
# This is generated code, do not edit by hand!
import ctypes


_mhlib_function_signatures = [
        ('MH_GetLibraryVersion', ctypes.c_int, [('vers', ctypes.POINTER(ctypes.c_char))]),
        ('MH_GetErrorString', ctypes.c_int, [('errstring', ctypes.POINTER(ctypes.c_char)), ('errcode', ctypes.c_int)]),
        ('MH_OpenDevice', ctypes.c_int, [('devidx', ctypes.c_int), ('serial', ctypes.POINTER(ctypes.c_char))]),
        ('MH_CloseDevice', ctypes.c_int, [('devidx', ctypes.c_int)]),
        ('MH_Initialize', ctypes.c_int, [('devidx', ctypes.c_int), ('mode', ctypes.c_int), ('refsource', ctypes.c_int)]),
        ('MH_GetHardwareInfo', ctypes.c_int, [('devidx', ctypes.c_int), ('model', ctypes.POINTER(ctypes.c_char)), ('partno', ctypes.POINTER(ctypes.c_char)), ('version', ctypes.POINTER(ctypes.c_char))]),
        ('MH_GetSerialNumber', ctypes.c_int, [('devidx', ctypes.c_int), ('serial', ctypes.POINTER(ctypes.c_char))]),
        ('MH_GetFeatures', ctypes.c_int, [('devidx', ctypes.c_int), ('features', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetBaseResolution', ctypes.c_int, [('devidx', ctypes.c_int), ('resolution', ctypes.POINTER(ctypes.c_double)), ('binsteps', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetNumOfInputChannels', ctypes.c_int, [('devidx', ctypes.c_int), ('nchannels', ctypes.POINTER(ctypes.c_int))]),
        ('MH_SetSyncDiv', ctypes.c_int, [('devidx', ctypes.c_int), ('div', ctypes.c_int)]),
        ('MH_SetSyncEdgeTrg', ctypes.c_int, [('devidx', ctypes.c_int), ('level', ctypes.c_int), ('edge', ctypes.c_int)]),
        ('MH_SetSyncChannelOffset', ctypes.c_int, [('devidx', ctypes.c_int), ('value', ctypes.c_int)]),
        ('MH_SetSyncDeadTime', ctypes.c_int, [('devidx', ctypes.c_int), ('on', ctypes.c_int), ('deadtime', ctypes.c_int)]),
        ('MH_SetInputEdgeTrg', ctypes.c_int, [('devidx', ctypes.c_int), ('channel', ctypes.c_int), ('level', ctypes.c_int), ('edge', ctypes.c_int)]),
        ('MH_SetInputChannelOffset', ctypes.c_int, [('devidx', ctypes.c_int), ('channel', ctypes.c_int), ('value', ctypes.c_int)]),
        ('MH_SetInputDeadTime', ctypes.c_int, [('devidx', ctypes.c_int), ('channel', ctypes.c_int), ('on', ctypes.c_int), ('deadtime', ctypes.c_int)]),
        ('MH_SetInputChannelEnable', ctypes.c_int, [('devidx', ctypes.c_int), ('channel', ctypes.c_int), ('enable', ctypes.c_int)]),
        ('MH_SetStopOverflow', ctypes.c_int, [('devidx', ctypes.c_int), ('stop_ovfl', ctypes.c_int), ('stopcount', ctypes.c_uint)]),
        ('MH_SetBinning', ctypes.c_int, [('devidx', ctypes.c_int), ('binning', ctypes.c_int)]),
        ('MH_SetOffset', ctypes.c_int, [('devidx', ctypes.c_int), ('offset', ctypes.c_int)]),
        ('MH_SetHistoLen', ctypes.c_int, [('devidx', ctypes.c_int), ('lencode', ctypes.c_int), ('actuallen', ctypes.POINTER(ctypes.c_int))]),
        ('MH_SetMeasControl', ctypes.c_int, [('devidx', ctypes.c_int), ('control', ctypes.c_int), ('startedge', ctypes.c_int), ('stopedge', ctypes.c_int)]),
        ('MH_SetTriggerOutput', ctypes.c_int, [('devidx', ctypes.c_int), ('period', ctypes.c_int)]),
        ('MH_ClearHistMem', ctypes.c_int, [('devidx', ctypes.c_int)]),
        ('MH_StartMeas', ctypes.c_int, [('devidx', ctypes.c_int), ('tacq', ctypes.c_int)]),
        ('MH_StopMeas', ctypes.c_int, [('devidx', ctypes.c_int)]),
        ('MH_CTCStatus', ctypes.c_int, [('devidx', ctypes.c_int), ('ctcstatus', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetHistogram', ctypes.c_int, [('devidx', ctypes.c_int), ('chcount', ctypes.POINTER(ctypes.c_uint)), ('channel', ctypes.c_int)]),
        ('MH_GetAllHistograms', ctypes.c_int, [('devidx', ctypes.c_int), ('chcount', ctypes.POINTER(ctypes.c_uint))]),
        ('MH_GetResolution', ctypes.c_int, [('devidx', ctypes.c_int), ('resolution', ctypes.POINTER(ctypes.c_double))]),
        ('MH_GetSyncPeriod', ctypes.c_int, [('devidx', ctypes.c_int), ('period', ctypes.POINTER(ctypes.c_double))]),
        ('MH_GetSyncRate', ctypes.c_int, [('devidx', ctypes.c_int), ('syncrate', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetCountRate', ctypes.c_int, [('devidx', ctypes.c_int), ('channel', ctypes.c_int), ('cntrate', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetAllCountRates', ctypes.c_int, [('devidx', ctypes.c_int), ('syncrate', ctypes.POINTER(ctypes.c_int)), ('cntrates', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetFlags', ctypes.c_int, [('devidx', ctypes.c_int), ('flags', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetElapsedMeasTime', ctypes.c_int, [('devidx', ctypes.c_int), ('elapsed', ctypes.POINTER(ctypes.c_double))]),
        ('MH_GetStartTime', ctypes.c_int, [('devidx', ctypes.c_int), ('timedw2', ctypes.POINTER(ctypes.c_uint)), ('timedw1', ctypes.POINTER(ctypes.c_uint)), ('timedw0', ctypes.POINTER(ctypes.c_uint))]),
        ('MH_GetWarnings', ctypes.c_int, [('devidx', ctypes.c_int), ('warnings', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetWarningsText', ctypes.c_int, [('devidx', ctypes.c_int), ('text', ctypes.POINTER(ctypes.c_char)), ('warnings', ctypes.c_int)]),
        ('MH_SetMarkerHoldoffTime', ctypes.c_int, [('devidx', ctypes.c_int), ('holdofftime', ctypes.c_int)]),
        ('MH_SetMarkerEdges', ctypes.c_int, [('devidx', ctypes.c_int), ('me1', ctypes.c_int), ('me2', ctypes.c_int), ('me3', ctypes.c_int), ('me4', ctypes.c_int)]),
        ('MH_SetMarkerEnable', ctypes.c_int, [('devidx', ctypes.c_int), ('en1', ctypes.c_int), ('en2', ctypes.c_int), ('en3', ctypes.c_int), ('en4', ctypes.c_int)]),
        ('MH_ReadFiFo', ctypes.c_int, [('devidx', ctypes.c_int), ('buffer', ctypes.POINTER(ctypes.c_uint)), ('nactual', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetDebugInfo', ctypes.c_int, [('devidx', ctypes.c_int), ('debuginfo', ctypes.POINTER(ctypes.c_char))]),
        ('MH_GetNumOfModules', ctypes.c_int, [('devidx', ctypes.c_int), ('nummod', ctypes.POINTER(ctypes.c_int))]),
        ('MH_GetModuleInfo', ctypes.c_int, [('devidx', ctypes.c_int), ('modidx', ctypes.c_int), ('modelcode', ctypes.POINTER(ctypes.c_int)), ('versioncode', ctypes.POINTER(ctypes.c_int))]),
        ('MH_WRabbitGetMAC', ctypes.c_int, [('devidx', ctypes.c_int), ('mac_addr', ctypes.POINTER(ctypes.c_char))]),
        ('MH_WRabbitSetMAC', ctypes.c_int, [('devidx', ctypes.c_int), ('mac_addr', ctypes.POINTER(ctypes.c_char))]),
        ('MH_WRabbitGetInitScript', ctypes.c_int, [('devidx', ctypes.c_int), ('initscript', ctypes.POINTER(ctypes.c_char))]),
        ('MH_WRabbitSetInitScript', ctypes.c_int, [('devidx', ctypes.c_int), ('initscript', ctypes.POINTER(ctypes.c_char))]),
        ('MH_WRabbitGetSFPData', ctypes.c_int, [('devidx', ctypes.c_int), ('sfpnames', ctypes.POINTER(ctypes.c_char)), ('dTxs', ctypes.POINTER(ctypes.c_int)), ('dRxs', ctypes.POINTER(ctypes.c_int)), ('alphas', ctypes.POINTER(ctypes.c_int))]),
        ('MH_WRabbitSetSFPData', ctypes.c_int, [('devidx', ctypes.c_int), ('sfpnames', ctypes.POINTER(ctypes.c_char)), ('dTxs', ctypes.POINTER(ctypes.c_int)), ('dRxs', ctypes.POINTER(ctypes.c_int)), ('alphas', ctypes.POINTER(ctypes.c_int))]),
        ('MH_WRabbitInitLink', ctypes.c_int, [('devidx', ctypes.c_int), ('link_on', ctypes.c_int)]),
        ('MH_WRabbitSetMode', ctypes.c_int, [('devidx', ctypes.c_int), ('bootfromscript', ctypes.c_int), ('reinit_with_mode', ctypes.c_int), ('mode', ctypes.c_int)]),
        ('MH_WRabbitSetTime', ctypes.c_int, [('devidx', ctypes.c_int), ('timehidw', ctypes.c_uint), ('timelodw', ctypes.c_uint)]),
        ('MH_WRabbitGetTime', ctypes.c_int, [('devidx', ctypes.c_int), ('timehidw', ctypes.POINTER(ctypes.c_uint)), ('timelodw', ctypes.POINTER(ctypes.c_uint)), ('subsec16ns', ctypes.POINTER(ctypes.c_uint))]),
        ('MH_WRabbitGetStatus', ctypes.c_int, [('devidx', ctypes.c_int), ('wrstatus', ctypes.POINTER(ctypes.c_int))]),
        ('MH_WRabbitGetTermOutput', ctypes.c_int, [('devidx', ctypes.c_int), ('buffer', ctypes.POINTER(ctypes.c_char)), ('nchar', ctypes.POINTER(ctypes.c_int))])
    ]
