interface.py
test_plans.fixtur-ctrl-func-test.hardware_utils.interface
Interface Module for the FixturCtrl Functional Test Fixture
logger = logging.getLogger(__name__)
module-attribute
get_fixture_config
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
16 17 18 19 20 21 | |
get_test_fixture
return the test fixture
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
24 25 26 | |
Delays
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
29 30 31 32 33 34 35 36 | |
__init__
Initialize delays from custom fixture configuration settings
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
30 31 32 33 34 35 36 | |
CMD = float(config.user_vars['CMD_DELAY'])
instance-attribute
PWR = float(config.user_vars['PWR_DELAY'])
instance-attribute
USB_LOAD = float(config.user_vars['USB_LOAD_DELAY'])
instance-attribute
USB_SERIAL = float(config.user_vars['USB_SERIAL_DELAY'])
instance-attribute
BOOT = float(config.user_vars['BOOT_TIMEOUT'])
instance-attribute
ArduinoCLI
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
__init__
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
40 41 | |
port = port
instance-attribute
compile
Compile the Arduino Sketch
Compile arduino sketch from arduino's CLI and return command output
Parameters: sketch_dir: current working directory with sketch to compile sketch: name of sketch fqbn: full qualified board name (ex/ arduino:avr:nano)
Returns: command output of compile command
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
upload
Compile the Arduino Sketch
Compile arduino sketch from arduino's CLI and return command output
Parameters: sketch_dir: current working directory with sketch to compile sketch: name of sketch fqbn: full qualified board name (ex/ arduino:avr:nano)
Returns: command output of compile command
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
FixtureInterface
Bases: object
Interface to the FixturCtrl Test Fixture.
This class provides an interface to the FixturCtrl Test Fixture. It is responsible for communicating with the instrumentation, DUT, and hardware used within the FixturCtrl Functional Test Fixture.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
A_SELECT0 = 0
class-attribute
instance-attribute
A_SELECT1 = 1
class-attribute
instance-attribute
A_SELECT2 = 2
class-attribute
instance-attribute
A_SELECT3 = 3
class-attribute
instance-attribute
POWER_SEL = 4
class-attribute
instance-attribute
EN_12V = 5
class-attribute
instance-attribute
EN_5V = 6
class-attribute
instance-attribute
RP_BOOT = 7
class-attribute
instance-attribute
RP_RUN = 8
class-attribute
instance-attribute
EN_LED1 = 9
class-attribute
instance-attribute
EN_LED2 = 10
class-attribute
instance-attribute
IND_SW_EN = 11
class-attribute
instance-attribute
MUX = 0
class-attribute
instance-attribute
I_VOUT = 1
class-attribute
instance-attribute
I_VREF = 2
class-attribute
instance-attribute
ADC_CONT_TEST = 0
class-attribute
instance-attribute
ADC_DUT_5V = 1
class-attribute
instance-attribute
ADC_DUT_3V3 = 2
class-attribute
instance-attribute
ADC_DUT_1V1 = 3
class-attribute
instance-attribute
ADC_LED1_R = 4
class-attribute
instance-attribute
ADC_LED1_G = 5
class-attribute
instance-attribute
ADC_LED1_B = 6
class-attribute
instance-attribute
ADC_LED2_R = 7
class-attribute
instance-attribute
ADC_LED2_G = 8
class-attribute
instance-attribute
ADC_LED2_B = 9
class-attribute
instance-attribute
ADC_USB_LOAD1 = 10
class-attribute
instance-attribute
ADC_USB_LOAD2 = 11
class-attribute
instance-attribute
ADC_USB_LOAD3 = 12
class-attribute
instance-attribute
ADC_USB_LOAD4 = 13
class-attribute
instance-attribute
ADC_USB_LOAD5 = 14
class-attribute
instance-attribute
ADC_USB_LOAD6 = 15
class-attribute
instance-attribute
USB1_SERIAL_EN = 0
class-attribute
instance-attribute
USB1_LOAD_EN = 1
class-attribute
instance-attribute
USB2_SERIAL_EN = 2
class-attribute
instance-attribute
USB2_LOAD_EN = 3
class-attribute
instance-attribute
USB3_SERIAL_EN = 4
class-attribute
instance-attribute
USB3_LOAD_EN = 5
class-attribute
instance-attribute
USB4_SERIAL_EN = 6
class-attribute
instance-attribute
USB4_LOAD_EN = 7
class-attribute
instance-attribute
USB5_SERIAL_EN = 10
class-attribute
instance-attribute
USB5_LOAD_EN = 11
class-attribute
instance-attribute
USB6_SERIAL_EN = 12
class-attribute
instance-attribute
USB6_LOAD_EN = 13
class-attribute
instance-attribute
__init__
Initializes the TestInterface.
Opens connections to all hardware and instruments used in the test fixture.
The configuration for the test fixture is passed in as a dictionary and provides the necessary information to establish connections to the hardware and instruments.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
config = fixture_config
instance-attribute
serial_port = None
instance-attribute
arduino_cli = ArduinoCLI(port=self.serial_port)
instance-attribute
usb_stem = brainstem.stem.MTMUSBStem()
instance-attribute
io_expander = TCA9555(self.usb_stem.i2c[1], address=66)
instance-attribute
pwr_select
Set the power select state.
Connects/disconnects the continuity test and power supply to the DUT. Setting state to True connects the DUT to the power supply. Setting state to False connects the DUT to the continuity test.
Parameters: state: The state to set the power select to.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
214 215 216 217 218 219 220 221 222 223 224 | |
en_12v
Set the 12V enable state.
Enables/disables the 12V supply to the DUT.
Parameters: state: The state to set the 12V enable to.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
226 227 228 229 230 231 232 233 234 | |
en_5v
Set the 5V enable state.
Enables/disables the 5V supply to the DUT.
Parameters: state: The state to set the 5V enable to.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
236 237 238 239 240 241 242 243 244 | |
en_usb_serial
Enables power to USB serial device
Enables/disables power to the test USB serial device for USB Hub enumeration
Parameters: state: True when power on, False when power off usb: USB device to switch on/off
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
en_usb_load
Enables power to USB load test
Enables/disables USB load to test the USB serial device for USB Hub power draw
Parameters: state: True when power on, False when power off usb: USB device to switch on/off
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |
bootsel
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
inductive_sw
Set the inductive switch state.
Parameters: state: The state to set the inductive switch to.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
306 307 308 309 310 311 312 | |
get_mux_reading
Get the MUX reading for the specified channel.
Parameters: channel: The MUX channel to read. scalar: (Optional) Voltage scaling multiplier to add
Returns: The MUX reading.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
get_continuity_reading
Get the continuity test reading.
Returns: The continuity test reading.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
331 332 333 334 335 336 337 | |
get_dut_5v0_reading
Get the DUT 5V reading.
Return the DUT 5V reading from the analog MUX. This voltage is read via a voltage divider and is corrected by a scalar value of 2.
Returns: The DUT 5V reading.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
339 340 341 342 343 344 345 346 347 348 | |
get_dut_3v3_reading
Get the DUT 3.3V reading.
Measure the DUT 3.3V voltage from the analog MUX. This voltage is read via a voltage divider and is corrected by a scalar value of 2.
Returns: The DUT 3.3V reading.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
350 351 352 353 354 355 356 357 358 359 | |
get_dut_1v1_reading
Get the DUT 1.1V reading.
Returns: The DUT 1.1V reading.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
361 362 363 364 365 366 367 | |
close
Closes all connections to the test fixture.
Source code in test_plans/fixtur-ctrl-func-test/hardware_utils/interface.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |