tdl-xoa-driver 1.7.1__py3-none-any.whl → 1.7.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tdl-xoa-driver
3
- Version: 1.7.1
3
+ Version: 1.7.4
4
4
  Summary: TDL XOA Python API is a Python library providing user-friendly communication interfaces to Teledyne LeCroy Xena Ethernet traffic generation test equipment. It provides a rich collection of APIs that can be used to either write test scripts or develop applications.
5
5
  Home-page: https://github.com/xenanetworks/tdl-xoa-driver
6
6
  Author: Leonard Yu, Zoltan Hanisch
@@ -1,8 +1,8 @@
1
- tdl_xoa_driver-1.7.1.dist-info/licenses/LICENSE,sha256=KcCGoRYa8BS0KGUIHDIAeebClL6sX1uRWVrtESwpjOo,11351
2
- xoa_driver/__init__.py,sha256=qcnNgRe9QjMSe2PGgCiDKUZqf7e3cIfmgfFZpaF-IRQ,47
1
+ tdl_xoa_driver-1.7.4.dist-info/licenses/LICENSE,sha256=KcCGoRYa8BS0KGUIHDIAeebClL6sX1uRWVrtESwpjOo,11351
2
+ xoa_driver/__init__.py,sha256=T92DeWJjBmo2W0qwytgZFQvHTcwyltXiZHX-jy2Bmts,47
3
3
  xoa_driver/enums.py,sha256=bKYWqYkFfUyargNxvJi9_1cvrBy6EUIKkUvsl34frn8,8611
4
4
  xoa_driver/exceptions.py,sha256=baNpophPmeNujMTSfL9TsYHa3Gju2-ozNOg78n8tqN8,1957
5
- xoa_driver/hlfuncs.py,sha256=XxMAXe3NDOLr3PMSbTqJdmX7FKeqh4UhDW1g7s5Wpd4,385
5
+ xoa_driver/hlfuncs.py,sha256=HbGw7HGyPGY_xsxTZujtozcV9cu0QIjEH3LKkJwokww,407
6
6
  xoa_driver/lli.py,sha256=PyT7DT9KxIM8PMw1JMu80J_KIifMPlCg9gd47J7SIjs,434
7
7
  xoa_driver/misc.py,sha256=JBFOiKU1z7DB99HXEDv-tiFM5PvNqNkcT7AxJXZ4lPk,1968
8
8
  xoa_driver/modules.py,sha256=sj7MeLNPqgPFtZU40WdrOQ7tV_WEFXCQfJ3FGnsE-BQ,10287
@@ -15,9 +15,10 @@ xoa_driver/functions/anlt_ll_debug.py,sha256=bKcAjMRslG733ASswIOkNwaUgnayzzKII0m
15
15
  xoa_driver/functions/async_wrapper.py,sha256=DivkplV3ULnFAuHbMmIcLTuYnlulKbZs0P5MZnC5-Kk,4009
16
16
  xoa_driver/functions/exceptions.py,sha256=JlQSHNmiSS_mOQygqituLQF5fFVg38LG4Ktz7qWHxf0,2667
17
17
  xoa_driver/functions/headers.py,sha256=Rf_em8LqCZOz0oxiqvtAFwx71_CtD9_I0p-vEZWtc6E,33886
18
- xoa_driver/functions/layer1_adv.py,sha256=Mbolxw4z4DCXpChZCEtTVjybXV0AHabRo9Cabjzv77A,11422
18
+ xoa_driver/functions/layer1_adv.py,sha256=r7WgSn0qfsHefPZW2YmXym5POEyTUEV_qSeD97QXDFQ,12650
19
19
  xoa_driver/functions/mgmt.py,sha256=rPnlLxeaRIl8_LhJEvRfSn5npxZeqtrIiG_8Fx22a0k,19997
20
20
  xoa_driver/functions/tools.py,sha256=Wj00KfsuyFsp8HiEoHof28JCNLBYRKZ7FU48pyO2nyk,9916
21
+ xoa_driver/functions/xcvr.py,sha256=I9T67OUUw6UrWbMeKzRtGtD7I39CftdlpqScgj1EO-E,8218
21
22
  xoa_driver/functions/cli/__init__.py,sha256=1qCG8oiucQ51v8tS6mAvu9MpBDQ4dqDhzx-EvdhDTQQ,458
