chen
2024-12-26 d517f3f5f4436f23839e344c3b2003e5eb6932e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*******************************************************************************
 * File Name         : GPS.h
 * Description       :
 * Created on        : 2019Äê3ÔÂ11ÈÕ
 * Author            : www.hido-studio.com
 *******************************************************************************/
#ifndef _GPS_H_
#define _GPS_H_
 
/*******************************************************************************
 *                              Include Files                                  *
 *******************************************************************************/
#include "HIDO_TypeDef.h"
#include "GPIO.h"
 
/*******************************************************************************
 *                                  Macro                                      *
 *******************************************************************************/
 
/*******************************************************************************
 *                             Type Definition                                 *
 *******************************************************************************/
typedef enum
{
    GPS_STATE_INVALID = 0,
    GPS_STATE_VALID,
} E_GPSState;
 
typedef enum
{
    GPS_LAT_SIGN_NORTH = 0,
    GPS_LAT_SIGN_SOUTH,
} E_GPSLatSign;
 
typedef enum
{
    GPS_LON_SIGN_EAST = 0,
    GPS_LON_SIGN_WEST,
} E_GPSLonSign;
 
typedef enum
{
    GPS_PIN_REST,
    GPS_PIN_EN,
 
    GPS_PIN_LAST,
} E_GPSPin;
 
typedef struct
{
    HIDO_UINT16 m_u16Speed;
    HIDO_UINT16 m_u16Dir; //direction
    HIDO_DOUBLE m_dLat; //latitude
    HIDO_DOUBLE m_dLon; //longitude
    E_GPSState m_eState;
    HIDO_UINT16 m_u16Year;
    HIDO_UINT8 m_u8Mon; //month
    HIDO_UINT8 m_u8Day;
    HIDO_UINT8 m_u8Hour;
    HIDO_UINT8 m_u8Min; //minute
    HIDO_UINT8 m_u8Sec; //second
}ST_GPS;
 
/*******************************************************************************
 *                             Global Function                                 *
 *******************************************************************************/
 
/*******************************************************************************
 * Function Name     : GPS_GetState
 * Description       : »ñÈ¡GPS¶¨Î»×´Ì¬
 * Input             : None
 * Output            : None
 * Return            : ¶¨Î»×´Ì¬ 0 1 2 3
 * Author            : www.hido-studio.com
 * Modified Date:    : 2021Äê1ÔÂ8ÈÕ
 *******************************************************************************/
HIDO_UINT8 GPS_GetState(HIDO_VOID);
 
/*******************************************************************************
 * Function Name     : GPS_PinRegister
 * Description       : GPSÄ£¿é¹Ü½Å×¢²á
 * Input             : _ePin ¹Ü½Å¶¨Òå
 *                   : _pstGPIOx GPIOx
 *                   : _u16GPIOPin GPIO_PIN_x
 * Output            : None
 * Return            : None
 * Author            : www.hido-studio.com
 * Modified Date:    : 2021Äê1ÔÂ8ÈÕ
 *******************************************************************************/
HIDO_VOID GPS_PinRegister(E_GPSPin _ePin, GPIO_TypeDef *_pstGPIOx, HIDO_UINT16 _u16GPIOPin);
 
/*******************************************************************************
 * Function Name     : GPS_Poll
 * Description       : GPSÂÖѯ´¦Àí
 * Input             : None
 * Output            : None
 * Return            : None
 * Author            : www.hido-studio.com
 * Modified Date:    : 2021Äê1ÔÂ8ÈÕ
 *******************************************************************************/
HIDO_VOID GPS_Poll(void);
 
/*******************************************************************************
 * Function Name     : GPS_Init
 * Description       : GPSÄ£¿é³õʼ»¯
 * Input             : None
 * Output            : None
 * Return            : None
 * Author            : www.hido-studio.com
 * Modified Date:    : 2021Äê1ÔÂ8ÈÕ
 *******************************************************************************/
HIDO_VOID GPS_Init(void);
 
#endif /* _GPS_H_ */