exopy_hqc_legacy/instruments/drivers/dll/atsapi.py
def load_library():
    """Load the ATS library and register the c signatures.

    """
    global ats
    if os.name == 'nt':
        ats = CDLL("ATSApi.dll")
    elif os.name == 'posix':
        ats = CDLL("libATSApi.so")
    else:
        raise Exception("Unsupported OS")

    # Registering c signature for ctypes to perform automatic conversions
    ats.AlazarErrorToText.restype = c_char_p
    ats.AlazarErrorToText.argtypes = [U32]

    ats.AlazarGetBoardBySystemID.restype = U32
    ats.AlazarGetBoardBySystemID.argtypes = [U32, U32]

    ats.AlazarGetBoardKind.restype = U32
    ats.AlazarGetBoardKind.argtypes = [U32]

    ats.AlazarAbortAsyncRead.restype = U32
    ats.AlazarAbortAsyncRead.argtypes = [U32]
    ats.AlazarAbortAsyncRead.errcheck = returnCodeCheck

    ats.AlazarAbortCapture.restype = U32
    ats.AlazarAbortCapture.argtypes = [U32]
    ats.AlazarAbortCapture.errcheck = returnCodeCheck

    ats.AlazarBeforeAsyncRead.restype = U32
    ats.AlazarBeforeAsyncRead.argtypes = [U32, U32, c_long, U32, U32, U32, U32]
    ats.AlazarBeforeAsyncRead.errcheck = returnCodeCheck

    ats.AlazarBusy.restype = U32
    ats.AlazarBusy.argtypes = [U32]

    ats.AlazarConfigureAuxIO.restype = U32
    ats.AlazarConfigureAuxIO.argtypes = [U32, U32, U32]
    ats.AlazarConfigureAuxIO.errcheck = returnCodeCheck

    ats.AlazarConfigureLSB.restype = U32
    ats.AlazarConfigureLSB.argtypes = [U32, U32, U32]
    ats.AlazarConfigureLSB.errcheck = returnCodeCheck

    ats.AlazarConfigureRecordAverage.restype = U32
    ats.AlazarConfigureRecordAverage.argtypes = [U32, U32, U32, U32, U32]
    ats.AlazarConfigureRecordAverage.errcheck = returnCodeCheck

    ats.AlazarForceTrigger.restype = U32
    ats.AlazarForceTrigger.argtypes = [U32]
    ats.AlazarForceTrigger.errcheck = returnCodeCheck

    ats.AlazarForceTriggerEnable.restype = U32
    ats.AlazarForceTriggerEnable.argtypes = [U32]
    ats.AlazarForceTriggerEnable.errcheck = returnCodeCheck

    ats.AlazarGetChannelInfo.restype = U32
    ats.AlazarGetChannelInfo.argtypes = [U32, c_void_p, c_void_p]

    ats.AlazarInputControl.restype = U32
    ats.AlazarInputControl.argtypes = [U32, U8, U32, U32, U32]
    ats.AlazarInputControl.errcheck = returnCodeCheck

    ats.AlazarNumOfSystems.restype = U32
    ats.AlazarNumOfSystems.argtypes = []

    ats.AlazarPostAsyncBuffer.restype = U32
    ats.AlazarPostAsyncBuffer.argtypes = [U32, c_void_p, U32]
    ats.AlazarPostAsyncBuffer.errcheck = returnCodeCheck

    ats.AlazarReadEx.restype = U32
    ats.AlazarReadEx.argtypes = [U32, U32, c_void_p, c_int, c_long,
                                 c_int64, U32]
    ats.AlazarReadEx.errcheck = returnCodeCheck

    ats.AlazarResetTimeStamp.restype = U32
    ats.AlazarResetTimeStamp.argtypes = [U32, U32]
    ats.AlazarResetTimeStamp.errcheck = returnCodeCheck

    ats.AlazarSetBWLimit.restype = U32
    ats.AlazarSetBWLimit.argtypes = [U32, U32, U32]
    ats.AlazarSetBWLimit.errcheck = returnCodeCheck

    ats.AlazarSetCaptureClock.restype = U32
    ats.AlazarSetCaptureClock.argtypes = [U32, U32, U32, U32, U32]
    ats.AlazarSetCaptureClock.errcheck = returnCodeCheck

    ats.AlazarSetExternalClockLevel.restype = U32
    ats.AlazarSetExternalClockLevel.argtypes = [U32, c_float]
    ats.AlazarSetExternalClockLevel.errcheck = returnCodeCheck

    ats.AlazarSetExternalTrigger.restype = U32
    ats.AlazarSetExternalTrigger.argtypes = [U32, U32, U32]
    ats.AlazarSetExternalTrigger.errcheck = returnCodeCheck

    ats.AlazarSetLED.restype = U32
    ats.AlazarSetLED.argtypes = [U32, U32]
    ats.AlazarSetLED.errcheck = returnCodeCheck

    ats.AlazarSetParameter.restype = U32
    ats.AlazarSetParameter.argtypes = [U32, U8, U32, c_long]
    ats.AlazarSetParameter.errcheck = returnCodeCheck

    ats.AlazarSetParameterUL.restype = U32
    ats.AlazarSetParameterUL.argtypes = [U32, U8, U32, c_long]
    ats.AlazarSetParameterUL.errcheck = returnCodeCheck

    ats.AlazarSetRecordCount.restype = U32
    ats.AlazarSetRecordCount.argtypes = [U32, U32]
    ats.AlazarSetRecordCount.errcheck = returnCodeCheck

    ats.AlazarSetRecordSize.restype = U32
    ats.AlazarSetRecordSize.argtypes = [U32, U32, U32]
    ats.AlazarSetRecordSize.errcheck = returnCodeCheck

    ats.AlazarSetTriggerDelay.restype = U32
    ats.AlazarSetTriggerDelay.argtypes = [U32, U32]
    ats.AlazarSetTriggerDelay.errcheck = returnCodeCheck

    ats.AlazarSetTriggerOperation.restype = U32
    ats.AlazarSetTriggerOperation.argtypes = [U32, U32, U32, U32, U32, U32,
                                              U32, U32, U32, U32]
    ats.AlazarSetTriggerOperation.errcheck = returnCodeCheck

    ats.AlazarSetTriggerTimeOut.restype = U32
    ats.AlazarSetTriggerTimeOut.argtypes = [U32, U32]
    ats.AlazarSetTriggerTimeOut.errcheck = returnCodeCheck

    ats.AlazarSleepDevice.restype = U32
    ats.AlazarSleepDevice.argtypes = [U32, U32]
    ats.AlazarSleepDevice.errcheck = returnCodeCheck

    ats.AlazarStartCapture.restype = U32
    ats.AlazarStartCapture.argtypes = [U32]
    ats.AlazarStartCapture.errcheck = returnCodeCheck

    ats.AlazarTriggered.restype = U32
    ats.AlazarTriggered.argtypes = [U32]

    ats.AlazarWaitAsyncBufferComplete.restype = U32
    ats.AlazarWaitAsyncBufferComplete.argtypes = [U32, c_void_p, U32]
    ats.AlazarWaitAsyncBufferComplete.errcheck = returnCodeCheck