22
23
  xoa_driver/functions/cli/_cli_manager.py,sha256=MKU2wS0Gxd514zvyWsm4qiYg-WLPA6vrHZy2QFcqpsU,22166
23
24
  xoa_driver/functions/cli/_config_block.py,sha256=KaNiAq4ht6Hfoo7iE2h03SAXhE3WX5efyHJcE74dYto,12245
@@ -49,7 +50,7 @@ xoa_driver/internals/commands/ped_commands.py,sha256=b2g_GHtUlYoiHsAslLBRguAEje7
49
50
  xoa_driver/internals/commands/pef_commands.py,sha256=phPVir8lEZxHBC2Dxj0NC1fNT04RPKN2LOAzSnqPJ9Y,83072
50
51
  xoa_driver/internals/commands/pf_commands.py,sha256=OZOksRT54YnerXVwU4SnVqT918cAqAwrNHnwgPgC1IU,14705
51
52
  xoa_driver/internals/commands/pl1_commands.py,sha256=1XtkDNT9ag8jVUwLQdQsk9ZTfwp2Td4Egvj1PU0kyI0,78643
52
- xoa_driver/internals/commands/pl1ad_commands.py,sha256=nIfDnHvaIboqCFZyfGfX3gG7kjMPRzHgrb00_fVf7Xg,22451
53
+ xoa_driver/internals/commands/pl1ad_commands.py,sha256=j55mSP3RGvMzCQ3mFOGZHXOLJpXUHpJbDmSFzkaREmQ,22711
53
54
  xoa_driver/internals/commands/pl_commands.py,sha256=PGhIN4mK1wDM2JZBXCpTvGgnBLyLiHCYca-BTOc0liw,6497
54
55
  xoa_driver/internals/commands/pm_commands.py,sha256=GFB67ayuPevseNzrNIWt43X7unw0dp-TIVS-vS6ICB0,9666
55
56
  xoa_driver/internals/commands/pp_commands.py,sha256=M5kbbSJzv-RCC-oJ7P0T5fgP8TqQ5WoKBbl5kRSdq9c,83758
@@ -149,7 +150,7 @@ xoa_driver/internals/hli/ports/port_l23/family_odin.py,sha256=XMwRYHVsEwDQnFlqme
149
150
  xoa_driver/internals/hli/ports/port_l23/family_thor.py,sha256=AmvOB_7csbvr-KIKXPIRuzfMXHBbSbdnmmiU79k-tBs,1600
150
151
  xoa_driver/internals/hli/ports/port_l23/layer1_edun.py,sha256=JjC56MUwie5qq1DtPZdepBrpA7sCCBgNw4NdzOZcVes,3134
151
152
  xoa_driver/internals/hli/ports/port_l23/layer1_freya.py,sha256=cySM8AoivcXNMs7aUmGNVW17JIup5kIpH2EaAIYzubY,3343
152
- xoa_driver/internals/hli/ports/port_l23/layer1_freya_adv.py,sha256=tRj2aRjNQngG52D5NVV-K60Hr6yk1mn-jrwjQFFIP5U,1583
153
+ xoa_driver/internals/hli/ports/port_l23/layer1_freya_adv.py,sha256=aXcF0mro92LNMiXjTXBoy2I5oUXckBvaEk5Y4cKwihI,1572
153
154
  xoa_driver/internals/hli/ports/port_l23/layer1_loki.py,sha256=NvvwpDIRfizv5sDjTsuwyZGrvkL-nvsu8c5YXpBl0Yk,2229
154
155
  xoa_driver/internals/hli/ports/port_l23/layer1_thor.py,sha256=_D6VgDzMfCIHK6yNRebHUjpn6KiI3MllAVxh3CRKzBU,2220
155
156
  xoa_driver/internals/hli/ports/port_l23/bases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -190,7 +191,7 @@ xoa_driver/internals/hli/ports/port_l23/sec/__init__.py,sha256=47DEQpj8HBSa-_TIm
190
191
  xoa_driver/internals/hli/ports/port_l23/sec/macsec.py,sha256=HZNO5t-7WnQ2sUqLCFMXy4h80TOYJmx-9GF3MDrQoOg,3184
191
192
  xoa_driver/internals/hli/ports/port_l23/tcvr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
