Developer World
Spresense SDK Library v2.0.1-3834d32
gnss.h
Go to the documentation of this file.
1 /****************************************************************************
2  * arch/arm/include/cxd56xx/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 __ARCH_ARM_INCLUDE_CXD56XX_GNSS_H
40 #define __ARCH_ARM_INCLUDE_CXD56XX_GNSS_H
41 
42 #ifdef __cplusplus
43 #define EXTERN extern "C"
44 extern "C"
45 {
46 #else
47 #define EXTERN extern
48 #endif
49 
50 /****************************************************************************
51  * include files
52  ****************************************************************************/
53 
54 #include <arch/chip/gnss_type.h>
55 
74 #define CXD56_GNSS_IOCTL_START 1
75 
85 #define CXD56_GNSS_IOCTL_STOP 2
86 
102 #define CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM 3
103 
115 #define CXD56_GNSS_IOCTL_GET_SATELLITE_SYSTEM 4
116 
138 #define CXD56_GNSS_IOCTL_SET_RECEIVER_POSITION_ELLIPSOIDAL 5
139 
153 #define CXD56_GNSS_IOCTL_SET_RECEIVER_POSITION_ORTHOGONAL 6
154 
164 #define CXD56_GNSS_IOCTL_SET_OPE_MODE 7
165 
173 #define CXD56_GNSS_IOCTL_GET_OPE_MODE 8
174 
190 #define CXD56_GNSS_IOCTL_SET_TCXO_OFFSET 9
191 
199 #define CXD56_GNSS_IOCTL_GET_TCXO_OFFSET 10
200 
215 #define CXD56_GNSS_IOCTL_SET_TIME 11
216 
226 #define CXD56_GNSS_IOCTL_GET_ALMANAC 12
227 
237 #define CXD56_GNSS_IOCTL_SET_ALMANAC 13
238 
248 #define CXD56_GNSS_IOCTL_GET_EPHEMERIS 14
249 
259 #define CXD56_GNSS_IOCTL_SET_EPHEMERIS 15
260 
277 #define CXD56_GNSS_IOCTL_SAVE_BACKUP_DATA 16
278 
287 #define CXD56_GNSS_IOCTL_ERASE_BACKUP_DATA 17
288 
301 #define CXD56_GNSS_IOCTL_OPEN_CEP_DATA 18
302 
312 #define CXD56_GNSS_IOCTL_CLOSE_CEP_DATA 19
313 
322 #define CXD56_GNSS_IOCTL_CHECK_CEP_DATA 20
323 
350 #define CXD56_GNSS_IOCTL_GET_CEP_AGE 21
351 
361 #define CXD56_GNSS_IOCTL_RESET_CEP_FLAG 22
362 
367 #define CXD56_GNSS_IOCTL_RTK_START 23
368 
373 #define CXD56_GNSS_IOCTL_RTK_STOP 24
374 
379 #define CXD56_GNSS_IOCTL_RTK_SET_INTERVAL 25
380 
385 #define CXD56_GNSS_IOCTL_RTK_GET_INTERVAL 26
386 
391 #define CXD56_GNSS_IOCTL_RTK_SELECT_SATELLITE_SYSTEM 27
392 
397 #define CXD56_GNSS_IOCTL_RTK_GET_SATELLITE_SYSTEM 28
398 
403 #define CXD56_GNSS_IOCTL_RTK_SET_EPHEMERIS_ENABLER 29
404 
409 #define CXD56_GNSS_IOCTL_RTK_GET_EPHEMERIS_ENABLER 30
410 
418 #define CXD56_GNSS_IOCTL_AGPS_SET_ACQUIST 31
419 
427 #define CXD56_GNSS_IOCTL_AGPS_SET_FRAMETIME 32
428 
437 #define CXD56_GNSS_IOCTL_AGPS_SET_TAU_GPS 33
438 
446 #define CXD56_GNSS_IOCTL_AGPS_SET_TIME_GPS 34
447 
456 #define CXD56_GNSS_IOCTL_AGPS_CLEAR_RECEIVER_INFO 35
457 
465 #define CXD56_GNSS_IOCTL_AGPS_SET_TOW_ASSIST 36
466 
474 #define CXD56_GNSS_IOCTL_AGPS_SET_UTC_MODEL 37
475 
483 #define CXD56_GNSS_IOCTL_SPECTRUM_CONTROL 38
484 
498 #define CXD56_GNSS_IOCTL_FACTORY_START_TEST 39
499 
507 #define CXD56_GNSS_IOCTL_FACTORY_STOP_TEST 40
508 
516 #define CXD56_GNSS_IOCTL_FACTORY_GET_TEST_RESULT 41
517 
526 #define CXD56_GNSS_IOCTL_SIGNAL_SET 42
527 
536 #define CXD56_GNSS_IOCTL_PVTLOG_START 43
537 
544 #define CXD56_GNSS_IOCTL_PVTLOG_STOP 44
545 
553 #define CXD56_GNSS_IOCTL_PVTLOG_DELETE_LOG 45
554 
564 #define CXD56_GNSS_IOCTL_PVTLOG_GET_STATUS 46
565 
570 #define CXD56_GNSS_IOCTL_NAVMSG_START 47
571 
583 #define CXD56_GNSS_IOCTL_SET_VAR_EPHEMERIS 48
584 
596 #define CXD56_GNSS_IOCTL_GET_VAR_EPHEMERIS 49
597 
606 #define CXD56_GNSS_IOCTL_SET_USECASE 50
607 
615 #define CXD56_GNSS_IOCTL_GET_USECASE 51
616 
625 #define CXD56_GNSS_IOCTL_SET_1PPS_OUTPUT 52
626 
634 #define CXD56_GNSS_IOCTL_GET_1PPS_OUTPUT 53
635 
636 /* check macros for GNSS commands */
637 
638 #define CXD56_GNSS_IOCTL_INVAL 0
639 #define CXD56_GNSS_IOCTL_MAX 54
640 
641 /* @} gnss_ioctl */
642 
651 /* Same value to GD Start mode CXD56_GNSS_STMOD_XXXX for GD_Start */
652 /* @{ */
653 
654 #define CXD56_GNSS_STMOD_COLD 0
655 #define CXD56_GNSS_STMOD_WARM 1
656 #define CXD56_GNSS_STMOD_WARM_ACC2 2
657 #define CXD56_GNSS_STMOD_HOT 3
658 #define CXD56_GNSS_STMOD_HOT_ACC 4
659 #define CXD56_GNSS_STMOD_HOT_ACC2 5
660 #define CXD56_GNSS_STMOD_HOT_ACC3 6
661 #define CXD56_GNSS_STMOD_GSPQ CXD56_GNSS_STMOD_HOT_ACC3
662 /* @} */
663 
668 /* @{ */
669 
670 #define CXD56_GNSS_GPS_ALMANAC_SIZE 2048
672 #define CXD56_GNSS_GPS_EPHEMERIS_SIZE 3072
674 #define CXD56_GNSS_GLONASS_ALMANAC_SIZE 576
676 #define CXD56_GNSS_GLONASS_EPHEMERIS_SIZE 1152
678 #define CXD56_GNSS_QZSSL1CA_ALMANAC_SIZE 640
680 #define CXD56_GNSS_QZSSL1CA_EPHEMERIS_SIZE 960
681 /* @} */
682 
683 /*
684  * @name PVTLOG notify threshold of the stored data.
685 */
686 /* @{ */
687 
688 #define CXD56_GNSS_PVTLOG_THRESHOLD_FULL 0
689 #define CXD56_GNSS_PVTLOG_THRESHOLD_HALF 1
690 #define CXD56_GNSS_PVTLOG_THRESHOLD_ONE_DATA 2
692 /* @} */
693 
698 /* @{ */
701 #define CXD56_GNSS_READ_OFFSET_LAST_GNSS 0x0000
702 
705 #define CXD56_GNSS_READ_OFFSET_GNSS(N) (0x1000 + 0x800 * (N))
706 
709 #define CXD56_GNSS_READ_OFFSET_AGPS 0x5000
710 
713 #define CXD56_GNSS_READ_OFFSET_RTK 0x6000
714 
717 #define CXD56_GNSS_READ_OFFSET_GPSEPHEMERIS 0x7000
718 
721 #define CXD56_GNSS_READ_OFFSET_GLNEPHEMERIS 0x8000
722 
725 #define CXD56_GNSS_READ_OFFSET_SBAS 0x9000
726 
729 #define CXD56_GNSS_READ_OFFSET_DCREPORT 0x9800
730 
733 #define CXD56_GNSS_READ_OFFSET_SARRLM 0x9900
734 
737 #define CXD56_GNSS_READ_OFFSET_SPECTRUM 0xa000
738 
741 #define CXD56_GNSS_READ_OFFSET_INFO 0xf000
742 
745 #define CXD56_GNSS_READ_OFFSET_PVTLOG 0x10000
746 
747 /* @} */
748 
753 /* @{ */
756 #define CXD56_GNSS_SIG_GNSS 0
757 
760 #define CXD56_GNSS_SIG_PVTLOG 2
761 
764 #define CXD56_GNSS_SIG_AGPS 3
765 
768 #define CXD56_GNSS_SIG_RTK 4
769 
772 #define CXD56_GNSS_SIG_SPECTRUM 5
773 
776 #define CXD56_GNSS_SIG_GPSEPHEMERIS 11
777 
780 #define CXD56_GNSS_SIG_GLNEPHEMERIS 12
781 
784 #define CXD56_GNSS_SIG_SBAS 14
785 
788 #define CXD56_GNSS_SIG_DCREPORT 15
789 
792 #define CXD56_GNSS_SIG_SARRLM 16
793 
794 /* @} */
795 
796 /* @} gnss_defs */
797 
798 /****************************************************************************
799  * Public Types
800  ****************************************************************************/
811 {
817  uint32_t mode;
818 
824  uint32_t cycle;
825 };
826 
832 {
833  uint32_t type;
836  FAR uint32_t *data;
838 };
839 
845 {
846  struct cxd56_gnss_date_s date;
847  struct cxd56_gnss_time_s time;
848 };
849 
855 {
856  double latitude;
857  double longitude;
858  double altitude;
859 };
860 
866 {
867  int32_t x;
868  int32_t y;
869  int32_t z;
870 };
871 
877 {
878  FAR uint32_t *data;
879  uint32_t size;
880  uint32_t counter;
881 };
882 
888 {
889  float age;
890  float cepi;
891 };
892 
898 {
899  FAR uint8_t *data;
900  uint16_t size;
901 };
902 
908 {
909  FAR uint8_t *data;
910  uint16_t size;
911 };
912 
918 {
919  FAR uint8_t *data;
920  uint16_t size;
921 };
922 
928 {
929  uint16_t sec;
930  uint32_t frac;
931 };
932 
938 {
939  struct cxd56_gnss_date_s date;
940  struct cxd56_gnss_time_s time;
941 };
942 
948 {
949  double taugps;
950 };
951 
957 {
958  uint8_t enable;
959  uint32_t time;
960  uint8_t point1;
961  uint8_t point2;
962  uint8_t step1;
963  uint8_t step2;
964 };
965 
971 {
972  uint32_t satellite;
973  uint32_t reserve1;
974  uint32_t reserve2;
975  uint32_t reserve3;
976 };
977 
983 {
984  float cn;
985  float doppler;
986 };
987 
999 {
1000  int fd;
1001  uint8_t enable;
1002  uint8_t gnsssig;
1003  int signo;
1004  FAR void *data;
1005 };
1006 
1013 {
1014  int fd;
1015  uint8_t gnsssig;
1016  int signo;
1017  FAR void *data;
1018 };
1019 
1031 {
1032  uint32_t cycle;
1033  uint32_t threshold;
1034 };
1035 
1041 {
1042  struct cxd56_gnss_status_s status;
1043 };
1044 
1050 {
1051  int interval;
1052  uint32_t gnss;
1053  int ephout;
1054  uint64_t sbasout;
1055 };
1056 
1062 {
1063  uint32_t *data;
1064  uint32_t size;
1065 };
1066 
1072 {
1073  uint32_t type;
1075  uint32_t *data;
1076  uint32_t size;
1077 };
1078 
1079 /* @} gnss_datatypes */
1080 
1081 /* @} gnss */
1082 
1083 #undef EXTERN
1084 #ifdef __cplusplus
1085 }
1086 #endif
1087 
1088 #endif /* __ARCH_ARM_INCLUDE_CXD56XX_GNSS_H */
uint8_t enable
Definition: gnss.h:958
uint8_t gnsssig
Definition: gnss.h:1015
Sattelite ephemeris data.
Definition: gnss.h:1061
uint16_t size
Definition: gnss.h:920
float doppler
Definition: gnss.h:985
FAR uint8_t * data
Definition: gnss.h:899
Signal spectrum output control parameter.
Definition: gnss.h:956
double altitude
Definition: gnss.h:858
uint32_t reserve3
Definition: gnss.h:975
FAR void * data
Definition: gnss.h:1004
int interval
Definition: gnss.h:1051
uint32_t size
Definition: gnss.h:1076
PVTLOG setting Parameter. If the log interval(cycle) is smaller than the positioning interval...
Definition: gnss.h:1030
Definition: gnss_type.h:325
double latitude
Definition: gnss.h:856
double taugps
Definition: gnss.h:949
uint16_t size
Definition: gnss.h:900
Stored logs status of PVTLOG.
Definition: gnss.h:1040
uint16_t size
Definition: gnss.h:910
uint8_t enable
Definition: gnss.h:1001
uint8_t step1
Definition: gnss.h:962
uint64_t sbasout
Definition: gnss.h:1054
date and time
Definition: gnss.h:844
uint32_t mode
Definition: gnss.h:817
int ephout
Definition: gnss.h:1053
ellipsoidal position
Definition: gnss.h:865
FAR void * data
Definition: gnss.h:1017
int signo
Definition: gnss.h:1016
tow assist data and size for AGPS
Definition: gnss.h:907
uint32_t size
Definition: gnss.h:1064
FAR uint8_t * data
Definition: gnss.h:919
double longitude
Definition: gnss.h:857
uint8_t point1
Definition: gnss.h:960
uint32_t type
Definition: gnss.h:1073
Factory test result.
Definition: gnss.h:982
FAR uint32_t * data
Definition: gnss.h:836
Information for use after being signaled to read data asychronously.
Definition: gnss.h:1012
uint32_t reserve1
Definition: gnss.h:973
uint32_t type
Definition: gnss.h:833
High precision receiver time.
Definition: gnss.h:937
Definition: gnss_type.h:335
signal setting for reading data asychronously The field &#39;enable&#39; of struct cxd56_gnss_signal_setting_...
Definition: gnss.h:998
Factory test info.
Definition: gnss.h:970
FAR uint8_t * data
Definition: gnss.h:909
Definition: gnss_type.h:1009
uint32_t * data
Definition: gnss.h:1063
float age
Definition: gnss.h:889
int fd
Definition: gnss.h:1014
int signo
Definition: gnss.h:1003
int32_t x
Definition: gnss.h:867
uint32_t cycle
Definition: gnss.h:1032
uint8_t step2
Definition: gnss.h:963
Time from frame start[sec].
Definition: gnss.h:927
utc model data and size for AGPS
Definition: gnss.h:917
CEP age info.
Definition: gnss.h:887
float cepi
Definition: gnss.h:890
uint32_t time
Definition: gnss.h:959
RTK output setting.
Definition: gnss.h:1049
Sattelite almanac, ephemeris data.
Definition: gnss.h:831
uint16_t size
Definition: video.h:86
uint8_t gnsssig
Definition: gnss.h:1002
uint8_t point2
Definition: gnss.h:961
float cn
Definition: gnss.h:984
different time between AGPS and GLONASS Time
Definition: gnss.h:947
ellipsoidal position
Definition: gnss.h:854
int32_t y
Definition: gnss.h:868
uint32_t satellite
Definition: gnss.h:972
acquist data and size for AGPS
Definition: gnss.h:897
uint32_t threshold
Definition: gnss.h:1033
int fd
Definition: gnss.h:1000
uint32_t reserve2
Definition: gnss.h:974
uint32_t gnss
Definition: gnss.h:1052
Sattelite ephemeris data.
Definition: gnss.h:1071
GNSS operation mode and cycle.
Definition: gnss.h:810
uint32_t cycle
Definition: gnss.h:824
uint16_t sec
Definition: gnss.h:929
int32_t z
Definition: gnss.h:869
uint32_t * data
Definition: gnss.h:1075
uint32_t frac
Definition: gnss.h:930
Definition: gnss.h:876