|
@@ -13,6 +13,8 @@ Features
|
13
|
13
|
device with one method call
|
14
|
14
|
- Allows control of whether or not the output is enabled
|
15
|
15
|
- Provides a Pythonic interface for reading advertised PDOs
|
|
16
|
+- Provides functions for testing if the power supply follows the Power Rules
|
|
17
|
+- Includes a script for testing if a PD Buddy Sink is correctly functioning
|
16
|
18
|
|
17
|
19
|
Examples
|
18
|
20
|
--------
|
|
@@ -25,11 +27,11 @@ Open the first PD Buddy Sink device and read its configuration
|
25
|
27
|
>>> import pdbuddy
|
26
|
28
|
>>> pdbs = pdbuddy.Sink(list(pdbuddy.Sink.get_devices())[0])
|
27
|
29
|
>>> pdbs.get_cfg()
|
28
|
|
- SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.NONE: 0>, v=5000, i=3000)
|
|
30
|
+ SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.NONE: 0>, v=5000, vmin=None, vmax=None, i=3000, idim=<SinkDimension.CURRENT: 1>)
|
29
|
31
|
>>> print(pdbs.get_cfg())
|
30
|
32
|
status: valid
|
31
|
33
|
flags: (none)
|
32
|
|
- v: 5.00 V
|
|
34
|
+ v: 5.000 V
|
33
|
35
|
i: 3.00 A
|
34
|
36
|
|
35
|
37
|
Locally manipulate a SinkConfig object
|
|
@@ -41,7 +43,7 @@ Locally manipulate a SinkConfig object
|
41
|
43
|
>>> cfg = cfg._replace(v=20000, i=2250)
|
42
|
44
|
>>> cfg = cfg._replace(flags=cfg.flags | pdbuddy.SinkFlags.GIVEBACK)
|
43
|
45
|
>>> cfg
|
44
|
|
- SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.GIVEBACK: 1>, v=20000, i=2250)
|
|
46
|
+ SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.GIVEBACK: 1>, v=20000, vmin=None, vmax=None, i=2250, idim=<SinkDimension.CURRENT: 1>)
|
45
|
47
|
|
46
|
48
|
Write the SinkConfig object to flash
|
47
|
49
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
@@ -51,7 +53,7 @@ Write the SinkConfig object to flash
|
51
|
53
|
>>> pdbs.set_tmpcfg(cfg)
|
52
|
54
|
>>> pdbs.write()
|
53
|
55
|
>>> pdbs.get_cfg()
|
54
|
|
- SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.GIVEBACK: 1>, v=20000, i=2250)
|
|
56
|
+ SinkConfig(status=<SinkStatus.VALID: 2>, flags=<SinkFlags.GIVEBACK: 1>, v=20000, vmin=None, vmax=None, i=2250, idim=<SinkDimension.CURRENT: 1>)
|
55
|
57
|
|
56
|
58
|
Requirements
|
57
|
59
|
------------
|