| 1 | # SPDX-License-Identifier: LGPL-3.0-or-later |
| 2 | # Copyright (C) 2018 Takashi Sakamoto |
| 3 | |
| 4 | from hinawa_utils.motu.motu_protocol_abstractscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/__init__: import MotuProtocolAbstractscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract# |
| 5 | |
| 6 | __all__scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/__all__. = ['MotuProtocolV1'] |
| 7 | |
| 8 | |
| 9 | class MotuProtocolV1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#(MotuProtocolAbstractscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#): |
| 10 | SUPPORTED_MODELSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#SUPPORTED_MODELS. = ('828', '896') |
| 11 | |
| 12 | # direction/mask/shift |
| 13 | OPT_IFACE_MODE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#OPT_IFACE_MODE_ATTRS. = { |
| 14 | 'in': ((2, 0x80, 3), (3, 0x80, 3)), |
| 15 | 'out': ((2, 0x40, 2), (3, 0x40, 2)) |
| 16 | } |
| 17 | |
| 18 | PACKET_SIZE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#PACKET_SIZE_ATTRS. = { |
| 19 | 'in': (3, 0x80, 3), |
| 20 | 'out': (3, 0x40, 2), |
| 21 | } |
| 22 | |
| 23 | def get_supported_sampling_ratesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(self)): |
| 24 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(self)._unitscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#_unit..name == '828': |
| 25 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(self).SUPPORTED_SAMPLING_RATES_X1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_SAMPLING_RATES_X1. |
| 26 | elif selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(self)._unitscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#_unit..name == '896': |
| 27 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_sampling_rates().(self).SUPPORTED_SAMPLING_RATES_X2scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_SAMPLING_RATES_X2. |
| 28 | |
| 29 | def get_sampling_ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_sampling_rate().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_sampling_rate().(self)): |
| 30 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_sampling_rate().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 31 | if frames[3] & 0x04: |
| 32 | rate = 48000 |
| 33 | else: |
| 34 | rate = 44100 |
| 35 | if frames[3] & 0x08: |
| 36 | rate * 2 |
| 37 | return rate |
| 38 | |
| 39 | def set_sampling_ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(self), ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(rate)): |
| 40 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 41 | frames[0] &= ~0x0c |
| 42 | if ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(rate) % 48000 == 0: |
| 43 | frames[3] |= 0x04 |
| 44 | if ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(rate) > 48000: |
| 45 | frames[3] |= 0x08 |
| 46 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_sampling_rate().(self).writescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#write().(0x0b00, frames) |
| 47 | |
| 48 | def get_supported_clock_sourcesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self)): |
| 49 | sources = [ |
| 50 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_INTERNALscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_INTERNAL., |
| 51 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_ADAT_ON_DSUBscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_DSUB., |
| 52 | ] |
| 53 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).get_opt_iface_modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().('in', 'A') == 'S/PDIF': |
| 54 | sources.appendscip-python python python-stdlib 3.11 builtins/list#append().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_SPDIF_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_OPT.) |
| 55 | else: |
| 56 | sources.appendscip-python python python-stdlib 3.11 builtins/list#append().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_ADAT_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_OPT.) |
| 57 | sources.appendscip-python python python-stdlib 3.11 builtins/list#append().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_SPDIF_ON_COAXscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_COAX.) |
| 58 | |
| 59 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self)._unitscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#_unit..name == '896': |
| 60 | sources.appendscip-python python python-stdlib 3.11 builtins/list#append().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_clock_sources().(self).CLOCK_WORD_ON_BNCscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_WORD_ON_BNC.) |
| 61 | |
| 62 | return sources |
| 63 | |
| 64 | def get_clock_sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self)): |
| 65 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 66 | |
| 67 | if frames[3] & 0x01: |
| 68 | if frames[3] & 0x20: |
| 69 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).CLOCK_ADAT_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_OPT. |
| 70 | else: |
| 71 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).CLOCK_ADAT_ON_DSUBscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_DSUB. |
| 72 | elif frames[3] & 0x02: |
| 73 | if frames[2] & 0x80: |
| 74 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).CLOCK_SPDIF_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_OPT. |
| 75 | else: |
| 76 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).CLOCK_SPDIF_ON_COAXscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_COAX. |
| 77 | else: |
| 78 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_clock_source().(self).CLOCK_INTERNALscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_INTERNAL. |
| 79 | |
| 80 | def set_clock_sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self), sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source)): |
| 81 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 82 | frames[2] &= ~0x80 |
| 83 | frames[3] &= ~0x23 |
| 84 | |
| 85 | if sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source) != selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_ADAT_ON_DSUBscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_DSUB.: |
| 86 | frames[3] |= 0x20 |
| 87 | |
| 88 | if sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source) in (selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_ADAT_ON_DSUBscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_DSUB., selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_ADAT_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_ADAT_ON_OPT.): |
| 89 | frames[3] |= 0x01 |
| 90 | elif sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source) == selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_SPDIF_ON_OPTscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_OPT.: |
| 91 | frames[3] |= 0x02 |
| 92 | elif sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source) == selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_SPDIF_ON_COAXscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_SPDIF_ON_COAX.: |
| 93 | if frames[2] & 0x80: |
| 94 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('This mode is currently unavailable.') |
| 95 | frames[2] |= 0x80 |
| 96 | frames[3] |= 0x02 |
| 97 | elif sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(source) == selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).CLOCK_WORD_ON_BNCscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#CLOCK_WORD_ON_BNC.: |
| 98 | frames[3] |= 0x10 |
| 99 | |
| 100 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_clock_source().(self).writescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#write().(0x0b00, frames) |
| 101 | |
| 102 | def get_supported_opt_iface_indexesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_opt_iface_indexes().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_opt_iface_indexes().(self)): |
| 103 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_supported_opt_iface_indexes().(self).SUPPORTED_OPT_IFACE_INDEXESscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_OPT_IFACE_INDEXES.[0:1] |
| 104 | |
| 105 | def get_opt_iface_modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self), directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(index)): |
| 106 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 107 | |
| 108 | pos, mask, shift = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).OPT_IFACE_MODE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#OPT_IFACE_MODE_ATTRS.[directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(direction)][0] |
| 109 | if frames[pos] & mask: |
| 110 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).SUPPORTED_OPT_IFACE_MODESscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_OPT_IFACE_MODES.[1] |
| 111 | else: |
| 112 | # Need to check the size of data block, sigh... |
| 113 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b10, 4) |
| 114 | |
| 115 | pos, mask, shift = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).OPT_IFACE_MODE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#OPT_IFACE_MODE_ATTRS.[directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(direction)][1] |
| 116 | if frames[pos] & mask: |
| 117 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).SUPPORTED_OPT_IFACE_MODESscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_OPT_IFACE_MODES.[0] |
| 118 | else: |
| 119 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#get_opt_iface_mode().(self).SUPPORTED_OPT_IFACE_MODESscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_OPT_IFACE_MODES.[2] |
| 120 | |
| 121 | def set_opt_iface_modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self), directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(index), modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(mode)): |
| 122 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b00, 4) |
| 123 | frames[0] &= 0xc0 |
| 124 | |
| 125 | pos, mask, shift = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).OPT_IFACE_MODE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#OPT_IFACE_MODE_ATTRS.[directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(direction)][0] |
| 126 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).SUPPORTED_OPT_IFACE_MODESscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#SUPPORTED_OPT_IFACE_MODES..indexscip-python python python-stdlib 3.11 builtins/tuple#index().(modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(mode)) == 1: |
| 127 | frames[pos] |= 1 << shift |
| 128 | |
| 129 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).writescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#write().(0x0b00, frames) |
| 130 | |
| 131 | pos, mask, shift = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).PACKET_SIZE_ATTRSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#PACKET_SIZE_ATTRS.[directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(direction)] |
| 132 | frames = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).readscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#read().(0x0b10, 4) |
| 133 | frames[pos] &= ~mask |
| 134 | if modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(mode) != 'ADAT': |
| 135 | frames[pos] |= 1 << shift |
| 136 | |
| 137 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#set_opt_iface_mode().(self).writescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_abstract`/MotuProtocolAbstract#write().(0x0b10, frames) |