|
62 | 62 |
|
63 | 63 | class BusVoltageRange:
|
64 | 64 | """Constants for ``bus_voltage_range``"""
|
65 |
| - RANGE_16V = const(0x00) # set bus voltage range to 16V |
66 |
| - RANGE_32V = const(0x01) # set bus voltage range to 32V (default) |
| 65 | + RANGE_16V = 0x00 # set bus voltage range to 16V |
| 66 | + RANGE_32V = 0x01 # set bus voltage range to 32V (default) |
67 | 67 |
|
68 | 68 | class Gain:
|
69 | 69 | """Constants for ``gain``"""
|
70 |
| - DIV_1_40MV = const(0x00) # shunt prog. gain set to 1, 40 mV range |
71 |
| - DIV_2_80MV = const(0x01) # shunt prog. gain set to /2, 80 mV range |
72 |
| - DIV_4_160MV = const(0x02) # shunt prog. gain set to /4, 160 mV range |
73 |
| - DIV_8_320MV = const(0x03) # shunt prog. gain set to /8, 320 mV range |
| 70 | + DIV_1_40MV = 0x00 # shunt prog. gain set to 1, 40 mV range |
| 71 | + DIV_2_80MV = 0x01 # shunt prog. gain set to /2, 80 mV range |
| 72 | + DIV_4_160MV = 0x02 # shunt prog. gain set to /4, 160 mV range |
| 73 | + DIV_8_320MV = 0x03 # shunt prog. gain set to /8, 320 mV range |
74 | 74 |
|
75 | 75 | class ADCResolution:
|
76 | 76 | """Constants for ``bus_adc_resolution`` or ``shunt_adc_resolution``"""
|
77 |
| - ADCRES_9BIT_1S = const(0x00) # 9bit, 1 sample, 84us |
78 |
| - ADCRES_10BIT_1S = const(0x01) # 10bit, 1 sample, 148us |
79 |
| - ADCRES_11BIT_1S = const(0x02) # 11 bit, 1 sample, 276us |
80 |
| - ADCRES_12BIT_1S = const(0x03) # 12 bit, 1 sample, 532us |
81 |
| - ADCRES_12BIT_2S = const(0x09) # 12 bit, 2 samples, 1.06ms |
82 |
| - ADCRES_12BIT_4S = const(0x0A) # 12 bit, 4 samples, 2.13ms |
83 |
| - ADCRES_12BIT_8S = const(0x0B) # 12bit, 8 samples, 4.26ms |
84 |
| - ADCRES_12BIT_16S = const(0x0C) # 12bit, 16 samples, 8.51ms |
85 |
| - ADCRES_12BIT_32S = const(0x0D) # 12bit, 32 samples, 17.02ms |
86 |
| - ADCRES_12BIT_64S = const(0x0E) # 12bit, 64 samples, 34.05ms |
87 |
| - ADCRES_12BIT_128S = const(0x0F) # 12bit, 128 samples, 68.10ms |
| 77 | + ADCRES_9BIT_1S = 0x00 # 9bit, 1 sample, 84us |
| 78 | + ADCRES_10BIT_1S = 0x01 # 10bit, 1 sample, 148us |
| 79 | + ADCRES_11BIT_1S = 0x02 # 11 bit, 1 sample, 276us |
| 80 | + ADCRES_12BIT_1S = 0x03 # 12 bit, 1 sample, 532us |
| 81 | + ADCRES_12BIT_2S = 0x09 # 12 bit, 2 samples, 1.06ms |
| 82 | + ADCRES_12BIT_4S = 0x0A # 12 bit, 4 samples, 2.13ms |
| 83 | + ADCRES_12BIT_8S = 0x0B # 12bit, 8 samples, 4.26ms |
| 84 | + ADCRES_12BIT_16S = 0x0C # 12bit, 16 samples, 8.51ms |
| 85 | + ADCRES_12BIT_32S = 0x0D # 12bit, 32 samples, 17.02ms |
| 86 | + ADCRES_12BIT_64S = 0x0E # 12bit, 64 samples, 34.05ms |
| 87 | + ADCRES_12BIT_128S = 0x0F # 12bit, 128 samples, 68.10ms |
88 | 88 |
|
89 | 89 | class Mode:
|
90 | 90 | """Constants for ``mode``"""
|
91 |
| - POWERDOW = const(0x00) # power down |
92 |
| - SVOLT_TRIGGERED = const(0x01) # shunt voltage triggered |
93 |
| - BVOLT_TRIGGERED = const(0x02) # bus voltage triggered |
94 |
| - SANDBVOLT_TRIGGERED = const(0x03) # shunt and bus voltage triggered |
95 |
| - ADCOFF = const(0x04) # ADC off |
96 |
| - SVOLT_CONTINUOUS = const(0x05) # shunt voltage continuous |
97 |
| - BVOLT_CONTINUOUS = const(0x06) # bus voltage continuous |
98 |
| - SANDBVOLT_CONTINUOUS = const(0x07) # shunt and bus voltage continuous |
| 91 | + POWERDOW = 0x00 # power down |
| 92 | + SVOLT_TRIGGERED = 0x01 # shunt voltage triggered |
| 93 | + BVOLT_TRIGGERED = 0x02 # bus voltage triggered |
| 94 | + SANDBVOLT_TRIGGERED = 0x03 # shunt and bus voltage triggered |
| 95 | + ADCOFF = 0x04 # ADC off |
| 96 | + SVOLT_CONTINUOUS = 0x05 # shunt voltage continuous |
| 97 | + BVOLT_CONTINUOUS = 0x06 # bus voltage continuous |
| 98 | + SANDBVOLT_CONTINUOUS = 0x07 # shunt and bus voltage continuous |
99 | 99 |
|
100 | 100 | # SHUNT VOLTAGE REGISTER (R)
|
101 | 101 | _REG_SHUNTVOLTAGE = const(0x01)
|
|
0 commit comments