|
| 1 | +PPS Module |
| 2 | +======== |
| 3 | + |
| 4 | +.. include:: ../refs/module.pps.ref |
| 5 | + |
| 6 | +The `PPS` class controls a Programmable Power Supply (PPS), capable of providing an output up to 30V and 5A. It allows for precise control over the output voltage and current, with features to read back the actual output values and the module's status. |
| 7 | + |
| 8 | +Support the following products: |
| 9 | + |
| 10 | +|PPSModule| |
| 11 | + |
| 12 | +Micropython Example:: |
| 13 | + |
| 14 | + import os, sys, io |
| 15 | + import M5 |
| 16 | + from M5 import * |
| 17 | + from pps import PPS |
| 18 | + |
| 19 | + pps = PPS(addr=0x35) |
| 20 | + pps.set_output_voltage(5.5) |
| 21 | + pps.set_output_current(1) |
| 22 | + pps.enable_output() |
| 23 | + |
| 24 | + # Read values and status |
| 25 | + print("Voltage:", pps.read_output_voltage(), "V") |
| 26 | + print("Current:", pps.read_output_current(), "A") |
| 27 | + print("Mode:", pps.read_psu_running_mode()) |
| 28 | + |
| 29 | +UIFLOW2 Example: |
| 30 | + |
| 31 | + |example.svg| |
| 32 | + |
| 33 | +.. only:: builder_html |
| 34 | + |
| 35 | +class PPS |
| 36 | +--------- |
| 37 | + |
| 38 | +Constructors |
| 39 | +------------- |
| 40 | + |
| 41 | +.. class:: PPS(addr=0x35) |
| 42 | + |
| 43 | + Creates a PPS object to interact with the programmable power supply. |
| 44 | + |
| 45 | + - ``addr``: I2C address of the PPS device (default is `0x35`). |
| 46 | + |
| 47 | +Methods |
| 48 | +------- |
| 49 | + |
| 50 | +Methods |
| 51 | +---------------------- |
| 52 | + |
| 53 | +.. method:: PPS.set_output(enable: bool) |
| 54 | + |
| 55 | + Enable or disable the PPS output. |
| 56 | + |
| 57 | + - ``enable``: True to enable, False to disable. |
| 58 | + |
| 59 | + UIFLOW2: |
| 60 | + |
| 61 | + |set_output.svg| |
| 62 | + |
| 63 | +.. method:: PPS.enable_output() |
| 64 | + |
| 65 | + Enable the PPS output. |
| 66 | + |
| 67 | + UIFLOW2: |
| 68 | + |
| 69 | + |enable_output.svg| |
| 70 | + |
| 71 | +.. method:: PPS.disable_output() |
| 72 | + |
| 73 | + Disable the PPS output. |
| 74 | + |
| 75 | + UIFLOW2: |
| 76 | + |
| 77 | + |disable_output.svg| |
| 78 | + |
| 79 | +.. method:: PPS.set_output_voltage(voltage: float) |
| 80 | + |
| 81 | + Set the output voltage of the PPS. |
| 82 | + |
| 83 | + - ``voltage``: Desired output voltage from 0.0 to 30.0 volts. |
| 84 | + |
| 85 | + UIFLOW2: |
| 86 | + |
| 87 | + |set_output_voltage.svg| |
| 88 | + |
| 89 | +.. method:: PPS.set_output_current(current: float) |
| 90 | + |
| 91 | + Set the output current of the PPS. |
| 92 | + |
| 93 | + - ``current``: Desired output current from 0.0A to 5.0A. |
| 94 | + |
| 95 | + UIFLOW2: |
| 96 | + |
| 97 | + |set_output_current.svg| |
| 98 | + |
| 99 | +.. method:: PPS.read_psu_running_mode() -> int |
| 100 | + |
| 101 | + Read the PSU running mode. |
| 102 | + |
| 103 | + UIFLOW2: |
| 104 | + |
| 105 | + |read_psu_running_mode.svg| |
| 106 | + |
| 107 | +.. method:: PPS.read_output_current() -> float |
| 108 | + |
| 109 | + Read the current output current. |
| 110 | + |
| 111 | + UIFLOW2: |
| 112 | + |
| 113 | + |read_output_current.svg| |
| 114 | + |
| 115 | +.. method:: PPS.read_output_voltage() -> float |
| 116 | + |
| 117 | + Read the current output voltage. |
| 118 | + |
| 119 | + UIFLOW2: |
| 120 | + |
| 121 | + |read_output_voltage.svg| |
| 122 | + |
| 123 | +.. method:: PPS.read_input_voltage() -> float |
| 124 | + |
| 125 | + Read the input voltage. |
| 126 | + |
| 127 | + UIFLOW2: |
| 128 | + |
| 129 | + |read_input_voltage.svg| |
| 130 | + |
| 131 | +.. method:: PPS.read_data_update_flag() -> int |
| 132 | + |
| 133 | + Read the data update flag. |
| 134 | + |
| 135 | + UIFLOW2: |
| 136 | + |
| 137 | + |read_data_update_flag.svg| |
| 138 | + |
| 139 | +.. method:: PPS.read_mcu_temperature() -> float |
| 140 | + |
| 141 | + Read the MCU temperature. |
| 142 | + |
| 143 | + UIFLOW2: |
| 144 | + |
| 145 | + |read_mcu_temperature.svg| |
| 146 | + |
| 147 | +.. method:: PPS.read_module_id() -> int |
| 148 | + |
| 149 | + Read the module ID. |
| 150 | + |
| 151 | + UIFLOW2: |
| 152 | + |
| 153 | + |read_module_id.svg| |
| 154 | + |
| 155 | +.. method:: PPS.read_uid() -> bytearray |
| 156 | + |
| 157 | + Read the unique identifier (UID). |
| 158 | + |
| 159 | + UIFLOW2: |
| 160 | + |
| 161 | + |read_uid.svg| |
| 162 | + |
| 163 | +.. method:: PPS.get_i2c_address() -> int |
| 164 | + |
| 165 | + Get the current I2C address of the device. |
| 166 | + |
| 167 | + UIFLOW2: |
| 168 | + |
| 169 | + |get_i2c_address.svg| |
| 170 | + |
| 171 | +.. method:: PPS.set_i2c_address(new_address: int) |
| 172 | + |
| 173 | + Set a new I2C address for the device. |
| 174 | + |
| 175 | + - ``new_address``: The new I2C address to set. |
| 176 | + |
| 177 | + UIFLOW2: |
| 178 | + |
| 179 | + |set_i2c_address.svg| |
0 commit comments