-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDS_GPMS_proc.h
119 lines (93 loc) · 3 KB
/
DS_GPMS_proc.h
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
115
116
117
118
119
/*!\file DS_GPMS_proc.h
** \author SMFSW
** \copyright MIT (c) 2017-2024, SMFSW
** \brief DS-GPM.S Driver procedures
** \details DS-GPM.S: 99 Channel Positioning System (GPS + GLONASS) Shield
**/
/****************************************************************/
#ifndef __DS_GPMS_PROC_H__
#define __DS_GPMS_PROC_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "sarmfsw.h"
#include "DS_GPMS.h"
#if defined(HAL_I2C_MODULE_ENABLED)
/****************************************************************/
// TODO: doxygen
// *****************************************************************************
// Section: Constants
// *****************************************************************************
// *****************************************************************************
// Section: Types
// *****************************************************************************
/*!\struct GPMS_date
** \brief DS-GPM.S Date struct
**/
typedef struct GPMS_date {
uint16_t Year; //!< Year
uint8_t Month; //!< Month
uint8_t Day; //!< Day
} GPMS_date;
/*!\struct GPMS_hour
** \brief DS-GPM.S Time of day struct
**/
typedef struct GPMS_hour {
uint8_t Hours; //!< Hours
uint8_t Minutes; //!< Minutes
uint8_t Seconds; //!< Seconds
} GPMS_hour;
/*!\struct GPMS_coord
** \brief DS-GPM.S coordinate struct
**/
typedef struct GPMS_coord {
uint8_t Degrees; //!< Degrees coordinate
float Minutes; //!< Minutes coordinate
GPMS_direction Direction; //!< Direction coordinate
} GPMS_coord;
typedef struct GPMS_t {
GPMS_date Date;
GPMS_hour Hour;
GPMS_coord Latitude;
GPMS_coord Longitude;
uint16_t Altitude;
float Speed;
float Heading_True;
float Heading_Magnetic;
struct {
I2C_slave_t * slave_inst; //!< Slave structure
GPMS_mode Mode;
} cfg;
} GPMS_t;
extern GPMS_t GPMS; //!< GPMS User structure
// *****************************************************************************
// Section: Interface Routines
// *****************************************************************************
/******************/
/*** Procedures ***/
/******************/
/*!\brief Initialization Sequence for GPMS peripheral
** \weak GPMS Init sequence may be user implemented if custom initialization sequence needed
** \return FctERR - error code
**/
FctERR GPMS_Init_Sequence(void);
FctERR GPMS_Get_Date(GPMS_date * date);
FctERR GPMS_Get_Hour(GPMS_hour * hour);
FctERR GPMS_Get_Latitude(GPMS_coord * lat);
FctERR GPMS_Get_Longitude(GPMS_coord * lon);
FctERR GPMS_Get_Heading(float * heading, const GPMS_north type);
FctERR GPMS_Get_Speed(float * speed);
FctERR GPMS_Get_Altitude(uint16_t * altitude);
/*!\brief Handler for GPMS peripheral
** \weak GPMS handler may be user implemented to suit custom needs
** \note May be called periodically to handle GPMS tasks
** \return FctERR - error code
**/
FctERR GPMS_handler(void);
/****************************************************************/
#endif
#ifdef __cplusplus
}
#endif
#endif /* __DS_GPMS_PROC_H__ */
/****************************************************************/