Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / vehicleservice / positioning / client / include / Sensor_Common_API.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_
18 #define POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_
19 /******************************************************************************
20  * File name        :Sensor_Common_API.h
21  * System name        :PastModel002
22  * Sub System name    :Vehicle I/F Liblary,Sensor I/F Liblary
23  ******************************************************************************/
24
25 #include <vehicle_service/positioning_base_library.h>
26 #include <vehicle_service/POS_sensor_API.h>
27 #include "CommonDefine.h"
28
29 /************************************************************************
30  *            Definition                                                *
31  ************************************************************************/
32 /*----------------------------------------------------------------------*
33  *    ID data corresponding to the vehicle sensor information           *
34  *----------------------------------------------------------------------*/
35
36 /*
37  *  Note.
38  *  This feature needs to be defined by the vendor.
39  */
40
41 /* VEHICLE__DID */
42
43 /* ++ PastModel002 Support_UBX_Protocol_DID */
44 #define VEHICLE_DID_GPS_UBLOX_NAV_POSLLH                 0x80000060
45 #define VEHICLE_DID_GPS_UBLOX_NAV_STATUS                 0x80000061
46 #define VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC                0x80000062
47 #define VEHICLE_DID_GPS_UBLOX_NAV_VELNED                 0x80000063
48 #define VEHICLE_DID_GPS_UBLOX_NAV_DOP                    0x80000064
49 #define VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS                0x80000065
50 #define VEHICLE_DID_GPS_UBLOX_NAV_SVINFO                 0x80000066
51 #define VEHICLE_DID_GPS_UBLOX_NAV_CLOCK                  0x80000067
52 #define VEHICLE_DID_GPS_UBLOX_MON_HW                     0x80000068
53 #define VEHICLE_DID_GPS_UBLOX_ACK_ACK                    0x80000069
54 #define VEHICLE_DID_GPS_UBLOX_ACK_NAK                    0x8000006A
55 #define VEHICLE_DID_GPS_UBLOX_CFG_RST                    0x8000006B
56 #define VEHICLE_DID_GPS_UBLOX_AID_INI                    0x8000006C
57 #define VEHICLE_DID_GPS_UBLOX_AID_EPH                    0x8000006D
58 #define VEHICLE_DID_GPS_UBLOX_CFG_MSG                    0x8000006E
59 #define VEHICLE_DID_GPS_UBLOX_CFG_NAVX5                  0x8000006F
60 /* -- PastModel002 Support_UBX_Protocol_DID */
61
62 /* ++ used internally by the DR */
63 #define VEHICLE_DID_GPS_COUNTER                          0x8000001B
64 #define VEHICLE_DID_GYRO_EXT                             0x80000027
65
66 #define VEHICLE_DID_DR_LONGITUDE                         0x80000070
67 #define VEHICLE_DID_DR_LATITUDE                          0x80000071
68 #define VEHICLE_DID_DR_ALTITUDE                          0x80000072
69 #define VEHICLE_DID_DR_SPEED                             0x80000073
70 #define VEHICLE_DID_DR_HEADING                           0x80000074
71 #define VEHICLE_DID_DR_SNS_COUNTER                       0x80000075
72 #define VEHICLE_DID_DR_GYRO_OFFSET                       0x80000078
73 #define VEHICLE_DID_DR_GYRO_SCALE_FACTOR                 0x80000079
74 #define VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL           0x8000007A
75 #define VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR          0x8000007B
76 #define VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL    0x8000007C
77
78 /* -- used internally by the DR */
79
80 /* ++ PastModel002 Support_DID */
81 #define VEHICLE_DID_GYRO_TROUBLE                         0x80000080
82 #define VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL            0x80000081
83 #define VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL             0x80000082
84 #define VEHICLE_DID_GYRO_CONNECT_STATUS                  0x80000083
85 #define VEHICLE_DID_VALID_EPH_NUM                        0x80000084
86 /* -- PastModel002 Support_DID */
87
88 /* ++ Not supported by UBX_Protocol */
89 #define VEHICLE_DID_LOCATION                             0x80000020
90 #define VEHICLE_DID_GPS__CWORD82__NMEA                   POS_DID_GPS__CWORD82__NMEA
91 #define VEHICLE_DID_GPS__CWORD82__SETINITIAL             POS_DID_GPS__CWORD82__SETINITIAL
92 #define VEHICLE_DID_GPS__CWORD82__SETRMODE               0x80000034
93 #define VEHICLE_DID_GPS__CWORD82__SETRMODEEX             POS_DID_GPS__CWORD82__SETRMODEEX
94 #define VEHICLE_DID_GPS__CWORD82__SELSENT                POS_DID_GPS__CWORD82__SELSENT
95 #define VEHICLE_DID_GPS__CWORD82__SETSBAS                0x80000037
96 #define VEHICLE_DID_GPS__CWORD82__SETCONF1               0x80000038
97 #define VEHICLE_DID_GPS__CWORD82__SETCONF2               0x80000039
98 #define VEHICLE_DID_GPS__CWORD82__NMEA_GGA_INTERNAL      0xA050
99 #define VEHICLE_DID_GPS__CWORD82__NMEA_DGGA_INTERNAL     0xA051
100 #define VEHICLE_DID_GPS__CWORD82__NMEA_VTG_INTERNAL      0xA052
101 #define VEHICLE_DID_GPS__CWORD82__NMEA_RMC_INTERNAL      0xA053
102 #define VEHICLE_DID_GPS__CWORD82__NMEA_DRMC_INTERNAL     0xA054
103 #define VEHICLE_DID_GPS__CWORD82__NMEA_GLL_INTERNAL      0xA055
104 #define VEHICLE_DID_GPS__CWORD82__NMEA_DGLL_INTERNAL     0xA056
105 #define VEHICLE_DID_GPS__CWORD82__NMEA_GSA_INTERNAL      0xA057
106 #define VEHICLE_DID_GPS__CWORD82__NMEA_GSV1_INTERNAL     0xA058
107 #define VEHICLE_DID_GPS__CWORD82__NMEA_GSV2_INTERNAL     0xA059
108 #define VEHICLE_DID_GPS__CWORD82__NMEA_GSV3_INTERNAL     0xA060
109 #define VEHICLE_DID_GPS__CWORD82__NMEA_PJRDC_GP_3_INTERNAL     0xA061
110 #define VEHICLE_DID_LOCATION_LONLAT                      0x80000095
111 #define VEHICLE_DID_LOCATION_ALTITUDE                    0x80000096
112 #define VEHICLE_DID_MOTION_SPEED                         0x80000062
113 #define VEHICLE_DID_MOTION_HEADING                       0x80000097
114 #define VEHICLE_DID_GPS_TIME                             0x80000098
115 #define VEHICLE_DID_NAVIINFO_DIAG_GPS                    0x80000099
116 #define VEHICLE_DID_GPSWEEKCOR_CNT                       0x8000009A
117
118 #define VEHICLE_DID_GPS_CUSTOMDATA_NAVI                  0x800000A0
119 #define VEHICLE_DID_LOCATION_LONLAT_NAVI                 0x800000A1
120 #define VEHICLE_DID_LOCATION_ALTITUDE_NAVI               0x800000A2
121 #define VEHICLE_DID_MOTION_SPEED_NAVI                    0x800000A3
122 #define VEHICLE_DID_MOTION_HEADING_NAVI                  0x800000A4
123 #define VEHICLE_DID_SETTINGTIME                          0x800000A5
124
125 #define VEHICLE_DID_LOCATIONINFO_NMEA_NAVI               0x800000A6
126
127 #define VEHICLE_DID_MOTION_SPEED_INTERNAL                0x800000B0
128
129 #define VEHICLE_DID_GPS_TIME_RAW                         0x800000B1U   /* QAC 1281 */
130 #define VEHICLE_DID_GPS_WKNROLLOVER                      0x800000B2U   /* QAC 1281 */
131
132 #define VEHICLE_DID_SPEED_PULSE_VEHICLE                  (0x80000044UL)
133
134 /* -- Not supported by UBX_Protocol */
135
136 /*----------------------------------------------------------------------*
137  *    Vehicle sensor data information                                   *
138  *----------------------------------------------------------------------*/
139 #define VEHICLE_SNS_BATTERY_SHORT                        0x02          /* BATTERY SHORT        */
140 #define VEHICLE_SNS_THERMAL_SHUT_DOWN                    0x04          /* THERMAL SHUT DOWN    */
141 #define VEHICLE_SNS_UNKNOWN                              0x05          /* UNKNOWN                */
142
143 /* Missing information data */
144 #define VEHICLE_SNS_BREAK                                0x01          /* Data without continuity    */
145 #define VEHICLE_SNS_NORMAL                               0x00          /* Continuity of data    */
146
147 /*-------------------------------------------------------------------------------
148  * Time Status Return Values
149  -------------------------------------------------------------------------------*/
150 #define GPS_TIMESTS_OK                                   (0x00U)       /* Exact values from the satellites     */
151 /* Ignore->MISRA-C++ Rule 16-2-2 */
152 #define GPS_TIMESTS_NOTUTC                               (0x01U)       /* Time from satellite but UTC uncorrected  */
153 /* Ignore->MISRA-C++ Rule 16-2-2 */
154 #define GPS_TIMESTS_RTC                                  (0x02U)       /* RTC time   */
155 /* Ignore->MISRA-C++ Rule 16-2-2 */
156 #define GPS_TIMESTS_NG                                   (0x03U)       /* Anomaly Time  */
157 /* Ignore->MISRA-C++ Rule 16-2-2 */
158
159 /*-------------------------------------------------------------------------------
160  * NMEA Receive Flag
161  -------------------------------------------------------------------------------*/
162 #define VEHICLE_SNS__CWORD82__DRMC                             POS_SNS__CWORD82__DRMC
163 #define VEHICLE_SNS__CWORD82__GSA                              POS_SNS__CWORD82__GSA
164 #define VEHICLE_SNS__CWORD82__GSV_1                            POS_SNS__CWORD82__GSV_1
165 #define VEHICLE_SNS__CWORD82__GSV_2                            POS_SNS__CWORD82__GSV_2
166 #define VEHICLE_SNS__CWORD82__GSV_3                            POS_SNS__CWORD82__GSV_3
167 #define VEHICLE_SNS__CWORD82__PJRDC_GP_3                       POS_SNS__CWORD82__PJRDC_GP_3
168 #define VEHICLE_SNS__CWORD82__PJRDC_GP_4                       (0x40U)       /* Ignore->MISRA-C++ Rule 16-2-2 */
169
170 /************************************************************************
171 *            enum Definition                                                 *
172 *************************************************************************/
173
174 /*-------------------------------------------------------------------------------
175  * _CWORD71_ UNIT type
176  -------------------------------------------------------------------------------*/
177 typedef enum {
178     POS_TYPE_NONE = (0U),       /* Undefined               */
179     POS_TYPE_GRADE1,            /* GRADE1 (Integrated)      */
180     POS_TYPE_GRADE2             /* GRADE2 (Binary type)   */
181 } POS_TYPE;
182
183 /************************************************************************
184 *            typedef Definition                                            *
185 *************************************************************************/
186
187 typedef u_int32 DID;            /* DataID            */
188
189 /************************************************************************
190 *            struct Definition                                            *
191 *************************************************************************/
192
193 #endif  // POSITIONING_CLIENT_INCLUDE_SENSOR_COMMON_API_H_