192
193
  xoa_driver/internals/hli/ports/port_l23/tcvr/cmis.py,sha256=gqCRk6JFbU4waol2zEaaORWvQE3IIrT-ASHm-DFUl-U,5713
193
- xoa_driver/internals/hli/ports/port_l23/tcvr/transceiver.py,sha256=MzX2p109NyFKz4lhEyT6MAOQZ7uDCeJpM6Sx2rPcm84,4459
194
+ xoa_driver/internals/hli/ports/port_l23/tcvr/transceiver.py,sha256=U9R2_MzsPrMAqv0587L9S_HpyIXtbUTWhtRm2ZdmLIo,4313
194
195
  xoa_driver/internals/hli/ports/port_l23/trafficgen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
195
196
  xoa_driver/internals/hli/ports/port_l23/trafficgen/capture.py,sha256=mH_yPZW_3lTX9n1NTCMQlIixd5BWcb5VRfCrtpzY8I8,1955
196
197
  xoa_driver/internals/hli/ports/port_l23/trafficgen/runt.py,sha256=VuxgV2piV57hUlDKcO2sucYwhwpsVO3nwiE1qvexo6g,849
@@ -236,7 +237,7 @@ xoa_driver/internals/utils/managers/abc.py,sha256=M3XgI2FVQLUXixS5SKnZTm0MweHY6D
236
237
  xoa_driver/internals/utils/managers/exceptions.py,sha256=fqLSin-OQCIKuhpzvK6RZThF3FJ8FsHers4EmqM9gSs,628
237
238
  xoa_driver/internals/utils/managers/modules_manager.py,sha256=sCEhqUu7Waot16rucJ5nI9FyHuFEeU_sBx1JjZdhDJg,3236
238
239
  xoa_driver/internals/utils/managers/ports_manager.py,sha256=cmXGWMVbHB27E7e0t-K9mUDessdU_t_v-6WUtpqbIho,3554
239
- tdl_xoa_driver-1.7.1.dist-info/METADATA,sha256=2NvijpVYnk2Sowh5uevaUP599vbDgNPZDWPcnC6pPm0,4171
240
- tdl_xoa_driver-1.7.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
241
- tdl_xoa_driver-1.7.1.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
242
- tdl_xoa_driver-1.7.1.dist-info/RECORD,,
240
+ tdl_xoa_driver-1.7.4.dist-info/METADATA,sha256=c-i_qWZ5tnP-sokYsmKos2Hsqh38-NNAatMM1rpQ4Do,4171
241
+ tdl_xoa_driver-1.7.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
242
+ tdl_xoa_driver-1.7.4.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
243
+ tdl_xoa_driver-1.7.4.dist-info/RECORD,,
xoa_driver/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.7.1"
1
+ __version__ = "1.7.4"
2
2
  __short_version__ = "1.7"
@@ -18,6 +18,9 @@ if TYPE_CHECKING:
18
18
  FreyaEdunPort = Union[Z800FreyaPort, Z1600EdunPort]
19
19
 
20
20
  from ..utils import apply
21
+ from ..enums import (
22
+ OnOff,
23
+ )
21
24
 
22
25
 
23
26
 
@@ -95,7 +98,7 @@ async def get_rx_freq_all(port: "Z800FreyaPort") -> Tuple[int, int, int]:
95
98
  return (resp1.frequency_hz, resp2.frequency_hz, resp3.frequency_hz)
96
99
 
97
100
 
98
- async def get_cdr_lol_since_last(port: "Z800FreyaPort", serdes_indices: List[int]) -> List[Tuple[bool, bool]]:
101
+ async def get_cdr_lol(port: "Z800FreyaPort", serdes_indices: List[int]) -> List[Tuple[bool, bool]]:
99
102
  """
100
103
  Get the current and latched CDR LOL status of the specified Serdes.
101
104
 
@@ -109,7 +112,7 @@ async def get_cdr_lol_since_last(port: "Z800FreyaPort", serdes_indices: List[int
109
112
  results = []
110
113
  cmds = []
111
114
  for serdes_id in serdes_indices:
112
- cmds.append(port.layer1_adv.serdes[serdes_id].rx_cdr_lol_since_last.get())
115
+ cmds.append(port.layer1_adv.serdes[serdes_id].rx_cdr_lol.get())
113
116
  resps = await apply(*cmds)
114
117
  for resp in resps:
115
118
  curr = True if resp.current_lol.value == 1 else False
@@ -153,7 +156,7 @@ async def get_hi_ber(port: "Z800FreyaPort") -> Tuple[bool, bool]:
153
156
  return (curr, latched)
154
157
 
155
158
 
156
- async def get_hi_ser(port: "Z800FreyaPort") -> Tuple[bool, bool]:
159
+ async def get_hi_ser(port: "Z800FreyaPort") -> Tuple[bool, bool, bool]:
157
160
  """
