Skip to content

Commit 4d672c4

Browse files
committed
vl53l1x: Clean up configuration comments.
1 parent 33fc9ea commit 4d672c4

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

lib/vl53l1x/vl53l1x/device.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
VL53L1X_DEFAULT_CONFIGURATION = bytes(
44
[
5-
0x00, # 0x2d : set bit 2 and 5 to 1 for fast plus mode (1MHz I2C), else don't touch */
5+
0x00, # 0x2d : fast plus mode disabled (set bit 2 and 5 to 1 for 1MHz I2C) */
66
0x00, # 0x2e : bit 0 if I2C pulled up at 1.8V, else set bit 0 to 1 (pull up at AVDD) */
77
0x00, # 0x2f : bit 0 if GPIO pulled up at 1.8V, else set bit 0 to 1 (pull up at AVDD) */
8-
0x01, # 0x30 : set bit 4 to 0 for active high interrupt and 1 for active low (bits 3:0 must be 0x1), use SetInterruptPolarity() */
9-
0x02, # 0x31 : bit 1 = interrupt depending on the polarity, use CheckForDataReady() */
8+
0x01, # 0x30 : set bit 4 to 0 for active high interrupt and 1 for active low (bits 3:0 must be 0x1) */
9+
0x02, # 0x31 : bit 1 = interrupt depending on the polarity */
1010
0x00, # 0x32 : not user-modifiable */
1111
0x02, # 0x33 : not user-modifiable */
1212
0x08, # 0x34 : not user-modifiable */
@@ -27,7 +27,7 @@
2727
0x00, # 0x43 : not user-modifiable */
2828
0x00, # 0x44 : not user-modifiable */
2929
0x00, # 0x45 : not user-modifiable */
30-
0x20, # 0x46 : interrupt configuration 0->level low detection, 1-> level high, 2-> Out of window, 3->In window, 0x20-> New sample ready , TBC */
30+
0x20, # 0x46 : interrupt configuration 0x20 = new sample ready */
3131
0x0B, # 0x47 : not user-modifiable */
3232
0x00, # 0x48 : not user-modifiable */
3333
0x00, # 0x49 : not user-modifiable */
@@ -57,23 +57,23 @@
5757
0x01, # 0x61 : not user-modifiable */
5858
0xF1, # 0x62 : not user-modifiable */
5959
0x0D, # 0x63 : not user-modifiable */
60-
0x01, # 0x64 : Sigma threshold MSB (mm in 14.2 format for MSB+LSB), use SetSigmaThreshold(), default value 90 mm */
60+
0x01, # 0x64 : Sigma threshold MSB (mm in 14.2 format for MSB+LSB), default value 90 mm */
6161
0x68, # 0x65 : Sigma threshold LSB */
62-
0x00, # 0x66 : Min count Rate MSB (MCPS in 9.7 format for MSB+LSB), use SetSignalThreshold() */
62+
0x00, # 0x66 : Min count Rate MSB (MCPS in 9.7 format for MSB+LSB) */
6363
0x80, # 0x67 : Min count Rate LSB */
6464
0x08, # 0x68 : not user-modifiable */
6565
0xB8, # 0x69 : not user-modifiable */
6666
0x00, # 0x6a : not user-modifiable */
6767
0x00, # 0x6b : not user-modifiable */
68-
0x00, # 0x6c : Intermeasurement period MSB, 32 bits register, use SetIntermeasurementInMs() */
68+
0x00, # 0x6c : Intermeasurement period MSB, 32 bits register */
6969
0x00, # 0x6d : Intermeasurement period */
7070
0x0F, # 0x6e : Intermeasurement period */
7171
0x89, # 0x6f : Intermeasurement period LSB */
7272
0x00, # 0x70 : not user-modifiable */
7373
0x00, # 0x71 : not user-modifiable */
74-
0x00, # 0x72 : distance threshold high MSB (in mm, MSB+LSB), use SetD:tanceThreshold() */
74+
0x00, # 0x72 : distance threshold high MSB (in mm, MSB+LSB) */
7575
0x00, # 0x73 : distance threshold high LSB */
76-
0x00, # 0x74 : distance threshold low MSB ( in mm, MSB+LSB), use SetD:tanceThreshold() */
76+
0x00, # 0x74 : distance threshold low MSB (in mm, MSB+LSB) */
7777
0x00, # 0x75 : distance threshold low LSB */
7878
0x00, # 0x76 : not user-modifiable */
7979
0x01, # 0x77 : not user-modifiable */
@@ -84,15 +84,15 @@
8484
0x00, # 0x7c : not user-modifiable */
8585
0x00, # 0x7d : not user-modifiable */
8686
0x02, # 0x7e : not user-modifiable */
87-
0xC7, # 0x7f : ROI center, use SetROI() */
88-
0xFF, # 0x80 : XY ROI (X=Width, Y=Height), use SetROI() */
87+
0xC7, # 0x7f : ROI center */
88+
0xFF, # 0x80 : XY ROI (X=Width, Y=Height) */
8989
0x9B, # 0x81 : not user-modifiable */
9090
0x00, # 0x82 : not user-modifiable */
9191
0x00, # 0x83 : not user-modifiable */
9292
0x00, # 0x84 : not user-modifiable */
9393
0x01, # 0x85 : not user-modifiable */
94-
0x01, # 0x86 : clear interrupt, use ClearInterrupt() */
95-
0x40, # 0x87 : start ranging, use StartRanging() or StopRanging(), If you want an automatic start after VL53L1X_init() call, put 0x40 in location 0x87 */
94+
0x01, # 0x86 : clear interrupt */
95+
0x40, # 0x87 : start ranging, put 0x40 for automatic start after init */
9696
]
9797
)
9898

@@ -107,9 +107,7 @@ def __init__(self, i2c, address=0x29):
107107
raise RuntimeError("Failed to find expected ID register values. Check wiring!")
108108
# write default configuration
109109
self.i2c.writeto_mem(self.address, 0x2D, VL53L1X_DEFAULT_CONFIGURATION, addrsize=16)
110-
# machine.lightsleep(100)
111-
# the API triggers this change in VL53L1_init_and_start_range() once a
112-
# measurement is started; assumes MM1 and MM2 are disabled
110+
# adjust timing; assumes MM1 and MM2 are disabled
113111
self._write_reg16(0x001E, self._read_reg16(0x0022) * 4)
114112
machine.lightsleep(200)
115113

0 commit comments

Comments
 (0)