PX4 Firmware
PX4 Autopilot Software http://px4.io
PixArt_PAW3902JF_Registers.hpp
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2019 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 #pragma once
35 
37 {
38 
39 static constexpr uint8_t PRODUCT_ID = 0x49; // shared with the PMW3901
40 static constexpr uint8_t REVISION_ID = 0x01;
41 
42 static constexpr uint32_t SAMPLE_INTERVAL_MODE_0{1000000 / 126}; // 126 fps
43 static constexpr uint32_t SAMPLE_INTERVAL_MODE_1{1000000 / 126}; // 126 fps
44 static constexpr uint32_t SAMPLE_INTERVAL_MODE_2{1000000 / 50}; // 50 fps
45 
46 static constexpr uint64_t T_SWW{11}; // 10.5 microseconds
47 static constexpr uint64_t T_SRR{2}; // 1.5 microseconds
48 
49 enum Register : uint8_t {
50  Product_ID = 0x00,
51  Revision_ID = 0x01,
52  Motion = 0x02,
53  Delta_X_L = 0x03,
54  Delta_X_H = 0x04,
55  Delta_Y_L = 0x05,
56  Delta_Y_H = 0x06,
57  Squal = 0x07,
58  RawData_Sum = 0x08,
61  Shutter_Lower = 0x0B,
62  Shutter_Upper = 0x0C,
63 
64  Observation = 0x15,
65  Motion_Burst = 0x16,
66 
68 
69  Resolution = 0x4E,
70 
71 };
72 
73 enum Product_ID_Bit : uint8_t {
74  Reset = 0x5A,
75 };
76 
77 
78 enum class Mode {
79  Bright = 0,
80  LowLight = 1,
81  SuperLowLight = 2,
82 };
83 
85  uint8_t Motion;
86  uint8_t Observation;
87  uint8_t Delta_X_L;
88  uint8_t Delta_X_H;
89  uint8_t Delta_Y_L;
90  uint8_t Delta_Y_H;
91  uint8_t SQUAL;
92  uint8_t RawData_Sum;
93  uint8_t Maximum_RawData;
94  uint8_t Minimum_RawData;
95  uint8_t Shutter_Upper;
96  uint8_t Shutter_Lower;
97 };
98 
99 }
static constexpr uint64_t T_SRR
static constexpr uint64_t T_SWW
static constexpr uint32_t SAMPLE_INTERVAL_MODE_2
static constexpr uint32_t SAMPLE_INTERVAL_MODE_0
static constexpr uint32_t SAMPLE_INTERVAL_MODE_1
static constexpr uint8_t PRODUCT_ID
static constexpr uint8_t REVISION_ID