Load the ATS library and register the c signatures.

    
Load the ATS library and register the c signatures.
Load the ATS library and register the c signatures .
def load_library():
    global ats
    if os.name == 'nt':
        ats = CDLL("ATSApi.dll")
    elif os.name == 'posix':
        ats = CDLL("libATSApi.so")
    else:
        raise Exception("Unsupported OS")
    ats.AlazarErrorToText.restype = c_char_p
    ats.AlazarErrorToText.argtypes = [U32]
    ats.AlazarGetBoardBySystemID.restype = U32
    ats.AlazarGetBoardBySystemID.argtypes = [U32, U32]
    ats.AlazarGetBoardKind.restype = U32
    ats.AlazarGetBoardKind.argtypes = [U32]
    ats.AlazarAbortAsyncRead.restype = U32
    ats.AlazarAbortAsyncRead.argtypes = [U32]
    ats.AlazarAbortAsyncRead.errcheck = returnCodeCheck
    ats.AlazarAbortCapture.restype = U32
    ats.AlazarAbortCapture.argtypes = [U32]
    ats.AlazarAbortCapture.errcheck = returnCodeCheck
    ats.AlazarBeforeAsyncRead.restype = U32
    ats.AlazarBeforeAsyncRead.argtypes = [U32, U32, c_long, U32, U32, U32, U32]
    ats.AlazarBeforeAsyncRead.errcheck = returnCodeCheck
    ats.AlazarBusy.restype = U32
    ats.AlazarBusy.argtypes = [U32]
    ats.AlazarConfigureAuxIO.restype = U32
    ats.AlazarConfigureAuxIO.argtypes = [U32, U32, U32]
    ats.AlazarConfigureAuxIO.errcheck = returnCodeCheck
    ats.AlazarConfigureLSB.restype = U32
    ats.AlazarConfigureLSB.argtypes = [U32, U32, U32]
    ats.AlazarConfigureLSB.errcheck = returnCodeCheck
    ats.AlazarConfigureRecordAverage.restype = U32
    ats.AlazarConfigureRecordAverage.argtypes = [U32, U32, U32, U32, U32]
    ats.AlazarConfigureRecordAverage.errcheck = returnCodeCheck
    ats.AlazarForceTrigger.restype = U32
    ats.AlazarForceTrigger.argtypes = [U32]
    ats.AlazarForceTrigger.errcheck = returnCodeCheck
    ats.AlazarForceTriggerEnable.restype = U32
    ats.AlazarForceTriggerEnable.argtypes = [U32]
    ats.AlazarForceTriggerEnable.errcheck = returnCodeCheck
    ats.AlazarGetChannelInfo.restype = U32
    ats.AlazarGetChannelInfo.argtypes = [U32, c_void_p, c_void_p]
    ats.AlazarInputControl.restype = U32
    ats.AlazarInputControl.argtypes = [U32, U8, U32, U32, U32]
    ats.AlazarInputControl.errcheck = returnCodeCheck
    ats.AlazarNumOfSystems.restype = U32
    ats.AlazarNumOfSystems.argtypes = []
    ats.AlazarPostAsyncBuffer.restype = U32
    ats.AlazarPostAsyncBuffer.argtypes = [U32, c_void_p, U32]
    ats.AlazarPostAsyncBuffer.errcheck = returnCodeCheck
    ats.AlazarReadEx.restype = U32
    ats.AlazarReadEx.argtypes = [U32, U32, c_void_p, c_int, c_long,
                                 c_int64, U32]
    ats.AlazarReadEx.errcheck = returnCodeCheck
    ats.AlazarResetTimeStamp.restype = U32
    ats.AlazarResetTimeStamp.argtypes = [U32, U32]
    ats.AlazarResetTimeStamp.errcheck = returnCodeCheck
    ats.AlazarSetBWLimit.restype = U32
    ats.AlazarSetBWLimit.argtypes = [U32, U32, U32]
    ats.AlazarSetBWLimit.errcheck = returnCodeCheck
    ats.AlazarSetCaptureClock.restype = U32
    ats.AlazarSetCaptureClock.argtypes = [U32, U32, U32, U32, U32]
    ats.AlazarSetCaptureClock.errcheck = returnCodeCheck
    ats.AlazarSetExternalClockLevel.restype = U32
    ats.AlazarSetExternalClockLevel.argtypes = [U32, c_float]
    ats.AlazarSetExternalClockLevel.errcheck = returnCodeCheck
    ats.AlazarSetExternalTrigger.restype = U32
    ats.AlazarSetExternalTrigger.argtypes = [U32, U32, U32]
    ats.AlazarSetExternalTrigger.errcheck = returnCodeCheck
    ats.AlazarSetLED.restype = U32
    ats.AlazarSetLED.argtypes = [U32, U32]
    ats.AlazarSetLED.errcheck = returnCodeCheck
    ats.AlazarSetParameter.restype = U32
    ats.AlazarSetParameter.argtypes = [U32, U8, U32, c_long]
    ats.AlazarSetParameter.errcheck = returnCodeCheck
    ats.AlazarSetParameterUL.restype = U32
    ats.AlazarSetParameterUL.argtypes = [U32, U8, U32, c_long]
    ats.AlazarSetParameterUL.errcheck = returnCodeCheck
    ats.AlazarSetRecordCount.restype = U32
    ats.AlazarSetRecordCount.argtypes = [U32, U32]
    ats.AlazarSetRecordCount.errcheck = returnCodeCheck
    ats.AlazarSetRecordSize.restype = U32
    ats.AlazarSetRecordSize.argtypes = [U32, U32, U32]
    ats.AlazarSetRecordSize.errcheck = returnCodeCheck
    ats.AlazarSetTriggerDelay.restype = U32
    ats.AlazarSetTriggerDelay.argtypes = [U32, U32]
    ats.AlazarSetTriggerDelay.errcheck = returnCodeCheck
    ats.AlazarSetTriggerOperation.restype = U32
    ats.AlazarSetTriggerOperation.argtypes = [U32, U32, U32, U32, U32, U32,
                                              U32, U32, U32, U32]
    ats.AlazarSetTriggerOperation.errcheck = returnCodeCheck
    ats.AlazarSetTriggerTimeOut.restype = U32
    ats.AlazarSetTriggerTimeOut.argtypes = [U32, U32]
    ats.AlazarSetTriggerTimeOut.errcheck = returnCodeCheck
    ats.AlazarSleepDevice.restype = U32
    ats.AlazarSleepDevice.argtypes = [U32, U32]
    ats.AlazarSleepDevice.errcheck = returnCodeCheck
    ats.AlazarStartCapture.restype = U32
    ats.AlazarStartCapture.argtypes = [U32]
    ats.AlazarStartCapture.errcheck = returnCodeCheck
    ats.AlazarTriggered.restype = U32
    ats.AlazarTriggered.argtypes = [U32]
    ats.AlazarWaitAsyncBufferComplete.restype = U32
    ats.AlazarWaitAsyncBufferComplete.argtypes = [U32, c_void_p, U32]
    ats.AlazarWaitAsyncBufferComplete.errcheck = returnCodeCheck
