Developer World
Spresense SDK Library v1.5.1-0e7b2b1
cxd56_gnss_nmea.h
1 /****************************************************************************
2  * modules/include/gpsutils/cxd56_gnss_nmea.h
3  *
4  * Copyright 2018,2019 Sony Semiconductor Solutions Corporation
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17  * the names of its contributors may be used to endorse or promote
18  * products derived from this software without specific prior written
19  * permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ****************************************************************************/
35 
36 #ifndef __SDK_MODULES_INCLUDE_GPSUTILS_CXD56_GNSS_NMEA_H
37 #define __SDK_MODULES_INCLUDE_GPSUTILS_CXD56_GNSS_NMEA_H
38 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif /* __cplusplus */
46 
47 /*-----------------------------------------------------------------------------
48  * include files
49  *---------------------------------------------------------------------------*/
50 
51 #include <stdint.h>
52 #include <arch/chip/gnss.h>
53 
66 #define NMEA_SENTENCE_MAX_LEN 160
67 
70 typedef struct
71 {
72  FAR char *(FAR *bufReq)(uint16_t);
73  void(FAR *bufFree)(FAR char *);
74  int(FAR *out)(FAR char *);
75  int(FAR *outBin)(FAR char *, uint32_t);
77 
80 typedef char NMEA_SPECTRUM_DATA[112];
81 
84 struct nmea_raw_s {
85  double lat;
86  double lon;
87  double alt;
88  float vel;
89  float dir;
90 };
91 
96 void NMEA_InitMask(void);
97 
105 int NMEA_RegistOutputFunc(FAR const NMEA_OUTPUT_CB *func);
106 
134 void NMEA_SetMask(uint32_t mask);
135 
141 uint32_t NMEA_GetMask(void);
142 
150 uint16_t NMEA_Output(FAR const struct cxd56_gnss_positiondata_s* pposdat);
151 
152 /*
153  * Output QZSS Satellite Report sentence for Disaster and Crisis Management(DC Report)
154  * @param[in] dcrdat : QZSS DC report data
155  * @retval >0 : success, output total sentence size
156  * @retval <0 : fail
157  */
158 uint16_t NMEA_DcReport_Output(const struct cxd56_gnss_dcreport_data_s* dcrdat);
159 
167 uint16_t NMEA_OutputSpectrum(FAR NMEA_SPECTRUM_DATA *spectrumdat);
168 
169 /*
170  * Extract raw data from position data
171  * @param[in] pposdat : Position data output from GNSS
172  * @param[out] rawdat : Extracted raw data
173  * @retval 0 : success
174  * @retval <0 : fail
175  */
176 
177 int NMEA_ExtractRawData(FAR const struct cxd56_gnss_positiondata_s* pposdat,
178  FAR struct nmea_raw_s *rawdat);
179 
180 /* @} gnss_nmea */
181 /* @} gnss */
182 
183 #ifdef __cplusplus
184 }
185 #endif /* __cplusplus */
186 
187 #endif /* __SDK_MODULES_INCLUDE_GPSUTILS_CXD56_GNSS_NMEA_H */
uint32_t NMEA_GetMask(void)
Definition: cxd56_gnss_nmea.h:84
Definition: gnss_type.h:445
Definition: cxd56_gnss_nmea.h:70
uint16_t NMEA_OutputSpectrum(FAR NMEA_SPECTRUM_DATA *spectrumdat)
uint32_t
Definition: cxd56_gnss_nmea.h:75
int NMEA_RegistOutputFunc(FAR const NMEA_OUTPUT_CB *func)
char NMEA_SPECTRUM_DATA[112]
Definition: cxd56_gnss_nmea.h:80
uint16_t NMEA_Output(FAR const struct cxd56_gnss_positiondata_s *pposdat)
void NMEA_InitMask(void)
Definition: gnss_type.h:431
void NMEA_SetMask(uint32_t mask)