@@ -49,16 +49,13 @@ def __init__(self, device: Handler = None):
49
49
self ._device .get_ack ()
50
50
self .configure (125e3 ) # 125 kHz is as low as the PSLab can go.
51
51
52
-
53
- def configure (self , frequency : float , smbus : bool = False ):
54
- """Configure frequency and bus type.
52
+ def configure (self , frequency : float ):
53
+ """Configure bus frequency.
55
54
56
55
Parameters
57
56
----------
58
57
frequency : float
59
58
Frequency of SCL in Hz.
60
- smbus : bool, optional
61
- Use SMBus standard instead of I2C. False by default.
62
59
"""
63
60
brgval = int ((1 / frequency - self ._SCL_DELAY ) * CLOCK_RATE - 2 )
64
61
@@ -73,24 +70,6 @@ def configure(self, frequency: float, smbus: bool = False):
73
70
e = f"Frequency must be between { min_frequency } and { max_frequency } Hz."
74
71
raise ValueError (e )
75
72
76
- self ._configure_smbus (smbus )
77
-
78
- def _configure_smbus (self , enable : bool ):
79
- """Configure bus as SMBus instead of normal I2C.
80
-
81
- In normal I2C, V_ILMAX (logic level LOW threshold) is 150 mV, and
82
- V_IHMIN (logic level HIGH threshold) is 3.5 V. The SMBus standard uses
83
- V_ILMAX = 800 mV and V_IHMIN = 2.1 V instead.
84
- """
85
- self ._device .send_byte (CP .I2C_HEADER )
86
-
87
- if enable :
88
- self ._device .send_byte (CP .I2C_ENABLE_SMBUS )
89
- else :
90
- self ._device .send_byte (CP .I2C_DISABLE_SMBUS )
91
-
92
- self ._device .get_ack ()
93
-
94
73
def _get_i2c_frequency (self , brgval : int ) -> float :
95
74
return 1 / ((brgval + 2 ) / CLOCK_RATE + self ._SCL_DELAY )
96
75
0 commit comments