158
161
  Get the current and latched HI-SER status of the specified port.
159
162
 
@@ -161,13 +164,14 @@ async def get_hi_ser(port: "Z800FreyaPort") -> Tuple[bool, bool]:
161
164
 
162
165
  :param port: The port instance.
163
166
  :type port: :class:`~xoa_driver.ports.Z800FreyaPort`
164
- :return: A tuple containing current and latched HI-SER status.
165
- :rtype: Tuple[bool, bool]
167
+ :return: A tuple containing alarm state, current and latched HI-SER status.
168
+ :rtype: Tuple[bool, bool, bool]
166
169
  """
167
170
  resp = await port.layer1_adv.pcs.hi_ser.status.get()
171
+ alarm_state = True if resp.alarm_state == OnOff.ON else False
168
172
  curr = True if resp.current_hiser.value == 1 else False
169
173
  latched = True if resp.latched_hiser.value == 1 else False
170
- return (curr, latched)
174
+ return (alarm_state, curr, latched)
171
175
 
172
176
 
173
177
  async def get_deg_ser(port: "Z800FreyaPort") -> Tuple[bool, bool]:
@@ -318,13 +322,48 @@ async def get_total_loa_since_last(port: "Z800FreyaPort") -> int:
318
322
  return resp.loa_count
319
323
 
320
324
 
325
+ async def set_cw_err(port: "Z800FreyaPort") -> None:
326
+ """
327
+ Inject a 64b/66b codeword error (CW Err) from the port immediately when called.
328
+
329
+ :param port: The port instance.
330
+ :type port: :class:`~xoa_driver.ports.Z800FreyaPort`
331
+ """
332
+ await port.layer1_adv.pcs.err_cw.tx_err_cw.set()
333
+
334
+
335
+ async def set_itb(port: "Z800FreyaPort") -> None:
336
+ """
337
+ Inject an invalid 256b/257b transcode block (ITB) from the port immediately when called.
338
+
339
+ :param port: The port instance.
340
+ :type port: :class:`~xoa_driver.ports.Z800FreyaPort`
341
+ """
342
+ await port.layer1_adv.pcs.itb.tx_itb.set()
343
+
344
+
345
+ async def set_hi_ser_alarm(port: "Z800FreyaPort", on: bool) -> None:
346
+ """
347
+ Set the HI-SER alarm on or off on the port.
348
+
349
+ :param port: The port instance.
350
+ :type port: :class:`~xoa_driver.ports.Z800FreyaPort`
351
+ :param on: Set to `True` to enable the HI-SER alarm, or `False` to disable the HI-SER alarm.
352
+ """
353
+ if on:
354
+ await port.layer1_adv.pcs.hi_ser.alarm.set_on()
355
+ else:
356
+ await port.layer1_adv.pcs.hi_ser.alarm.set_off()
357
+
358
+
359
+
321
360
  __all__ = (
322
361
  "get_tx_freq_curr",
323
362
  "get_rx_freq_curr",
324
363
  "get_rx_freq_min",
325
364
  "get_rx_freq_max",
326
365
  "get_rx_freq_all",
327
- "get_cdr_lol_since_last",
366
+ "get_cdr_lol",
328
367
  "get_rx_lane_skew",
329
368
  "get_hi_ber",
330
369
  "get_hi_ser",
@@ -337,4 +376,7 @@ __all__ = (
337
376
  "get_local_fault_since_last",
338
377
  "get_remote_fault_since_last",
339
378
  "get_total_loa_since_last",
379
+ "set_cw_err",
380
+ "set_itb",
381
+ "set_hi_ser_alarm",
340
382
  )
@@ -0,0 +1,196 @@
1
+ """
2
+ Transceiver R/W functions
3
+ """
4
+
5
+ from __future__ import annotations
6
+ import asyncio
7
+ from typing import (
8
+ TYPE_CHECKING,
9
+ Any,
10
+ Union,
11
+ List,
12
+ Tuple,
13
+ )
14
+ if TYPE_CHECKING:
15
+ from xoa_driver.ports import Z800FreyaPort, Z1600EdunPort, Z100LokiPort, Z10OdinPort, Z400ThorPort
16
+
17
+ from ..misc import Hex
18
+
19
+
20
+
21
+ async def get_xcvr_rw_seq_bank(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", bank: int, page: int, register: int, length: int) -> str:
22
+ """Read a number of bytes from transceiver register interface via I2C.
23
+
24
+ :param port: The port object
25
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
26
+ :param bank: The bank address, e.g. 10 or 0xA
27
+ :type bank: int
28
+ :param page: The page address, e.g. 10 or 0xA
29
+ :type page: int
30
+ :param register: The register address, e.g. 10 or 0xA
31
+ :type register: int
32
+ :param length: The number of bytes to read
33
+ :type length: int
34
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
35
+ :rtype: str
36
+ """
37
+
38
+ resp = await port.transceiver.access_rw_seq_bank(bank_address=bank, page_address=page, register_address=register, byte_count=length).get()
39
+ return resp.value
40
+
41
+ async def set_xcvr_rw_seq_bank(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", bank: int, page: int, register: int, value: str) -> None:
42
+ """Write a number of bytes to transceiver register interface via I2C.
43
+
44
+ :param port: The port object
45
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
46
+ :param bank: The bank address, e.g. 10 or 0xA
47
+ :type bank: int
48
+ :param page: The page address, e.g. 10 or 0xA
49
+ :type page: int
50
+ :param register: The register address, e.g. 10 or 0xA
51
+ :type register: int
52
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
53
+ :type value: str
54
+ """
55
+ await port.transceiver.access_rw_seq_bank(bank_address=bank, page_address=page, register_address=register, byte_count=len(value)//2).set(value=Hex(value))
56
+
57
+
58
+ async def get_xcvr_rw_seq(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, length: int) -> str:
59
+ """Read a number of bytes from transceiver register interface via I2C.
60
+
61
+ :param port: The port object
62
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
63
+ :param page: The page address, e.g. 10 or 0xA
64
+ :type page: int
65
+ :param register: The register address, e.g. 10 or 0xA
66
+ :type register: int
67
+ :param length: The number of bytes to read
68
+ :type length: int
69
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
70
+ :rtype: str
71
+ """
72
+
73
+ resp = await port.transceiver.access_rw_seq(page_address=page, register_address=register, byte_count=length).get()
74
+ return resp.value
75
+
76
+ async def set_xcvr_rw_seq(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, value: str) -> None:
77
+ """Write a number of bytes to transceiver register interface via I2C.
78
+
79
+ :param port: The port object
80
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
81
+ :param page: The page address, e.g. 10 or 0xA
82
+ :type page: int
83
+ :param register: The register address, e.g. 10 or 0xA
84
+ :type register: int
85
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
86
+ :type value: str
87
+ """
88
+ await port.transceiver.access_rw_seq(page_address=page, register_address=register, byte_count=len(value)//2).set(value=Hex(value))
89
+
90
+
91
+ async def get_xcvr_rw(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int) -> str:
92
+ """Read 4 bytes from transceiver register interface.
93
+
94
+ :param port: The port object
95
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
96
+ :param page: The page address, e.g. 10 or 0xA
97
+ :type page: int
98
+ :param register: The register address, e.g. 10 or 0xA
99
+ :type register: int
100
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
101
+ :rtype: str
102
+ """
103
+
104
+ resp = await port.transceiver.access_rw(page_address=page, register_address=register).get()
105
+ return resp.value
106
+
107
+ async def set_xcvr_rw(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, value: str) -> None:
108
+ """Write 4 bytes to transceiver register interface.
109
+
110
+ :param port: The port object
111
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
112
+ :param page: The page address, e.g. 10 or 0xA
113
+ :type page: int
114
+ :param register: The register address, e.g. 10 or 0xA
115
+ :type register: int
116
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
117
+ :type value: str
118
+ """
119
+ await port.transceiver.access_rw(page_address=page, register_address=register).set(value=Hex(value))
120
+
121
+ async def get_xcvr_mii(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", register: int) -> str:
122
+ """Read 2 bytes from transceiver register interface.
123
+
124
+ :param port: The port object
125
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
126
+ :param register: The register address, e.g. 10 or 0xA
127
+ :type register: int
128
+ :return: The read 2 bytes as a string, e.g. 'DEAF'
129
+ :rtype: str
130
+ """
131
+
132
+ resp = await port.transceiver.access_mii(register_address=register).get()
133
+ return resp.value
134
+
135
+ async def set_xcvr_mii(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort",register: int, value: str) -> None:
136
+ """Write 2 bytes to transceiver register interface.
137
+
138
+ :param port: The port object
139
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
140
+ :param page: The page address, e.g. 10 or 0xA
141
+ :type page: int
142
+ :param register: The register address, e.g. 10 or 0xA
143
+ :type register: int
144
+ :param value: The 2 bytes to write as a string, e.g. 'DEAF'
145
+ :type value: str
146
+ """
147
+ await port.transceiver.access_mii(register_address=register).set(value=Hex(value))
148
+
149
+ async def get_i2c_freq_khz(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort") -> int:
150
+ """Read access speed on a transceiver I2C access in the unit of KHz. Default to 100.
151
+
152
+ When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from P_CAPABILITIES.
153
+
154
+ The I2C speed configuration will not be included in the port configuration file (.xpc).
155
+ When you load a port configuration to a port, the transceiver I2C access speed will be reset to default 100.
156
+
157
+ :param port: The port object
158
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
159
+ :return: The current I2C access speed in KHz
160
+ :rtype: int
161
+ """
162
+
163
+ resp = await port.transceiver.i2c_config.get()
164
+ return resp.frequency
165
+
166
+ async def set_i2c_freq_khz(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", frequency: int) -> None:
167
+ """Set access speed on a transceiver I2C access in the unit of KHz.
168
+
169
+ When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from P_CAPABILITIES.
170
+
171
+ The I2C speed configuration will not be included in the port configuration file (.xpc).
172
+ When you load a port configuration to a port, the transceiver I2C access speed will be reset to default 100.
173
+
174
+ :param port: The port object
175
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
176
+ :param frequency: The desired I2C access speed in KHz
177
+ :type frequency: int
178
+ """
179
+
180
+ await port.transceiver.i2c_config.set(frequency=frequency)
181
+
182
+
183
+
184
+
185
+ __all__ = (
186
+ "get_xcvr_rw_seq_bank",
187
+ "set_xcvr_rw_seq_bank",
188
+ "get_xcvr_rw_seq",
189
+ "set_xcvr_rw_seq",
190
+ "get_xcvr_rw",
191
+ "set_xcvr_rw",
192
+ "get_xcvr_mii",
193
+ "set_xcvr_mii",
194
+ "get_i2c_freq_khz",
195
+ "set_i2c_freq_khz",
196
+ )
xoa_driver/hlfuncs.py CHANGED
@@ -11,6 +11,7 @@ from xoa_driver.functions import (
11
11
  cmis,
12
12
  layer1_adv,
13
13
  async_wrapper,
14
+ xcvr,
14
15
  )
15
16
 
16
17
  __all__ = (
@@ -23,4 +24,5 @@ __all__ = (
23
24
  "cmis",
24
25
  "layer1_adv",
25
26
  "async_wrapper",
27
+ "xcvr",
26
28
  )
@@ -35,7 +35,7 @@ class PL1AD_RX_FREQ_CURR:
35
35
 
36
36
  """
