Init basesystem source codes.
[staging/basesystem.git] / vehicleservice / positioning / server / include / Sensor / GpsInt.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 /*****************************************************************************************
18 *  File name  :GpsInt.h
19 *  System name  :PastModel002
20 *  Process name  :Vehicle
21 *  Overview        :GPS interrupt thread header
22 ******************************************************************************************/
23 #ifndef  POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_
24 #define  POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_
25
26 /*******************************************************************************
27 * Include File
28 *******************************************************************************/
29
30 /*******************************************************************************
31 * Define
32 *******************************************************************************/
33 #define  GPS_IRQ_ADR                  0x00000306UL    /* GPS IRQ addresses        */
34 #define GPS_MASK_6BIT                 0x00000040UL    /* GPS IRQ bit-mask position    */
35
36 #define GPS_GPIO0_IRQSTATUS_0_OFFSET          0x0000002CUL    /* IRQSTATUS_0 offset    */
37 #define GPS_GPIO0_IRQSTATUS_SET_0_OFFSET      0x00000034UL    /* IRQSTATUS_SET_0 offset  */
38 #define GPS_GPIO0_RISINGDETECT_OFFSET         0x00000148UL    /* RISINGDETECT offsets    */
39
40 /* IRQSTATUS_0 address */
41 #define GPS_GPIO0_IRQSTATUS_0_ADDR            (DM816X_GPIO0_BASE + GPS_GPIO0_IRQSTATUS_0_OFFSET)
42
43 /* IRQSTATUS_SET_0 address */
44 #define GPS_GPIO0_IRQSTATUS_SET_0_ADDR        (DM816X_GPIO0_BASE + GPS_GPIO0_IRQSTATUS_SET_0_OFFSET)
45
46 /* RISINGDETECT addresses */
47 #define GPS_GPIO0_RISINGDETECT_ADDR           (DM816X_GPIO0_BASE + GPS_GPIO0_RISINGDETECT_OFFSET)
48
49 /*******************************************************************************
50 * Struct
51 *******************************************************************************/
52 typedef struct {
53     DWORD        irq_status_reg;    /* Interrupt Source Clear Register    */
54     DWORD        irq_status_set_reg;  /* Interrupt enable register      */
55     DWORD        rising_detect_reg;  /* Rising edge detection setting register  */
56 } GPS_INT_DATA;
57
58 /***************************
59 *  Function prototype declaration
60 ***************************/
61 RET_API  DEVGpsIntInitial(void);
62 BOOL  DEVGpsIntMapDevice(void);
63 void  DEVGpsIntUnMapDevice(void);
64 void  DEVGpsIntSetInterupt(void);
65 void  DEVGpsIntIntRegClear(void);
66 RET_API  DEVGpsIntSndMsg(void);
67
68 #endif  // POSITIONING_SERVER_INCLUDE_SENSOR_GPSINT_H_