1- from ..abstract_parts import *
21from .JlcPart import JlcPart
2+ from ..abstract_parts import *
33
44
55class Lsm6dsv16x_Device (InternalSubcircuit , FootprintBlock , JlcPart ):
66 def __init__ (self ) -> None :
77 super ().__init__ ()
88 self .vdd = self .Port (VoltageSink (
9- voltage_limits = (1.71 , 3.6 )* Volt ,
10- current_draw = (2.6 * uAmp , 0.65 * mAmp ) # Values for low-power and high-performance modes
9+ voltage_limits = (1.71 , 3.6 ) * Volt ,
10+ current_draw = (2.6 * uAmp , 0.65 * mAmp ) # Values for low-power and high-performance modes
1111 ))
1212 self .vddio = self .Port (VoltageSink (
13- voltage_limits = (1.08 , 3.6 ) * Volt # Extended range
13+ voltage_limits = (1.08 , 3.6 ) * Volt # Extended range
1414 ))
1515 self .gnd = self .Port (Ground ())
1616
1717 dio_model = DigitalBidir .from_supply (
1818 self .gnd , self .vddio ,
19- voltage_limit_abs = (- 0.3 * Volt , self .vddio .voltage_limits .upper ()+ 0.3 ),
19+ voltage_limit_abs = (- 0.3 * Volt , self .vddio .voltage_limits .upper () + 0.3 ),
2020 # datasheet states abs volt to be [0.3, VDD_IO+0.3], likely a typo
21- current_limits = (- 4 , 4 )* mAmp ,
21+ current_limits = (- 4 , 4 ) * mAmp ,
2222 input_threshold_factor = (0.3 , 0.7 )
2323 )
2424 self .i2c = self .Port (I2cTarget (dio_model ))
2525
2626 dout_model = DigitalSource .low_from_supply (self .gnd )
27- self .int1 = self .Port (dout_model , optional = True , doc = "can be configured as push-pull / open-drain" )
28- self .int2 = self .Port (dout_model , optional = True , doc = "can be configured as push-pull / open-drain" )
27+ self .int1 = self .Port (dout_model , optional = True )
28+ self .int2 = self .Port (dout_model , optional = True )
2929
3030 self .qvar1 = self .Port (Passive (), optional = True )
3131 self .qvar2 = self .Port (Passive (), optional = True )
@@ -55,10 +55,12 @@ def contents(self) -> None:
5555 self .assign (self .lcsc_part , 'C5267406' )
5656 self .assign (self .actual_basic_part , False )
5757
58+
5859class Lsm6dsv16x (Accelerometer , Gyroscope , DefaultExportBlock ):
5960 """Integrated High-edn smartphone 3d accelerometer (ranging over +/- 2/4/8/16 g) and 3d gyroscope
6061 (ranging over +/- 125/250/500/1000/2000 dps). Onboard sensor fusion for quaternion calculation.
6162 Supports external qvar for tap detections, etc."""
63+
6264 def __init__ (self ):
6365 super ().__init__ ()
6466 self .ic = self .Block (Lsm6dsv16x_Device ())
@@ -67,14 +69,15 @@ def __init__(self):
6769 self .pwr_io = self .Export (self .ic .vddio , default = self .pwr , doc = "IO supply voltage" )
6870
6971 self .i2c = self .Export (self .ic .i2c )
70- self .int1 = self .Export (self .ic .int1 , optional = True , doc = "Programmable interrupt" )
71- self .int2 = self .Export (self .ic .int2 , optional = True , doc = "Programmable interrupt" )
72+ self .int1 = self .Export (self .ic .int1 , optional = True ,
73+ doc = "Programmable interrupt. This can be configured as push-pull / open-drain." )
74+ self .int2 = self .Export (self .ic .int2 , optional = True ,
75+ doc = "Programmable interrupt. This can be configured as push-pull / open-drain." )
7276
7377 self .qvar1 = self .Export (self .ic .qvar1 , optional = True , doc = "qvar input pin 1" )
7478 self .qvar2 = self .Export (self .ic .qvar2 , optional = True , doc = "qvar input pin 2" )
7579
7680 def contents (self ):
7781 super ().contents ()
78- self .vdd_cap = self .Block (DecouplingCapacitor (100 * nFarad (tol = 0.2 ))).connected (self .gnd , self .ic .vdd )
79- self .vddio_cap = self .Block (DecouplingCapacitor (100 * nFarad (tol = 0.2 ))).connected (self .gnd , self .ic .vddio )
80-
82+ self .vdd_cap = self .Block (DecouplingCapacitor (100 * nFarad (tol = 0.2 ))).connected (self .gnd , self .ic .vdd )
83+ self .vddio_cap = self .Block (DecouplingCapacitor (100 * nFarad (tol = 0.2 ))).connected (self .gnd , self .ic .vddio )
0 commit comments