37
37
 
38
- code: typing.ClassVar[int] = 1303
38
+ code: typing.ClassVar[int] = 553
39
39
  pushed: typing.ClassVar[bool] = False
40
40
 
41
41
  _connection: 'interfaces.IConnection'
@@ -65,7 +65,7 @@ class PL1AD_RX_FREQ_MIN:
65
65
 
66
66
  """
67
67
 
68
- code: typing.ClassVar[int] = 1305
68
+ code: typing.ClassVar[int] = 554
69
69
  pushed: typing.ClassVar[bool] = False
70
70
 
71
71
  _connection: 'interfaces.IConnection'
@@ -94,7 +94,7 @@ class PL1AD_RX_FREQ_MAX:
94
94
 
95
95
  """
96
96
 
97
- code: typing.ClassVar[int] = 1304
97
+ code: typing.ClassVar[int] = 555
98
98
  pushed: typing.ClassVar[bool] = False
99
99
 
100
100
  _connection: 'interfaces.IConnection'
@@ -123,7 +123,7 @@ class PL1AD_RX_LOL:
123
123
 
124
124
  """
125
125
 
126
- code: typing.ClassVar[int] = 1312
126
+ code: typing.ClassVar[int] = 556
127
127
  pushed: typing.ClassVar[bool] = False
128
128
 
129
129
  _connection: 'interfaces.IConnection'
@@ -157,7 +157,7 @@ class PL1AD_RX_SKEW:
157
157
 
158
158
  """
