Developer World
Spresense SDK Library v3.2.0-ebc0364
cxd56_gnss_nmea.h
1/****************************************************************************
2 * modules/include/gpsutils/cxd56_gnss_nmea.h
3 *
4 * Copyright 2018, 2019, 2023 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
44extern "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#define NMEA_GGA_ON 0x00000001
71#define NMEA_GLL_ON 0x00000002
72#define NMEA_GSA_ON 0x00000004
73#define NMEA_GSV_ON 0x00000008
74#define NMEA_GNS_ON 0x00000010
75#define NMEA_RMC_ON 0x00000020
76#define NMEA_VTG_ON 0x00000040
77#define NMEA_ZDA_ON 0x00000080
78#define NMEA_SARRLM_ON 0x00000800
79#define NMEA_QZQSM_ON 0x00004000
80#define NMEA_GST_ON 0x00100000
84typedef struct
85{
86 char *(*bufReq)(uint16_t);
87 void (*bufFree)(char *);
88 int (*out)(char *);
89 int (*outBin)(char *, uint32_t);
91
94typedef char NMEA_SPECTRUM_DATA[112];
95
98struct nmea_raw_s {
99 double lat;
100 double lon;
101 double alt;
102 float vel;
103 float dir;
104};
105
110void NMEA_InitMask(void);
111
120
148void NMEA_SetMask(uint32_t mask);
149
155uint32_t NMEA_GetMask(void);
156
164uint16_t NMEA_Output(const struct cxd56_gnss_positiondata_s* pposdat);
165
166/*
167 * Output QZSS Satellite Report sentence for Disaster and Crisis Management(DC Report)
168 * @param[in] dcrdat : QZSS DC report data
169 * @retval >0 : success, output total sentence size
170 * @retval <0 : fail
171 */
172
173uint16_t NMEA_DcReport_Output(const struct cxd56_gnss_dcreport_data_s* dcrdat);
174
175/*
176 * Output GAL SAR/RLM sentence
177 * @param[in] dat : Galileo SAR/RLM data
178 * @retval >0 : success, output total sentence size
179 * @retval <0 : fail
180 */
181
182uint16_t NMEA_GalSarRlm_Output(const struct cxd56_gnss_gal_sarrlm_s* dat);
183
192
193/*
194 * Extract raw data from position data
195 * @param[in] pposdat : Position data output from GNSS
196 * @param[out] rawdat : Extracted raw data
197 * @retval 0 : success
198 * @retval <0 : fail
199 */
200
201int NMEA_ExtractRawData(const struct cxd56_gnss_positiondata_s* pposdat,
202 struct nmea_raw_s *rawdat);
203
208void NMEA_InitMask2(void);
209
218
227void NMEA_SetMask2(uint32_t mask);
228
234uint32_t NMEA_GetMask2(void);
235
243uint16_t NMEA_Output2(const struct cxd56_gnss_positiondata2_s* pposdat);
244
245/*
246 * Output QZSS Satellite Report sentence for Disaster and Crisis
247 * Management(DC Report) for cxd5610 gnss
248 * @param[in] dcrdat : QZSS DC report data
249 * @retval >0 : success, output total sentence size
250 * @retval <0 : fail
251 */
252
253uint16_t NMEA_DcReport_Output2(const struct cxd56_gnss_dcreport_data_s* dcrdat);
254
255/* @} gnss_nmea */
256/* @} gnss */
257
258#ifdef __cplusplus
259}
260#endif /* __cplusplus */
261
262#endif /* __SDK_MODULES_INCLUDE_GPSUTILS_CXD56_GNSS_NMEA_H */
char NMEA_SPECTRUM_DATA[112]
Definition: cxd56_gnss_nmea.h:94
void NMEA_SetMask2(uint32_t mask)
uint16_t NMEA_Output(const struct cxd56_gnss_positiondata_s *pposdat)
uint16_t NMEA_OutputSpectrum(NMEA_SPECTRUM_DATA *spectrumdat)
uint32_t NMEA_GetMask2(void)
uint16_t NMEA_Output2(const struct cxd56_gnss_positiondata2_s *pposdat)
int NMEA_RegistOutputFunc(const NMEA_OUTPUT_CB *func)
int NMEA_RegistOutputFunc2(const NMEA_OUTPUT_CB *func)
void NMEA_InitMask(void)
void NMEA_InitMask2(void)
uint32_t NMEA_GetMask(void)
void NMEA_SetMask(uint32_t mask)
Definition: cxd56_gnss_nmea.h:85
Definition: gnss_type.h:774
Definition: gnss_type.h:798
Definition: gnss_type.h:1304
Definition: gnss_type.h:758
Definition: cxd56_gnss_nmea.h:98