Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laeToFMux.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: Laelaps
4 //
5 // File: laeToFMux.h
6 //
7 /*! \file
8  *
9  * $LastChangedDate: 2016-03-08 10:43:48 -0700 (Tue, 08 Mar 2016) $
10  * $Rev: 4346 $
11  *
12  * \brief Laelaps built-in Time-of-Flight Multiplexer Arduino sub-processor
13  * interface.
14  *
15  * The ToFMux serves to control up to 8 time-of-flight sensors.
16  *
17  * This file is included in both Laelaps software and the Arduino firmware.
18  * KEEP IT SIMPLE.
19  *
20  * \author Robin Knight (robin.knight@roadnarrows.com)
21  *
22  * \par Copyright
23  * \h_copy 2016-2017. RoadNarrows LLC.\n
24  * http://www.roadnarrows.com\n
25  * All Rights Reserved
26  */
27 /*
28  * @EulaBegin@
29  *
30  * Unless otherwise stated explicitly, all materials contained are copyrighted
31  * and may not be used without RoadNarrows LLC's written consent,
32  * except as provided in these terms and conditions or in the copyright
33  * notice (documents and software) or other proprietary notice provided with
34  * the relevant materials.
35  *
36  * IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY
37  * MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE
38  * BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
39  * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
40  * DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN
41  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  * THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
44  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
45  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
46  * "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
47  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
48  *
49  * @EulaEnd@
50  */
51 ////////////////////////////////////////////////////////////////////////////////
52 
53 #ifndef _LAE_TOF_MUX_H
54 #define _LAE_TOF_MUX_H
55 
56 //
57 // Time-of-Flight Mutliplexer Version
58 //
59 #ifdef LAE_TOF_MUX_FW_VERSION
60 #define LAE_TOF_MUX_VERSION LAE_TOF_MUX_FW_VERSION ///< fw version.
61 #else
62 #define LAE_TOF_MUX_VERSION 1 ///< sw/fw version.
63 #endif
64 
65 #undef LAE_USE_ALS ///< undef/define to [not] build firmware with ALS support
66 
67 /*!
68  * \brief The \h_laelaps namespace encapsulates all \h_laelaps related
69  * constructs.
70  */
71 #ifndef SWIG
72 namespace laelaps
73 {
74 #endif // SWIG
75  //----------------------------------------------------------------------------
76  // Common Interface Values
77  //----------------------------------------------------------------------------
78 
79  // sensors
80  const byte_t LaeToFMuxMinChan = 0; ///< minimum sensor channel number
81  const byte_t LaeToFMuxMaxChan = 7; ///< maximum sensor channel number
82  const byte_t LaeToFMuxNumOfChan = 8; ///< maximum number of channels
83 
84  // range sensor values
85  const byte_t LaeToFMuxRangeNoObj = 255; ///< no object detected
86  const byte_t LaeToFMuxRangeNoDev = 254; ///< no sensor device attached
87  const byte_t LaeToFMuxRangeErr = 253; ///< sensor error
88  const byte_t LaeToFMuxRangeMax = 200; ///< maximum distance (mm)
89  const byte_t LaeToFMuxRangeMin = 0; ///< minimum distance (mm)
90 
91  // ambient light sensor values
92  const float LaeToFMuxLuxNoLight = 0.0; ///< no light/no sensor
93 
94 
95  //----------------------------------------------------------------------------
96  // I2C Slave Binary Interface
97  //
98  // The I2C inteface is a big-endian, byte oriented, binary interface. Any
99  // signed numbers are in 2s-compliment format.
100  //
101  // The (Partial) BNF
102  //
103  // cmd ::= cmd_id, {byte}
104  // rsp ::= {byte}
105  // errrsp ::= fail, [cmd_id, [sensor, [abc_pat_0...]]]
106  //
107  // cmd_id ::= u8
108  // fail ::= u8 [0]
109  // sensor ::= u8 [0-7]
110  // abc_pat_k ::= u8 [A, B, C, ...]
111  //----------------------------------------------------------------------------
112 
113  //. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
114  // I2C Addressing and Packet Format
115  //. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
116 
117  const byte_t LaeI2CAddrToFMux = 0x71; ///< arduino \h_i2c 7-bit slave address
118 
119  const int LaeToFMuxI2CMaxCmdLen = 16; ///< maximum command length
120  const int LaeToFMuxI2CMaxRspLen = 32; ///< maximum response length
121 
122  const byte_t LaeToFMuxI2CArgFail = 0; ///< command failure response
123  const byte_t LaeToFMuxI2CArgPass = 1; ///< command success response
124 
125  //. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
126  // I2C Commands and Responses
127  //. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
128 
129  //
130  // Get firmware version command and response.
131  //
132  // Command format: cmd_id
133  // Response format: fw_version
134  //
135  // Argument data types and ranges:
136  // fw_version ::= u8 [1-255]
137  //
138  const byte_t LaeToFMuxI2CCmdIdGetVersion = 0; ///< command id
139  const byte_t LaeToFMuxI2CCmdLenGetVersion = 1; ///< command length (bytes)
140  const byte_t LaeToFMuxI2CRspLenGetVersion = 1; ///< response length (bytes)
141 
142  // ---
143 
144  //
145  // Get sensor identity command and response.
146  //
147  // Command format: cmd_id sensor
148  // Response format: model_id model_major model_minor module_major module_minor
149  // date_high date_low time_high time_low
150  //
151  // Argument data types and ranges:
152  // sensor ::= u8 [1-7]
153  // model_id ::= u8
154  // model_major ::= u8
155  // model_minor ::= u8
156  // modul3_major ::= u8
157  // modul3_minor ::= u8
158  // date_high ::= u8
159  // date_low ::= u8
160  // time_high ::= u8
161  // time_low ::= u8
162  //
163  // Conversions:
164  // date = date_high << 8 + date_low
165  // time = time_high << 8 + time_low
166  //
167  const byte_t LaeToFMuxI2CCmdIdGetIdent = 1; ///< command id
168  const byte_t LaeToFMuxI2CCmdLenGetIdent = 2; ///< command length (bytes)
169  const byte_t LaeToFMuxI2CRspLenGetIdent = 9; ///< response length (bytes)
170 
171  // ---
172 
173  //
174  // Get measured ranges.
175  //
176  // The sub-processor continuously takes range measurments from all devices
177  // and places the results in a range buffer.
178  //
179  // Command format: cmd_id
180  // Response format: dist_0 dist_1 ... dist_7
181  //
182  // Argument data types and ranges:
183  // dist_k ::= u8 [0-200, 253, 254, 255]
184  //
185  const byte_t LaeToFMuxI2CCmdIdGetRanges = 2; ///< command id
186  const byte_t LaeToFMuxI2CCmdLenGetRanges = 1; ///< command length (bytes)
187  const byte_t LaeToFMuxI2CRspLenGetRanges = 8; ///< response length (bytes)
188 
189  // ---
190 
191  //
192  // Get measured ambient light lux values.
193  //
194  // Command format: cmd_id
195  // Response format: _lux_0_3 lux_0_2 lux_0_1 lux_0_0
196  // _lux_1_3 lux_1_2 lux_1_1 lux_1_0
197  // ...
198  // _lux_7_3 lux_7_2 lux_7_1 lux_7_0
199  //
200  // Argument data types and ranges:
201  // _lux_k_n ::= u8
202  //
203  // Conversions:
204  // lux100_k = lux_k_3 << 24 + lux_k_2 << 16 + lux_k_1 << 8 + lux_k_0
205  // lux_k = lux100_k * 0.01
206  //
207  const byte_t LaeToFMuxI2CCmdIdGetLux = 3; ///< command id
208  const byte_t LaeToFMuxI2CCmdLenGetLux = 1; ///< command length (bytes)
209  const byte_t LaeToFMuxI2CRspLenGetLux = 32; ///< response length (bytes)
210 
211  const float LaeToFMuxI2CArgLuxScale = 0.01; ///< lux = value * scale
212  const float LaeToFMuxI2CArgLuxMult = 100.0; ///< value = lux * mult
213 
214  // ---
215 
216  //
217  // Tune time-of-flight range sensor.
218  //
219  // Command format: cmd_id sensor
220  // tof_offset tof_cross_talk_high tof_cross_talk_low
221  // Response format: pass
222  //
223  // Argument data types and ranges:
224  // sensor ::= u8 [0-7]
225  // tof_offset ::= u8
226  // tof_cross_talk_high ::= u8
227  // tof_cross_talk_low ::= u8
228  // tof_cross_talk ::= u16
229  // pass ::= u8 [1]
230  //
231  // Conversions:
232  // tof_cross_talk_high = tof_cross_talk >> 8
233  // tof_cross_talk_low = tof_cross_talk & 0xff
234  //
235  const byte_t LaeToFMuxI2CCmdIdTuneToFSensor = 4; ///< command id
236  const byte_t LaeToFMuxI2CCmdLenTuneToFSensor = 5; ///< command length
237  const byte_t LaeToFMuxI2CRspLenTuneToFSensor = 1; ///< response length
238 
239  // ---
240 
241  //
242  // Tune ambient light sensor.
243  //
244  // Command format: cmd_id sensor
245  // als_gain als_int_period_high als_int_period_low
246  // Response format: pass
247  //
248  // Argument data types and ranges:
249  // sensor ::= u8 [0-7]
250  // als_gain ::= u8 [0-7]
251  // als_int_period_high ::= u8
252  // als_int_period_low ::= u8
253  // als_int_period ::= u16 [1-512]
254  // pass ::= u8 [1]
255  //
256  // Conversions:
257  // als_int_period_high = als_int_period >> 8
258  // als_int_period_low = als_int_period & 0xff
259  //
260  const byte_t LaeToFMuxI2CCmdIdTuneAls = 5; ///< command id
261  const byte_t LaeToFMuxI2CCmdLenTuneAls = 5; ///< command length (bytes)
262  const byte_t LaeToFMuxI2CRspLenTuneAls = 1; ///< response length (bytes)
263 
264  // ---
265 
266  //
267  // Get tune parameters.
268  //
269  // Command format: cmd_id sensor
270  // Response format: tof_offset tof_cross_talk_high tof_cross_talk_low
271  // als_gain als_int_period_high als_int_period_low
272  //
273  // Argument data types and ranges:
274  // sensor ::= u8 [0-7]
275  // tof_offset ::= u8
276  // tof_cross_talk_high ::= u8
277  // tof_cross_talk_low ::= u8
278  // als_gain ::= u8 [0-7]
279  // als_int_period_high ::= u8
280  // als_int_period_low ::= u8
281  //
282  // Conversions:
283  // tof_cross_talk = tof_cross_talk_high << 8 + tof_cross_talk_low
284  // als_int_period = als_int_period_high << 8 + als_int_period_low
285  //
286  const byte_t LaeToFMuxI2CCmdIdGetTunes = 6; ///< command id
287  const byte_t LaeToFMuxI2CCmdLenGetTunes = 2; ///< command length (bytes)
288  const byte_t LaeToFMuxI2CRspLenGetTunes = 6; ///< response length (bytes)
289 
290 
291  //----------------------------------------------------------------------------
292  // Serial ASCII Interface
293  //
294  // The (Partial) BNF
295  //
296  // cmd ::= CMD_ID, {arg}, EOC
297  // rsp ::= CMD_ID, {arg}, EOR
298  // | ERROR_RSP_ID, CMD_ID, {arg}, EOR
299  //
300  // CMD_ID ::= 'a' | 'c' | 'd' | 'i' | 'p' | 'r' | 't' | 'v' | 'w'
301  // ERROR_RSP_ID ::= 'E'
302  // EOC ::= '\n'
303  // EOR ::= '\n'
304  //
305  // OP_GET_SET ::= 'g' | 's'
306  // OP_RESET ::= 'r'
307  // OP_STET ::= '-'
308  // OFF_ON ::= '0' | '1'
309  // MEASUREMENT ::= ALS | TOF
310  // ALS ::= 'a'
311  // TOF ::= 'd'
312  // NO_SENSOR ::= '-'
313  // SENSOR_ERROR ::= 'error'
314  // NO_OBJ ::= 'noobj'
315  //
316  // INT ::= OCTAL | DECIMAL | HEX
317  //
318  // OCTAL ::= ['-'] '0', {oct_digit}
319  // oct_digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7'
320  //
321  // DECIMAL ::= ['-'] nonzero_dec_digit, {dec_digit}
322  // nonzero_dec_digit ::= '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
323  // dec_digit ::= '0' | nonzero_dec_digit
324  //
325  // HEX ::= ['-'] hex_pre, hex_digit, {hex_digit}
326  // hex_pre ::= '0x' | '0X'
327  // hex_digit ::= dec_digit | hex_alpha_lower | hex_alpha_upper
328  // hex_alpha_lower ::= 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
329  // hex_alpha_upper ::= 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
330  //
331  // FLOAT ::= ['-'], dec_digit, {dec_digit}
332  // | ['-'], dec_digit, {dec_digit}, '.', {dec_digit}
333  // | ['-'], {dec_digit}, '.', dec_digit, {dec_digit}
334  //----------------------------------------------------------------------------
335 
336  // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
337  // Serial Message Format
338  // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
339 
340  // sizes
341  const byte_t LaeToFMuxSerMaxCmdLen = 80; ///< max command length (bytes)
342  const byte_t LaeToFMuxSerMaxCmdArgc = 8; ///< max cmd argument count
343  const byte_t LaeToFMuxSerMaxCmdArgLen = 8; ///< max cmd arg length (bytes)
344  const byte_t LaeToFMuxSerMaxRspLen = 100; ///< max rsp line length (bytes)
345  const byte_t LaeToFMuxSerMaxRspArgc = 10; ///< max rsp argument count
346  const byte_t LaeToFMuxSerMaxRspArgLen = 16; ///< max rsp arg length (bytes)
347 
348  // separators
349  const char LaeToFMuxSerEoC = '\n'; ///< end of command
350  const char LaeToFMuxSerEoR = '\n'; ///< end of response
351  const char LaeToFMuxSerSep = ' '; ///< argument separator(s)
352 
353  // common string arguments
354  const char LaeToFMuxSerArgNoSensor[] = "-"; ///< sensor not present
355  const char LaeToFMuxSerArgNoObj[] = "noobj"; ///< no object detected
356  const char LaeToFMuxSerArgSensorErr[] = "error"; ///< sensor meas. error
357  const char LaeToFMuxSerArgOff[] = "0"; ///< off state
358  const char LaeToFMuxSerArgOn[] = "1"; ///< on state
359  const char LaeToFMuxSerArgGet[] = "g"; ///< get operator
360  const char LaeToFMuxSerArgSet[] = "s"; ///< set operator
361  const char LaeToFMuxSerArgReset[] = "r"; ///< reset operator
362  const char LaeToFMuxSerArgStet[] = "-"; ///< leave as is
363  const char LaeToFMuxSerArgErrRsp[] = "E"; ///< response error
364 
365  // common values
366  const char LaeToFMuxSerOpGet = 'g'; ///< get operator value
367  const char LaeToFMuxSerOpSet = 's'; ///< set operator value
368  const char LaeToFMuxSerOpReset = 'r'; ///< reset operator value
369  const char LaeToFMuxSerOpStet = '-'; ///< reset operator value
370  const char LaeToFMuxSerOpBad = '?'; ///< unknown/bad operator
371 
372  // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
373  // Serial Commands and Responses
374  // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
375 
376  //
377  // Print help command and response.
378  //
379  // Command format: 'h' EOC
380  // Response format: synopsis_0 EOR
381  // synopsis_1 EOR
382  // ...
383  // synopsis_n EOR
384  // Arguments:
385  // synopsis_k ::= CMD_ID [args]
386  //
387  // Note: This command's use is intended only in user interactive mode.
388  //
389  const char LaeToFMuxSerCmdIdHelp = 'h'; ///< serial command id
390 
391  //
392  // Get firmware version command and response.
393  //
394  // Command format: 'v' EOC
395  // Response format: 'v' product subproc fw_version EOR
396  // Arguments:
397  // product ::= ROADNARROWS_PRODUCT_NAME
398  // subproc ::= SUBPROCESSOR_NAME
399  // fw_version ::= DECIMAL
400  //
401  const char LaeToFMuxSerCmdIdGetVersion = 'v'; ///< serial command id
402  const byte_t LaeToFMuxSerCmdArgcGetVersion = 1; ///< cmd argument count
403  const byte_t LaeToFMuxSerRspArgcGetVersion = 4; ///< rsp argument count
404 
405  //
406  // Configure firmware operation.
407  //
408  // Command format: 'c' op [config] EOC
409  // Response format: 'c' config EOR
410  // Arguments:
411  // op ::= OP_GET_SET
412  // config ::= als_state
413  // als_state ::= OFF_ON
414  //
415  const char LaeToFMuxSerCmdIdConfig = 'c'; ///< serial command id
416  const byte_t LaeToFMuxSerCmdArgcGetConfig = 2; ///< get cmd argument count
417  const byte_t LaeToFMuxSerCmdArgcSetConfig = 3; ///< set cmd argument count
418  const byte_t LaeToFMuxSerRspArgcConfig = 2; ///< rsp argument count
419 
420  //
421  // Get sensor identity command and response.
422  //
423  // Command format: 'i' sensor EOC
424  // Response format: 'i' model_id model_ver module_ver date time EOR
425  // Arguments:
426  // sensor ::= INT
427  // model_id ::= HEX
428  // model_ver ::= major.minor
429  // module_ver ::= major.minor
430  // date ::= DECIMAL
431  // time ::= DECIMAL
432  // major ::= DECIMAL
433  // minor ::= DECIMAL
434  //
435  const char LaeToFMuxSerCmdIdGetIdent = 'i'; ///< command id
436  const byte_t LaeToFMuxSerCmdArgcGetIdent = 2; ///< cmd argument count
437  const byte_t LaeToFMuxSerRspArgcGetIdent = 6; ///< rsp argument count
438 
439  //
440  // Get measured distances.
441  //
442  // The sub-processor continuously takes range measurments from all devices
443  // and places the results in a range buffer.
444  //
445  // Command format: 'd' EOC
446  // Response format: 'd' dist_0 dist_1 ... dist_7 EOR
447  // Arguments:
448  // dist_k ::= DECIMAL | NO_OBJ | SENSOR_ERROR | NO_SENSOR
449  //
450  const char LaeToFMuxSerCmdIdGetDist = 'd'; ///< command id
451  const byte_t LaeToFMuxSerCmdArgcGetDist = 1; ///< cmd argument count
452  const byte_t LaeToFMuxSerRspArgcGetDist = 9; ///< rsp argument count
453 
454  //
455  // Get measured ambient light sensor lux values.
456  //
457  // Command format: 'a' EOC
458  // Response format: 'a' lux_0 lux_1 ... lux_7 EOR
459  // Arguments:
460  // lux_k ::= FLOAT | SENSOR_ERROR | NO_SENSOR
461  //
462  const char LaeToFMuxSerCmdIdGetLux = 'a'; ///< command id
463  const byte_t LaeToFMuxSerCmdArgcGetLux = 1; ///< cmd argument count
464  const byte_t LaeToFMuxSerRspArgcGetLux = 9; ///< rsp argument count
465 
466  //
467  // Get/set tune parameters.
468  //
469  // Command format: 't' op sensor [tunes] EOC
470  // Response format: 't' tunes EOR
471  // Arguments:
472  // sensor ::= INT
473  // op ::= OP_GET_SET
474  // tunes ::= tof_offset tof_cross_talk als_gain als_int_period
475  // tof_offset ::= INT | OP_RESET | OP_STET
476  // tof_cross_talk ::= INT | OP_RESET | OP_STET
477  // als_gain ::= INT | OP_RESET | OP_STET
478  // als_int_period ::= INT | OP_RESET | OP_STET
479  //
480  const char LaeToFMuxSerCmdIdTunes = 't'; ///< command id
481  const byte_t LaeToFMuxSerCmdArgcGetTunes = 3; ///< cmd get argument count
482  const byte_t LaeToFMuxSerCmdArgcSetTunes = 7; ///< cmd set argument count
483  const byte_t LaeToFMuxSerRspArgcTunes = 5; ///< rsp argument count
484 
485  //
486  // Probe for connected ToF sensors.
487  //
488  // Command format: 'p' EOC
489  // Response format: 'p' count EOR
490  // Arguments:
491  // count ::= DECIMAL
492  //
493  const char LaeToFMuxSerCmdIdProbe = 'p'; ///< command id
494  const byte_t LaeToFMuxSerCmdArgcProbe = 1; ///< cmd argument count
495  const byte_t LaeToFMuxSerRspArgcProbe = 2; ///< rsp argument count
496 
497  //
498  // List state of ToF sensors.
499  //
500  // Command format: 'l' EOC
501  // Response format: 'l' state_0 state_1 ... state_7 EOR
502  // Arguments:
503  // state_k ::= {sensor | NO_SENSOR}
504  // sensor ::= DECIMAL
505  //
506  const char LaeToFMuxSerCmdIdList = 'l'; ///< command id
507  const byte_t LaeToFMuxSerCmdArgcList = 1; ///< cmd argument count
508  const byte_t LaeToFMuxSerRspArgcList = 9; ///< rsp argument count
509 
510  //
511  // Enable serial continuous output mode.
512  //
513  // Command format: 'o' output EOC
514  // Response format: 'o' output EOR
515  // Arguments:
516  // output ::= MEASUREMENT
517  // Continuous ambient light measurement output format:
518  // lux_0 lux_1 ... lux_7 EOR
519  // with:
520  // lux_k ::= FLOAT | SENSOR_ERROR | NO_SENSOR
521  // Continuous time-of-flight distance measurement output format:
522  // dist_0 dist_1 ... dist_7 EOR
523  // with:
524  // dist_k ::= DECIMAL | NO_OBJ | SENSOR_ERROR | NO_SENSOR
525  //
526  // Note: This command's use is intended only in user interactive mode.
527  // Note: Any command, except this command, turns off continuous output mode.
528  //
529  const char LaeToFMuxSerCmdIdCont = 'o'; ///< serial command id
530  const byte_t LaeToFMuxSerCmdArgcCont = 2; ///< cmd argument count
531  const byte_t LaeToFMuxSerRspArgcCont = 2; ///< rsp argument count
532 
533  //
534  // Read register value.
535  //
536  // Command format: 'r' sensor addr size EOC
537  // Response format: 'r' val EOR
538  // Arguments:
539  // sensor ::= INT
540  // addr ::= INT
541  // size ::= 1 | 2
542  // val ::= HEX
543  //
544  const char LaeToFMuxSerCmdIdReadReg = 'r'; ///< command id
545  const byte_t LaeToFMuxSerCmdArgcReadReg = 4; ///< cmd argument count
546  const byte_t LaeToFMuxSerRspArgcReadReg = 2; ///< rsp argument count
547 
548  //
549  // Write register value.
550  //
551  // Command format: 'w' sensor addr size val EOC
552  // Response format: 'w' val EOR
553  // Arguments:
554  // sensor ::= INT
555  // addr ::= INT
556  // size ::= 1 | 2
557  // val ::= INT
558  //
559  const char LaeToFMuxSerCmdIdWriteReg = 'w'; ///< command id
560  const byte_t LaeToFMuxSerCmdArgcWriteReg = 5; ///< cmd argument count
561  const byte_t LaeToFMuxSerRspArgcWriteReg = 2; ///< rsp argument count
562 
563  //
564  // Debug sensor.
565  //
566  // Command format: 'x' sensor enable
567  // Response format: 'x' enable EOR
568  // Arguments:
569  // sensor ::= INT
570  // enable ::= 0 | 1
571  //
572  const char LaeToFMuxSerCmdIdDebug = 'x'; ///< command id
573  const byte_t LaeToFMuxSerCmdArgcDebug = 3; ///< cmd argument count
574  const byte_t LaeToFMuxSerRspArgcDebug = 2; ///< rsp argument count
575 
576 #ifndef SWIG
577 } // namespace laelaps
578 #endif // SWIG
579 
580 
581 #endif // _LAE_TOF_MUX_H
const byte_t LaeToFMuxI2CRspLenGetLux
response length (bytes)
Definition: laeToFMux.h:209
const byte_t LaeToFMuxSerCmdArgcCont
cmd argument count
Definition: laeToFMux.h:530
const byte_t LaeToFMuxSerCmdArgcProbe
cmd argument count
Definition: laeToFMux.h:494
const byte_t LaeToFMuxMinChan
minimum sensor channel number
Definition: laeToFMux.h:80
const byte_t LaeToFMuxSerMaxCmdArgc
max cmd argument count
Definition: laeToFMux.h:342
const char LaeToFMuxSerCmdIdReadReg
command id
Definition: laeToFMux.h:544
const byte_t LaeToFMuxI2CCmdLenGetLux
command length (bytes)
Definition: laeToFMux.h:208
const byte_t LaeToFMuxSerRspArgcGetVersion
rsp argument count
Definition: laeToFMux.h:403
const char LaeToFMuxSerArgOn[]
on state
Definition: laeToFMux.h:358
const byte_t LaeToFMuxNumOfChan
maximum number of channels
Definition: laeToFMux.h:82
const byte_t LaeToFMuxSerCmdArgcReadReg
cmd argument count
Definition: laeToFMux.h:545
const char LaeToFMuxSerArgGet[]
get operator
Definition: laeToFMux.h:359
const byte_t LaeToFMuxI2CArgPass
command success response
Definition: laeToFMux.h:123
const byte_t LaeToFMuxI2CRspLenGetIdent
response length (bytes)
Definition: laeToFMux.h:169
const char LaeToFMuxSerArgSet[]
set operator
Definition: laeToFMux.h:360
const char LaeToFMuxSerCmdIdCont
serial command id
Definition: laeToFMux.h:529
const char LaeToFMuxSerCmdIdProbe
command id
Definition: laeToFMux.h:493
const char LaeToFMuxSerCmdIdGetIdent
command id
Definition: laeToFMux.h:435
const byte_t LaeToFMuxI2CRspLenTuneAls
response length (bytes)
Definition: laeToFMux.h:262
const byte_t LaeToFMuxSerCmdArgcDebug
cmd argument count
Definition: laeToFMux.h:573
const byte_t LaeToFMuxSerRspArgcCont
rsp argument count
Definition: laeToFMux.h:531
const char LaeToFMuxSerCmdIdGetVersion
serial command id
Definition: laeToFMux.h:401
const byte_t LaeToFMuxRangeNoDev
no sensor device attached
Definition: laeToFMux.h:86
const byte_t LaeToFMuxSerMaxCmdArgLen
max cmd arg length (bytes)
Definition: laeToFMux.h:343
const byte_t LaeToFMuxRangeMin
minimum distance (mm)
Definition: laeToFMux.h:89
const char LaeToFMuxSerArgOff[]
off state
Definition: laeToFMux.h:357
const char LaeToFMuxSerEoC
end of command
Definition: laeToFMux.h:349
const char LaeToFMuxSerCmdIdTunes
command id
Definition: laeToFMux.h:480
const byte_t LaeToFMuxMaxChan
maximum sensor channel number
Definition: laeToFMux.h:81
const byte_t LaeToFMuxI2CCmdIdGetLux
command id
Definition: laeToFMux.h:207
const char LaeToFMuxSerArgNoObj[]
no object detected
Definition: laeToFMux.h:355
const byte_t LaeToFMuxI2CCmdIdTuneAls
command id
Definition: laeToFMux.h:260
const byte_t LaeToFMuxSerRspArgcGetIdent
rsp argument count
Definition: laeToFMux.h:437
const byte_t LaeToFMuxSerMaxRspLen
max rsp line length (bytes)
Definition: laeToFMux.h:344
const byte_t LaeToFMuxI2CRspLenGetRanges
response length (bytes)
Definition: laeToFMux.h:187
const byte_t LaeToFMuxI2CCmdLenGetTunes
command length (bytes)
Definition: laeToFMux.h:287
const byte_t LaeToFMuxI2CCmdLenTuneToFSensor
command length
Definition: laeToFMux.h:236
const char LaeToFMuxSerArgReset[]
reset operator
Definition: laeToFMux.h:361
const char LaeToFMuxSerCmdIdGetLux
command id
Definition: laeToFMux.h:462
const char LaeToFMuxSerEoR
end of response
Definition: laeToFMux.h:350
const char LaeToFMuxSerOpSet
set operator value
Definition: laeToFMux.h:367
const byte_t LaeToFMuxSerRspArgcConfig
rsp argument count
Definition: laeToFMux.h:418
const char LaeToFMuxSerCmdIdWriteReg
command id
Definition: laeToFMux.h:559
const byte_t LaeToFMuxI2CCmdIdGetVersion
command id
Definition: laeToFMux.h:138
const byte_t LaeToFMuxSerCmdArgcGetDist
cmd argument count
Definition: laeToFMux.h:451
const byte_t LaeToFMuxRangeErr
sensor error
Definition: laeToFMux.h:87
const byte_t LaeToFMuxSerRspArgcGetDist
rsp argument count
Definition: laeToFMux.h:452
const char LaeToFMuxSerCmdIdHelp
serial command id
Definition: laeToFMux.h:389
const byte_t LaeToFMuxI2CRspLenGetTunes
response length (bytes)
Definition: laeToFMux.h:288
const byte_t LaeToFMuxSerCmdArgcSetConfig
set cmd argument count
Definition: laeToFMux.h:417
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
Definition: laeAlarms.h:64
const byte_t LaeToFMuxSerCmdArgcGetConfig
get cmd argument count
Definition: laeToFMux.h:416
const char LaeToFMuxSerArgSensorErr[]
sensor meas. error
Definition: laeToFMux.h:356
const char LaeToFMuxSerCmdIdList
command id
Definition: laeToFMux.h:506
const byte_t LaeToFMuxRangeNoObj
no object detected
Definition: laeToFMux.h:85
const byte_t LaeToFMuxSerCmdArgcWriteReg
cmd argument count
Definition: laeToFMux.h:560
const char LaeToFMuxSerArgErrRsp[]
response error
Definition: laeToFMux.h:363
const byte_t LaeToFMuxSerCmdArgcGetVersion
cmd argument count
Definition: laeToFMux.h:402
const byte_t LaeToFMuxSerRspArgcList
rsp argument count
Definition: laeToFMux.h:508
const char LaeToFMuxSerArgNoSensor[]
sensor not present
Definition: laeToFMux.h:354
const char LaeToFMuxSerOpReset
reset operator value
Definition: laeToFMux.h:368
const int LaeToFMuxI2CMaxCmdLen
maximum command length
Definition: laeToFMux.h:119
const char LaeToFMuxSerCmdIdGetDist
command id
Definition: laeToFMux.h:450
const byte_t LaeToFMuxSerCmdArgcList
cmd argument count
Definition: laeToFMux.h:507
const byte_t LaeToFMuxSerCmdArgcGetTunes
cmd get argument count
Definition: laeToFMux.h:481
const byte_t LaeToFMuxSerRspArgcWriteReg
rsp argument count
Definition: laeToFMux.h:561
const int LaeToFMuxI2CMaxRspLen
maximum response length
Definition: laeToFMux.h:120
const byte_t LaeToFMuxI2CRspLenGetVersion
response length (bytes)
Definition: laeToFMux.h:140
const char LaeToFMuxSerArgStet[]
leave as is
Definition: laeToFMux.h:362
const byte_t LaeToFMuxRangeMax
maximum distance (mm)
Definition: laeToFMux.h:88
const byte_t LaeToFMuxI2CCmdIdGetRanges
command id
Definition: laeToFMux.h:185
const float LaeToFMuxI2CArgLuxScale
lux = value * scale
Definition: laeToFMux.h:211
const float LaeToFMuxI2CArgLuxMult
value = lux * mult
Definition: laeToFMux.h:212
const byte_t LaeToFMuxSerMaxRspArgc
max rsp argument count
Definition: laeToFMux.h:345
const byte_t LaeToFMuxSerMaxRspArgLen
max rsp arg length (bytes)
Definition: laeToFMux.h:346
const byte_t LaeToFMuxSerRspArgcProbe
rsp argument count
Definition: laeToFMux.h:495
const byte_t LaeToFMuxI2CCmdLenGetRanges
command length (bytes)
Definition: laeToFMux.h:186
const byte_t LaeToFMuxSerCmdArgcSetTunes
cmd set argument count
Definition: laeToFMux.h:482
const char LaeToFMuxSerSep
argument separator(s)
Definition: laeToFMux.h:351
const char LaeToFMuxSerOpBad
unknown/bad operator
Definition: laeToFMux.h:370
const char LaeToFMuxSerOpGet
get operator value
Definition: laeToFMux.h:366
const byte_t LaeToFMuxSerRspArgcGetLux
rsp argument count
Definition: laeToFMux.h:464
const char LaeToFMuxSerCmdIdDebug
command id
Definition: laeToFMux.h:572
const byte_t LaeI2CAddrToFMux
arduino I2C 7-bit slave address
Definition: laeToFMux.h:117
const float LaeToFMuxLuxNoLight
no light/no sensor
Definition: laeToFMux.h:92
const byte_t LaeToFMuxSerRspArgcReadReg
rsp argument count
Definition: laeToFMux.h:546
const char LaeToFMuxSerCmdIdConfig
serial command id
Definition: laeToFMux.h:415
const byte_t LaeToFMuxI2CCmdIdGetIdent
command id
Definition: laeToFMux.h:167
const byte_t LaeToFMuxSerCmdArgcGetIdent
cmd argument count
Definition: laeToFMux.h:436
const byte_t LaeToFMuxSerMaxCmdLen
max command length (bytes)
Definition: laeToFMux.h:341
const char LaeToFMuxSerOpStet
reset operator value
Definition: laeToFMux.h:369
const byte_t LaeToFMuxI2CCmdIdTuneToFSensor
command id
Definition: laeToFMux.h:235
const byte_t LaeToFMuxSerCmdArgcGetLux
cmd argument count
Definition: laeToFMux.h:463
const byte_t LaeToFMuxI2CCmdLenTuneAls
command length (bytes)
Definition: laeToFMux.h:261
const byte_t LaeToFMuxSerRspArgcTunes
rsp argument count
Definition: laeToFMux.h:483
const byte_t LaeToFMuxI2CCmdIdGetTunes
command id
Definition: laeToFMux.h:286
const byte_t LaeToFMuxSerRspArgcDebug
rsp argument count
Definition: laeToFMux.h:574
const byte_t LaeToFMuxI2CArgFail
command failure response
Definition: laeToFMux.h:122
const byte_t LaeToFMuxI2CRspLenTuneToFSensor
response length
Definition: laeToFMux.h:237
const byte_t LaeToFMuxI2CCmdLenGetIdent
command length (bytes)
Definition: laeToFMux.h:168
const byte_t LaeToFMuxI2CCmdLenGetVersion
command length (bytes)
Definition: laeToFMux.h:139