def load_library ( ) : global ats if os . name == 'nt' : ats = CDLL ( "ATSApi.dll" ) elif os . name == 'posix' : ats = CDLL ( "libATSApi.so" ) else : raise Exception ( "Unsupported OS" ) ats . AlazarErrorToText . restype = c_char_p ats . AlazarErrorToText . argtypes = [ U32 ] ats . AlazarGetBoardBySystemID . restype = U32 ats . AlazarGetBoardBySystemID . argtypes = [ U32 , U32 ] ats . AlazarGetBoardKind . restype = U32 ats . AlazarGetBoardKind . argtypes = [ U32 ] ats . AlazarAbortAsyncRead . restype = U32 ats . AlazarAbortAsyncRead . argtypes = [ U32 ] ats . AlazarAbortAsyncRead . errcheck = returnCodeCheck ats . AlazarAbortCapture . restype = U32 ats . AlazarAbortCapture . argtypes = [ U32 ] ats . AlazarAbortCapture . errcheck = returnCodeCheck ats . AlazarBeforeAsyncRead . restype = U32 ats . AlazarBeforeAsyncRead . argtypes = [ U32 , U32 , c_long , U32 , U32 , U32 , U32 ] ats . AlazarBeforeAsyncRead . errcheck = returnCodeCheck ats . AlazarBusy . restype = U32 ats . AlazarBusy . argtypes = [ U32 ] ats . AlazarConfigureAuxIO . restype = U32 ats . AlazarConfigureAuxIO . argtypes = [ U32 , U32 , U32 ] ats . AlazarConfigureAuxIO . errcheck = returnCodeCheck ats . AlazarConfigureLSB . restype = U32 ats . AlazarConfigureLSB . argtypes = [ U32 , U32 , U32 ] ats . AlazarConfigureLSB . errcheck = returnCodeCheck ats . AlazarConfigureRecordAverage . restype = U32 ats . AlazarConfigureRecordAverage . argtypes = [ U32 , U32 , U32 , U32 , U32 ] ats . AlazarConfigureRecordAverage . errcheck = returnCodeCheck ats . AlazarForceTrigger . restype = U32 ats . AlazarForceTrigger . argtypes = [ U32 ] ats . AlazarForceTrigger . errcheck = returnCodeCheck ats . AlazarForceTriggerEnable . restype = U32 ats . AlazarForceTriggerEnable . argtypes = [ U32 ] ats . AlazarForceTriggerEnable . errcheck = returnCodeCheck ats . AlazarGetChannelInfo . restype = U32 ats . AlazarGetChannelInfo . argtypes = [ U32 , c_void_p , c_void_p ] ats . AlazarInputControl . restype = U32 ats . AlazarInputControl . argtypes = [ U32 , U8 , U32 , U32 , U32 ] ats . AlazarInputControl . errcheck = returnCodeCheck ats . AlazarNumOfSystems . restype = U32 ats . AlazarNumOfSystems . argtypes = [ ] ats . AlazarPostAsyncBuffer . restype = U32 ats . AlazarPostAsyncBuffer . argtypes = [ U32 , c_void_p , U32 ] ats . AlazarPostAsyncBuffer . errcheck = returnCodeCheck ats . AlazarReadEx . restype = U32 ats . AlazarReadEx . argtypes = [ U32 , U32 , c_void_p , c_int , c_long , c_int64 , U32 ] ats . AlazarReadEx . errcheck = returnCodeCheck ats . AlazarResetTimeStamp . restype = U32 ats . AlazarResetTimeStamp . argtypes = [ U32 , U32 ] ats . AlazarResetTimeStamp . errcheck = returnCodeCheck ats . AlazarSetBWLimit . restype = U32 ats . AlazarSetBWLimit . argtypes = [ U32 , U32 , U32 ] ats . AlazarSetBWLimit . errcheck = returnCodeCheck ats . AlazarSetCaptureClock . restype = U32 ats . AlazarSetCaptureClock . argtypes = [ U32 , U32 , U32 , U32 , U32 ] ats . AlazarSetCaptureClock . errcheck = returnCodeCheck ats . AlazarSetExternalClockLevel . restype = U32 ats . AlazarSetExternalClockLevel . argtypes = [ U32 , c_float ] ats . AlazarSetExternalClockLevel . errcheck = returnCodeCheck ats . AlazarSetExternalTrigger . restype = U32 ats . AlazarSetExternalTrigger . argtypes = [ U32 , U32 , U32 ] ats . AlazarSetExternalTrigger . errcheck = returnCodeCheck ats . AlazarSetLED . restype = U32 ats . AlazarSetLED . argtypes = [ U32 , U32 ] ats . AlazarSetLED . errcheck = returnCodeCheck ats . AlazarSetParameter . restype = U32 ats . AlazarSetParameter . argtypes = [ U32 , U8 , U32 , c_long ] ats . AlazarSetParameter . errcheck = returnCodeCheck ats . AlazarSetParameterUL . restype = U32 ats . AlazarSetParameterUL . argtypes = [ U32 , U8 , U32 , c_long ] ats . AlazarSetParameterUL . errcheck = returnCodeCheck ats . AlazarSetRecordCount . restype = U32 ats . AlazarSetRecordCount . argtypes = [ U32 , U32 ] ats . AlazarSetRecordCount . errcheck = returnCodeCheck ats . AlazarSetRecordSize . restype = U32 ats . AlazarSetRecordSize . argtypes = [ U32 , U32 , U32 ] ats . AlazarSetRecordSize . errcheck = returnCodeCheck ats . AlazarSetTriggerDelay . restype = U32 ats . AlazarSetTriggerDelay . argtypes = [ U32 , U32 ] ats . AlazarSetTriggerDelay . errcheck = returnCodeCheck ats . AlazarSetTriggerOperation . restype = U32 ats . AlazarSetTriggerOperation . argtypes = [ U32 , U32 , U32 , U32 , U32 , U32 , U32 , U32 , U32 , U32 ] ats . AlazarSetTriggerOperation . errcheck = returnCodeCheck ats . AlazarSetTriggerTimeOut . restype = U32 ats . AlazarSetTriggerTimeOut . argtypes = [ U32 , U32 ] ats . AlazarSetTriggerTimeOut . errcheck = returnCodeCheck ats . AlazarSleepDevice . restype = U32 ats . AlazarSleepDevice . argtypes = [ U32 , U32 ] ats . AlazarSleepDevice . errcheck = returnCodeCheck ats . AlazarStartCapture . restype = U32 ats . AlazarStartCapture . argtypes = [ U32 ] ats . AlazarStartCapture . errcheck = returnCodeCheck ats . AlazarTriggered . restype = U32 ats . AlazarTriggered . argtypes = [ U32 ] ats . AlazarWaitAsyncBufferComplete . restype = U32 ats . AlazarWaitAsyncBufferComplete . argtypes = [ U32 , c_void_p , U32 ] ats . AlazarWaitAsyncBufferComplete . errcheck = returnCodeCheck
Load the ATS library and register the c signatures.
Load the ATS library and register the c signatures .
"""Load the ATS library and register the c signatures.

    """ # Registering c signature for ctypes to perform automatic conversions