Developer World
Spresense SDK Library v1.4.0-aa7f53a
gnss.h
Go to the documentation of this file.
1 /****************************************************************************
2  * bsp/include/arch/chip/gnss.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  ****************************************************************************/
39 #ifndef __SDK_BSP_INCLUDE_ARCH_CHIP_GNSS_H
40 #define __SDK_BSP_INCLUDE_ARCH_CHIP_GNSS_H
41 
42 #ifdef __cplusplus
43 #define EXTERN extern "C"
44 extern "C" {
45 #else
46 #define EXTERN extern
47 #endif
48 
49 /*-----------------------------------------------------------------------------
50  * include files
51  *---------------------------------------------------------------------------*/
52 
53 #include <arch/chip/gnss_type.h>
54 
73 #define CXD56_GNSS_IOCTL_START 1
74 
84 #define CXD56_GNSS_IOCTL_STOP 2
85 
101 #define CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM 3
102 
114 #define CXD56_GNSS_IOCTL_GET_SATELLITE_SYSTEM 4
115 
137 #define CXD56_GNSS_IOCTL_SET_RECEIVER_POSITION_ELLIPSOIDAL 5
138 
152 #define CXD56_GNSS_IOCTL_SET_RECEIVER_POSITION_ORTHOGONAL 6
153 
163 #define CXD56_GNSS_IOCTL_SET_OPE_MODE 7
164 
172 #define CXD56_GNSS_IOCTL_GET_OPE_MODE 8
173 
189 #define CXD56_GNSS_IOCTL_SET_TCXO_OFFSET 9
190 
198 #define CXD56_GNSS_IOCTL_GET_TCXO_OFFSET 10
199 
214 #define CXD56_GNSS_IOCTL_SET_TIME 11
215 
225 #define CXD56_GNSS_IOCTL_GET_ALMANAC 12
226 
236 #define CXD56_GNSS_IOCTL_SET_ALMANAC 13
237 
247 #define CXD56_GNSS_IOCTL_GET_EPHEMERIS 14
248 
258 #define CXD56_GNSS_IOCTL_SET_EPHEMERIS 15
259 
276 #define CXD56_GNSS_IOCTL_SAVE_BACKUP_DATA 16
277 
286 #define CXD56_GNSS_IOCTL_ERASE_BACKUP_DATA 17
287 
300 #define CXD56_GNSS_IOCTL_OPEN_CEP_DATA 18
301 
311 #define CXD56_GNSS_IOCTL_CLOSE_CEP_DATA 19
312 
321 #define CXD56_GNSS_IOCTL_CHECK_CEP_DATA 20
322 
349 #define CXD56_GNSS_IOCTL_GET_CEP_AGE 21
350 
360 #define CXD56_GNSS_IOCTL_RESET_CEP_FLAG 22
361 
366 #define CXD56_GNSS_IOCTL_RTK_START 23
367 
372 #define CXD56_GNSS_IOCTL_RTK_STOP 24
373 
378 #define CXD56_GNSS_IOCTL_RTK_SET_INTERVAL 25
379 
384 #define CXD56_GNSS_IOCTL_RTK_GET_INTERVAL 26
385 
390 #define CXD56_GNSS_IOCTL_RTK_SELECT_SATELLITE_SYSTEM 27
391 
396 #define CXD56_GNSS_IOCTL_RTK_GET_SATELLITE_SYSTEM 28
397 
402 #define CXD56_GNSS_IOCTL_RTK_SET_EPHEMERIS_ENABLER 29
403 
408 #define CXD56_GNSS_IOCTL_RTK_GET_EPHEMERIS_ENABLER 30
409 
417 #define CXD56_GNSS_IOCTL_AGPS_SET_ACQUIST 31
418 
426 #define CXD56_GNSS_IOCTL_AGPS_SET_FRAMETIME 32
427 
436 #define CXD56_GNSS_IOCTL_AGPS_SET_TAU_GPS 33
437 
445 #define CXD56_GNSS_IOCTL_AGPS_SET_TIME_GPS 34
446 
455 #define CXD56_GNSS_IOCTL_AGPS_CLEAR_RECEIVER_INFO 35
456 
464 #define CXD56_GNSS_IOCTL_AGPS_SET_TOW_ASSIST 36
465 
473 #define CXD56_GNSS_IOCTL_AGPS_SET_UTC_MODEL 37
474 
482 #define CXD56_GNSS_IOCTL_SPECTRUM_CONTROL 38
483 
497 #define CXD56_GNSS_IOCTL_FACTORY_START_TEST 39
498 
506 #define CXD56_GNSS_IOCTL_FACTORY_STOP_TEST 40
507 
515 #define CXD56_GNSS_IOCTL_FACTORY_GET_TEST_RESULT 41
516 
525 #define CXD56_GNSS_IOCTL_SIGNAL_SET 42
526 
535 #define CXD56_GNSS_IOCTL_PVTLOG_START 43
536 
543 #define CXD56_GNSS_IOCTL_PVTLOG_STOP 44
544 
552 #define CXD56_GNSS_IOCTL_PVTLOG_DELETE_LOG 45
553 
563 #define CXD56_GNSS_IOCTL_PVTLOG_GET_STATUS 46
564 
569 #define CXD56_GNSS_IOCTL_NAVMSG_START 47
570 
582 #define CXD56_GNSS_IOCTL_SET_VAR_EPHEMERIS 48
583 
595 #define CXD56_GNSS_IOCTL_GET_VAR_EPHEMERIS 49
596 
597 /* check macros for GNSS commands */
598 
599 #define CXD56_GNSS_IOCTL_INVAL 0
600 #define CXD56_GNSS_IOCTL_MAX 50
601 
602 /* @} gnss_ioctl */
603 
612 /* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for GD_Start */
613 /* @{ */
614 
615 #define CXD56_GNSS_STMOD_COLD 0
616 #define CXD56_GNSS_STMOD_WARM 1
617 #define CXD56_GNSS_STMOD_WARM_ACC2 2
618 #define CXD56_GNSS_STMOD_HOT 3
619 #define CXD56_GNSS_STMOD_HOT_ACC 4
620 #define CXD56_GNSS_STMOD_HOT_ACC2 5
621 #define CXD56_GNSS_STMOD_HOT_ACC3 6
622 #define CXD56_GNSS_STMOD_GSPQ CXD56_GNSS_STMOD_HOT_ACC3
623 /* @} */
624 
629 /* @{ */
630 
631 #define CXD56_GNSS_GPS_ALMANAC_SIZE 2048
633 #define CXD56_GNSS_GPS_EPHEMERIS_SIZE 3072
635 #define CXD56_GNSS_GLONASS_ALMANAC_SIZE 576
637 #define CXD56_GNSS_GLONASS_EPHEMERIS_SIZE 1152
639 #define CXD56_GNSS_QZSSL1CA_ALMANAC_SIZE 640
641 #define CXD56_GNSS_QZSSL1CA_EPHEMERIS_SIZE 960
642 /* @} */
643 
644 /*
645  * @name PVTLOG notify threshold of the stored data.
646 */
647 /* @{ */
648 
649 #define CXD56_GNSS_PVTLOG_THRESHOLD_FULL 0
650 #define CXD56_GNSS_PVTLOG_THRESHOLD_HALF 1
651 #define CXD56_GNSS_PVTLOG_THRESHOLD_ONE_DATA 2
653 /* @} */
654 
659 /* @{ */
662 #define CXD56_GNSS_READ_OFFSET_LAST_GNSS 0x0000
663 
666 #define CXD56_GNSS_READ_OFFSET_GNSS(N) (0x1000 + 0x800 * (N))
667 
670 #define CXD56_GNSS_READ_OFFSET_AGPS 0x5000
671 
674 #define CXD56_GNSS_READ_OFFSET_RTK 0x6000
675 
678 #define CXD56_GNSS_READ_OFFSET_GPSEPHEMERIS 0x7000
679 
682 #define CXD56_GNSS_READ_OFFSET_GLNEPHEMERIS 0x8000
683 
686 #define CXD56_GNSS_READ_OFFSET_SBAS 0x9000
687 
690 #define CXD56_GNSS_READ_OFFSET_DCREPORT 0x9800
691 
694 #define CXD56_GNSS_READ_OFFSET_SPECTRUM 0xa000
695 
698 #define CXD56_GNSS_READ_OFFSET_INFO 0xf000
699 
702 #define CXD56_GNSS_READ_OFFSET_PVTLOG 0x10000
703 
704 /* @} */
705 
710 /* @{ */
713 #define CXD56_GNSS_SIG_GNSS 0
714 
717 #define CXD56_GNSS_SIG_PVTLOG 2
718 
721 #define CXD56_GNSS_SIG_AGPS 3
722 
725 #define CXD56_GNSS_SIG_RTK 4
726 
729 #define CXD56_GNSS_SIG_SPECTRUM 5
730 
733 #define CXD56_GNSS_SIG_GPSEPHEMERIS 11
734 
737 #define CXD56_GNSS_SIG_GLNEPHEMERIS 12
738 
741 #define CXD56_GNSS_SIG_SBAS 14
742 
745 #define CXD56_GNSS_SIG_DCREPORT 15
746 
747 /* @} */
748 
749 /* @} gnss_defs */
750 
751 /****************************************************************************
752  * Public Types
753  ****************************************************************************/
764 {
765 
771  uint32_t mode;
772 
778  uint32_t cycle;
779 };
780 
786 {
787  uint32_t type;
790  FAR uint32_t *data;
792 };
793 
799 {
800  struct cxd56_gnss_date_s date;
801  struct cxd56_gnss_time_s time;
802 };
803 
809 {
810  double latitude;
811  double longitude;
812  double altitude;
813 };
814 
820 {
821  int32_t x;
822  int32_t y;
823  int32_t z;
824 };
825 
831 {
832  FAR uint32_t *data;
833  uint32_t size;
834  uint32_t counter;
835 };
836 
842 {
843  float age;
844  float cepi;
845 };
846 
852 {
853  FAR uint8_t *data;
854  uint16_t size;
855 };
856 
862 {
863  FAR uint8_t *data;
864  uint16_t size;
865 };
866 
872 {
873  FAR uint8_t *data;
874  uint16_t size;
875 };
876 
882 {
883  uint16_t sec;
884  uint32_t frac;
885 };
886 
892 {
893  struct cxd56_gnss_date_s date;
894  struct cxd56_gnss_time_s time;
895 };
896 
902 {
903  double taugps;
904 };
905 
911 {
912  uint8_t enable;
913  uint32_t time;
914  uint8_t point1;
915  uint8_t point2;
916  uint8_t step1;
917  uint8_t step2;
918 };
919 
925 {
926  uint32_t satellite;
927  uint32_t reserve1;
928  uint32_t reserve2;
929  uint32_t reserve3;
930 };
931 
937 {
938  float cn;
939  float doppler;
940 };
941 
953 {
954  int fd;
955  uint8_t enable;
956  uint8_t gnsssig;
957  int signo;
958  FAR void *data;
959 };
960 
967 {
968  int fd;
969  uint8_t gnsssig;
970  int signo;
971  FAR void *data;
972 };
973 
985 {
986  uint32_t cycle;
987  uint32_t threshold;
988 };
989 
995 {
996  struct cxd56_gnss_status_s status;
997 };
998 
1004 {
1005  int interval;
1006  uint32_t gnss;
1007  int ephout;
1008  uint64_t sbasout;
1009 };
1010 
1016 {
1017  uint32_t *data;
1018  uint32_t size;
1019 };
1020 
1026 {
1027  uint32_t type;
1029  uint32_t *data;
1030  uint32_t size;
1031 };
1032 
1033 /* @} gnss_datatypes */
1034 
1035 /* @} gnss */
1036 
1037 
1038 #undef EXTERN
1039 #ifdef __cplusplus
1040 }
1041 #endif
1042 
1043 #endif /* __SDK_BSP_INCLUDE_ARCH_CHIP_GNSS_H */
uint8_t enable
Definition: gnss.h:912
uint8_t gnsssig
Definition: gnss.h:969
Sattelite ephemeris data.
Definition: gnss.h:1015
uint16_t size
Definition: gnss.h:874
float doppler
Definition: gnss.h:939
FAR uint8_t * data
Definition: gnss.h:853
Signal spectrum output control parameter.
Definition: gnss.h:910
double altitude
Definition: gnss.h:812
uint32_t reserve3
Definition: gnss.h:929
FAR void * data
Definition: gnss.h:958
int interval
Definition: gnss.h:1005
uint32_t size
Definition: gnss.h:1030
PVTLOG setting Parameter. If the log interval(cycle) is smaller than the positioning interval...
Definition: gnss.h:984
Definition: gnss_type.h:261
double latitude
Definition: gnss.h:810
double taugps
Definition: gnss.h:903
uint16_t size
Definition: gnss.h:854
Stored logs status of PVTLOG.
Definition: gnss.h:994
uint16_t size
Definition: gnss.h:864
uint8_t enable
Definition: gnss.h:955
uint8_t step1
Definition: gnss.h:916
uint64_t sbasout
Definition: gnss.h:1008
date and time
Definition: gnss.h:798
uint32_t mode
Definition: gnss.h:771
int ephout
Definition: gnss.h:1007
ellipsoidal position
Definition: gnss.h:819
FAR void * data
Definition: gnss.h:971
int signo
Definition: gnss.h:970
tow assist data and size for AGPS
Definition: gnss.h:861
uint32_t size
Definition: gnss.h:1018
FAR uint8_t * data
Definition: gnss.h:873
double longitude
Definition: gnss.h:811
uint8_t point1
Definition: gnss.h:914
uint32_t type
Definition: gnss.h:1027
Factory test result.
Definition: gnss.h:936
FAR uint32_t * data
Definition: gnss.h:790
Information for use after being signaled to read data asychronously.
Definition: gnss.h:966
uint32_t reserve1
Definition: gnss.h:927
uint32_t type
Definition: gnss.h:787
High precision receiver time.
Definition: gnss.h:891
Definition: gnss_type.h:271
signal setting for reading data asychronously The field &#39;enable&#39; of struct cxd56_gnss_signal_setting_...
Definition: gnss.h:952
Factory test info.
Definition: gnss.h:924
FAR uint8_t * data
Definition: gnss.h:863
Definition: gnss_type.h:847
uint32_t * data
Definition: gnss.h:1017
float age
Definition: gnss.h:843
int fd
Definition: gnss.h:968
int signo
Definition: gnss.h:957
int32_t x
Definition: gnss.h:821
uint32_t cycle
Definition: gnss.h:986
uint8_t step2
Definition: gnss.h:917
Time from frame start[sec].
Definition: gnss.h:881
utc model data and size for AGPS
Definition: gnss.h:871
CEP age info.
Definition: gnss.h:841
float cepi
Definition: gnss.h:844
uint32_t time
Definition: gnss.h:913
RTK output setting.
Definition: gnss.h:1003
Sattelite almanac, ephemeris data.
Definition: gnss.h:785
uint16_t size
Definition: video.h:77
uint8_t gnsssig
Definition: gnss.h:956
uint8_t point2
Definition: gnss.h:915
float cn
Definition: gnss.h:938
different time between AGPS and GLONASS Time
Definition: gnss.h:901
ellipsoidal position
Definition: gnss.h:808
int32_t y
Definition: gnss.h:822
uint32_t satellite
Definition: gnss.h:926
acquist data and size for AGPS
Definition: gnss.h:851
uint32_t threshold
Definition: gnss.h:987
int fd
Definition: gnss.h:954
uint32_t reserve2
Definition: gnss.h:928
uint32_t gnss
Definition: gnss.h:1006
Sattelite ephemeris data.
Definition: gnss.h:1025
GNSS operation mode and cycle.
Definition: gnss.h:763
uint32_t cycle
Definition: gnss.h:778
uint16_t sec
Definition: gnss.h:883
int32_t z
Definition: gnss.h:823
uint32_t * data
Definition: gnss.h:1029
uint32_t frac
Definition: gnss.h:884
Definition: gnss.h:830