Mercurial > public > ostc4
comparison Small_CPU/Inc/GNSS.h @ 1000:c386ae6635e4 GasConsumption
Improve GNSS operation:
during OSTC 4/5 code merge a problem with the wakeup of the gnss module showed up which has been fixed with the new verion. In addition a compile switch has been added which activated the synchronization of time between OSTC and gnss module. This my cause problems if the time is not accurate => deactivated at the moment.
| author | Ideenmodellierer |
|---|---|
| date | Mon, 28 Apr 2025 19:51:36 +0200 |
| parents | 9b29995d6619 |
| children | efb7d18cc564 |
comparison
equal
deleted
inserted
replaced
| 999:ac25c35a3c97 | 1000:c386ae6635e4 |
|---|---|
| 99 | 99 |
| 100 }GNSS_StateHandle; | 100 }GNSS_StateHandle; |
| 101 | 101 |
| 102 GNSS_StateHandle GNSS_Handle; | 102 GNSS_StateHandle GNSS_Handle; |
| 103 | 103 |
| 104 typedef struct { | |
| 105 uint8_t header1; | |
| 106 uint8_t header2; | |
| 107 uint8_t msgClass; | |
| 108 uint8_t msgID; | |
| 109 uint16_t length; | |
| 110 uint8_t type; | |
| 111 uint8_t version; | |
| 112 uint8_t ref; | |
| 113 uint8_t leapsec; | |
| 114 uint16_t year; | |
| 115 uint8_t month; | |
| 116 uint8_t day; | |
| 117 uint8_t hour; | |
| 118 uint8_t minute; | |
| 119 uint8_t second; | |
| 120 uint8_t flags; | |
| 121 uint32_t nanoseconds; | |
| 122 uint16_t accuracy_seconds; | |
| 123 uint16_t reserved; | |
| 124 uint32_t accuracy_nano; | |
| 125 | |
| 126 } __attribute__((packed)) UBX_MGA_INI_TIME_UTC_t; | |
| 127 | |
| 104 | 128 |
| 105 enum GNSSMode{Portable=0, Stationary=1, Pedestrian=2, Automotiv=3, Airbone1G=5, Airbone2G=6,Airbone4G=7,Wirst=8,Bike=9}; | 129 enum GNSSMode{Portable=0, Stationary=1, Pedestrian=2, Automotiv=3, Airbone1G=5, Airbone2G=6,Airbone4G=7,Wirst=8,Bike=9}; |
| 106 | 130 |
| 107 static const uint8_t configUBX[]={0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x80,0x25,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00}; | 131 static const uint8_t configUBX[]={0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x80,0x25,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00}; |
| 108 | 132 |
| 123 | 147 |
| 124 static const uint8_t setPowerLow[]={0xB5,0x62,0x06,0x86,0x08,0x00,0x00,0x02,0x10,0x0E,0x14,0x00,0x00,0x00}; | 148 static const uint8_t setPowerLow[]={0xB5,0x62,0x06,0x86,0x08,0x00,0x00,0x02,0x10,0x0E,0x14,0x00,0x00,0x00}; |
| 125 | 149 |
| 126 static const uint8_t setPowerNormal[]={0xB5,0x62,0x06,0x86,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; | 150 static const uint8_t setPowerNormal[]={0xB5,0x62,0x06,0x86,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
| 127 | 151 |
| 152 /* UBX-CFG-NAV5 */ | |
| 128 static const uint8_t setPortableMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x00,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; | 153 static const uint8_t setPortableMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x00,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
| 129 | |
| 130 static const uint8_t setPedestrianMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x03,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; | 154 static const uint8_t setPedestrianMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x03,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
| 131 | 155 |
| 132 static const uint8_t setConfig[]={0xB5,0x62,0x06,0x09,0x0D,0x00, 0x00,0x00,0x00,0x00, 0x18,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x01}; | 156 static const uint8_t setConfig[]={0xB5,0x62,0x06,0x09,0x0D,0x00, 0x00,0x00,0x00,0x00, 0x18,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x01}; |
| 157 /* UBX-MGA-INI-TIME_UTC */ | |
| 158 static const uint8_t setDateTime[] = {0xB5,0x62,0x13,0x40,0x18,0x00,0x10,0x00,0x00,0x80,0x07,0xE9,0x01,0x02,0x03,0x04,0x05,0x00,0x01,0x02,0x03,0x04,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00}; | |
| 133 | 159 |
| 134 static const uint8_t setPortableType[]={}; | 160 static const uint8_t setPortableType[]={}; |
| 135 void GNSS_Init(GNSS_StateHandle *GNSS, UART_HandleTypeDef *huart); | 161 void GNSS_Init(GNSS_StateHandle *GNSS, UART_HandleTypeDef *huart); |
| 136 void GNSS_LoadConfig(GNSS_StateHandle *GNSS); | 162 void GNSS_LoadConfig(GNSS_StateHandle *GNSS); |
| 137 uint8_t GNSS_ParseBuffer(GNSS_StateHandle *GNSS); | 163 uint8_t GNSS_ParseBuffer(GNSS_StateHandle *GNSS); |