159
159
 
160
- code: typing.ClassVar[int] = 1315
160
+ code: typing.ClassVar[int] = 557
161
161
  pushed: typing.ClassVar[bool] = False
162
162
 
163
163
  _connection: 'interfaces.IConnection'
@@ -187,7 +187,7 @@ class PL1AD_RX_HIBER:
187
187
  Returns the current and the latched High BER status of the port.
188
188
  """
189
189
 
190
- code: typing.ClassVar[int] = 1306
190
+ code: typing.ClassVar[int] = 558
191
191
  pushed: typing.ClassVar[bool] = False
192
192
 
193
193
  _connection: 'interfaces.IConnection'
@@ -222,7 +222,7 @@ class PL1AD_RX_HISER:
222
222
 
223
223
  """
224
224
 
225
- code: typing.ClassVar[int] = 1307
225
+ code: typing.ClassVar[int] = 559
226
226
  pushed: typing.ClassVar[bool] = False
227
227
 
228
228
  _connection: 'interfaces.IConnection'
@@ -258,7 +258,7 @@ class PL1AD_RX_HISER_ALARM:
258
258
 
259
259
  """
260
260
 
261
- code: typing.ClassVar[int] = 1308
261
+ code: typing.ClassVar[int] = 560
262
262
  pushed: typing.ClassVar[bool] = False
263
263
 
264
264
  _connection: 'interfaces.IConnection'
@@ -291,6 +291,13 @@ class PL1AD_RX_HISER_ALARM:
291
291
  """
292
292
 
293
293
  return Token(self._connection, build_set_request(self, module=self._module, port=self._port, alarm_state=alarm_state))
294
+
295
+
296
+ set_off = functools.partialmethod(set, OnOff.OFF)
297
+ """Set the High SER Alarm state of the port to `OFF`, disabling the alarm."""
298
+
299
+ set_on = functools.partialmethod(set, OnOff.ON)
300
+ """Set the High SER Alarm state of the port to `ON`, enabling the alarm."""
294
301
 
295
302
 
296
303
  @register_command
@@ -303,7 +310,7 @@ class PL1AD_RX_DEG_SER:
303
310
 
304
311
  """
305
312
 
306
- code: typing.ClassVar[int] = 1300
313
+ code: typing.ClassVar[int] = 561
307
314
  pushed: typing.ClassVar[bool] = False
308
315
 
309
316
  _connection: 'interfaces.IConnection'
@@ -351,7 +358,7 @@ class PL1AD_RX_DEG_SER_THRESH:
351
358
 
352
359
  """
353
360
 
354
- code: typing.ClassVar[int] = 1301
361
+ code: typing.ClassVar[int] = 562
355
362
  pushed: typing.ClassVar[bool] = False
356
363
 
357
364
  _connection: 'interfaces.IConnection'
@@ -412,7 +419,7 @@ class PL1AD_RX_ERR_CW_CNT:
412
419
 
413
420
  """
414
421
 
415
- code: typing.ClassVar[int] = 1302
422
+ code: typing.ClassVar[int] = 563
416
423
  pushed: typing.ClassVar[bool] = False
417
424
 
418
425
  _connection: 'interfaces.IConnection'
@@ -444,7 +451,7 @@ class PL1AD_RX_ITB_CNT:
444
451
 
445
452
  """
446
453
 
447
- code: typing.ClassVar[int] = 1309
454
+ code: typing.ClassVar[int] = 564
448
455
  pushed: typing.ClassVar[bool] = False
449
456
 
450
457
  _connection: 'interfaces.IConnection'
@@ -477,7 +484,7 @@ class PL1AD_RX_LOSYNC_CNT:
477
484
 
478
485
  """
479
486
 
480
- code: typing.ClassVar[int] = 1313
487
+ code: typing.ClassVar[int] = 565
481
488
  pushed: typing.ClassVar[bool] = False
482
489
 
483
490
  _connection: 'interfaces.IConnection'
@@ -511,7 +518,7 @@ class PL1AD_RX_LF_CNT:
511
518
 
512
519
  """
513
520
 
514
- code: typing.ClassVar[int] = 1310
521
+ code: typing.ClassVar[int] = 566
515
522
  pushed: typing.ClassVar[bool] = False
516
523
 
517
524
  _connection: 'interfaces.IConnection'
@@ -544,7 +551,7 @@ class PL1AD_RX_RF_CNT:
544
551
 
545
552
  """
546
553
 
547
- code: typing.ClassVar[int] = 1314
554
+ code: typing.ClassVar[int] = 567
548
555
  pushed: typing.ClassVar[bool] = False
549
556
 
550
557
  _connection: 'interfaces.IConnection'
@@ -576,7 +583,7 @@ class PL1AD_RX_LOA_CNT:
576
583
  Use ``PP_RXCLEAR`` to reset the counter.
577
584
  """
578
585
 
579
- code: typing.ClassVar[int] = 1311
586
+ code: typing.ClassVar[int] = 568
580
587
  pushed: typing.ClassVar[bool] = False
581
588
 
582
589
  _connection: 'interfaces.IConnection'
@@ -606,7 +613,7 @@ class PL1AD_TX_FREQ_CURR:
606
613
  Return the current port Tx frequency in Hz.
607
614
  """
608
615
 
609
- code: typing.ClassVar[int] = 1317
616
+ code: typing.ClassVar[int] = 570
610
617
  pushed: typing.ClassVar[bool] = False
611
618
 
612
619
  _connection: 'interfaces.IConnection'
@@ -636,7 +643,7 @@ class PL1AD_TX_ERR_CW:
636
643
 
637
644
  """
638
645
 
639
- code: typing.ClassVar[int] = 1316
646
+ code: typing.ClassVar[int] = 571
640
647
  pushed: typing.ClassVar[bool] = False
641
648
 
642
649
  _connection: 'interfaces.IConnection'
@@ -661,7 +668,7 @@ class PL1AD_TX_ITB:
661
668
 
662
669
  """
663
670
 
664
- code: typing.ClassVar[int] = 1318
671
+ code: typing.ClassVar[int] = 572
665
672
  pushed: typing.ClassVar[bool] = False
666
673
 
667
674
  _connection: 'interfaces.IConnection'
@@ -19,7 +19,7 @@ class SerdesAdv:
19
19
 
20
20
  def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_idx: int) -> None:
21
21
 
22
- self.rx_cdr_lol_since_last = PL1AD_RX_LOL(conn, module_id, port_id, serdes_idx)
22
+ self.rx_cdr_lol = PL1AD_RX_LOL(conn, module_id, port_id, serdes_idx)
23
23
  """Returns the current and the latched CDR Loss of Lock (LOL) status of the specified Serdes.
24
24
 
25
25
  :type: PL1AD_RX_LOL
@@ -45,7 +45,7 @@ class Transceiver:
45
45
  """
46
46
 
47
47
  def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
48
- """Access to register interface by the transceiver.
48
+ """R/W access (4 bytes) to register interface by the transceiver.
49
49
 
50
50
  :param page_address: page address
51
51
  :type page_address: int
@@ -64,7 +64,7 @@ class Transceiver:
64
64
  )
65
65
 
66
66
  def access_mii(self, register_address: int) -> "PX_MII":
67
- """Access to the register interface supported by the media-independent interface (MII) transceiver.
67
+ """R/W access (2 bytes) to the register interface supported by MII transceiver.
68
68
 
69
69
  :param register_address: register address
70
70
  :type register_address: int
@@ -79,7 +79,7 @@ class Transceiver:
79
79
  )
80
80
 
81
81
  def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
82
- """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
82
+ """Sequential R/W a number of bytes to the register interface.
83
83
 
84
84
  :param page_address: page address (0-255)
85
85
  :type page_address: int
@@ -100,7 +100,7 @@ class Transceiver:
100
100
  )
101
101
 
102
102
  def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
103
- """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
103
+ """Sequential R/W a number of bytes to the register interface.
104
104
 
105
105
  :param bank_address: bank address (0-255)
106
106
  :type bank_address: int