Rev 659 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 659 | Rev 700 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | // + #### END OF LICENSING TERMS #### |
53 | // + #### END OF LICENSING TERMS #### |
54 | // + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
54 | // + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
55 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
55 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
56 | #include <string.h> |
56 | #include <string.h> |
57 | #include "91x_lib.h" |
57 | #include "91x_lib.h" |
- | 58 | #include "uart0.h" |
|
58 | #include "uart1.h" |
59 | #include "uart1.h" |
59 | #include "ubx.h" |
60 | #include "ubx.h" |
60 | #include "main.h" |
61 | #include "main.h" |
61 | #include "led.h" |
62 | #include "led.h" |
62 | #include "timer1.h" |
63 | #include "timer1.h" |
Line 89... | Line 90... | ||
89 | #define UBX_SYNC1_CHAR 0xB5 |
90 | #define UBX_SYNC1_CHAR 0xB5 |
90 | #define UBX_SYNC2_CHAR 0x62 |
91 | #define UBX_SYNC2_CHAR 0x62 |
91 | // protocoll identifiers |
92 | // protocoll identifiers |
92 | // navigation class |
93 | // navigation class |
93 | #define UBX_CLASS_NAV 0x01 |
94 | #define UBX_CLASS_NAV 0x01 |
- | 95 | #define UBX_CLASS_MON 0x0A |
|
- | 96 | ||
94 | #define UBX_ID_POSLLH 0x02 |
97 | #define UBX_ID_POSLLH 0x02 |
95 | #define UBX_ID_SOL 0x06 |
98 | #define UBX_ID_SOL 0x06 |
96 | #define UBX_ID_VELNED 0x12 |
99 | #define UBX_ID_VELNED 0x12 |
Line -... | Line 100... | ||
- | 100 | ||
- | 101 | #define UBX_ID_MON_VER 0x04 |
|
97 | 102 | ||
98 | // ------------------------------------------------------------------------------------------------ |
103 | // ------------------------------------------------------------------------------------------------ |
Line 99... | Line 104... | ||
99 | // typedefs |
104 | // typedefs |
Line 288... | Line 293... | ||
288 | { // and the itow is equal (same time base) |
293 | { // and the itow is equal (same time base) |
289 | UART_VersionInfo.Flags |= NC_VERSION_FLAG_GPS_PRESENT; |
294 | UART_VersionInfo.Flags |= NC_VERSION_FLAG_GPS_PRESENT; |
290 | if((UbxSol.itow == UbxPosLlh.itow) && (UbxPosLlh.itow == UbxVelNed.itow)) |
295 | if((UbxSol.itow == UbxPosLlh.itow) && (UbxPosLlh.itow == UbxVelNed.itow)) |
291 | { |
296 | { |
292 | UBX_Timeout = SetDelay(UBX_TIMEOUT); |
297 | UBX_Timeout = SetDelay(UBX_TIMEOUT); |
293 | DebugOut.Analog[9]++; |
298 | DebugOut.Analog[9]++; |
294 | // update GPS data only if the status is INVALID or PROCESSED |
299 | // update GPS data only if the status is INVALID or PROCESSED |
295 | if(GPSData.Status != NEWDATA) |
300 | if(GPSData.Status != NEWDATA) |
296 | { // wait for new data at all neccesary ubx messages |
301 | { // wait for new data at all neccesary ubx messages |
297 | CountNewGpsDataIn5Sec++; |
302 | CountNewGpsDataIn5Sec++; |
298 | GPSData.Status = INVALID; |
303 | GPSData.Status = INVALID; |
Line 388... | Line 393... | ||
388 | //GPSData.Position.Longitude =1251674613L; // Bubble |
393 | //GPSData.Position.Longitude =1251674613L; // Bubble |
389 | //GPSData.Position.Latitude = 466058365L; // |
394 | //GPSData.Position.Latitude = 466058365L; // |
Line 390... | Line 395... | ||
390 | 395 | ||
Line -... | Line 396... | ||
- | 396 | } |
|
- | 397 | ||
- | 398 | u8 UbxVersionParser(void) |
|
- | 399 | { |
|
- | 400 | // HW:00000040: Antaris |
|
- | 401 | // HW:00040001: Antaris-4 |
|
- | 402 | // HW:80040001: Antaris-4 |
|
- | 403 | // HW:00040005: u-blox 5 |
|
- | 404 | // HW:00040006: u-blox 6 |
|
- | 405 | // HW:00040007: u-blox 6 |
|
- | 406 | // HW:00070000: u-blox 7 |
|
- | 407 | // HW:00080000: u-blox M8 |
|
- | 408 | // MKGPS V1 -> 1500 -> LEA-4H-0-000 -> ubxsw == 5.00 HW:00040001 |
|
- | 409 | // MKGPS V2 -> 2602 -> LEA-6S-0-000 -> ubxsw == 6.02 HW:00040007 |
|
- | 410 | // MKGPS V2 -> 2703 -> LEA-6S-0-001 -> ubxsw == 7.03 HW:00040007 |
|
- | 411 | // MKGPS V3 -> 3201 -> NEO-M8Q-0-00 -> ubxsw == 2.00 HW:00080000 (Flash-oder ROM Variante) |
|
- | 412 | ||
- | 413 | u8 retval = 0xFF; |
|
- | 414 | if(UbxMsg.Data[33] == '4' && UbxMsg.Data[37] == '1') // LEA-4 |
|
- | 415 | { |
|
- | 416 | GPS_Version = 1000 + (UbxMsg.Data[0] - '0') * 100 + (UbxMsg.Data[2] - '0') * 10 + (UbxMsg.Data[3] - '0'); |
|
- | 417 | retval = 10; // MKGPS V1 |
|
- | 418 | } |
|
- | 419 | else |
|
- | 420 | if(UbxMsg.Data[33] == '4' && UbxMsg.Data[37] == '7') // LEA-6 |
|
- | 421 | { |
|
- | 422 | GPS_Version = 2000 + (UbxMsg.Data[0] - '0') * 100 + (UbxMsg.Data[2] - '0') * 10 + (UbxMsg.Data[3] - '0'); |
|
- | 423 | retval = 20; // MKGPS V2 |
|
- | 424 | } |
|
- | 425 | else |
|
- | 426 | if(UbxMsg.Data[33] == '8' && UbxMsg.Data[37] == '0') // NEO-8 |
|
- | 427 | { |
|
- | 428 | GPS_Version = 3000 + (UbxMsg.Data[0] - '0') * 100 + (UbxMsg.Data[2] - '0') * 10 + (UbxMsg.Data[3] - '0'); |
|
- | 429 | retval = 30; // MKGPS V3 |
|
- | 430 | } |
|
Line 391... | Line 431... | ||
391 | } |
431 | return(retval); |
392 | 432 | } |
|
393 | 433 | ||
394 | /********************************************************/ |
434 | /********************************************************/ |
Line 499... | Line 539... | ||
499 | default: |
539 | default: |
500 | break; |
540 | break; |
501 | } // EOF switch(Id) |
541 | } // EOF switch(Id) |
502 | Update_GPSData(); |
542 | Update_GPSData(); |
503 | break; |
543 | break; |
- | 544 | case UBX_CLASS_MON: // version |
|
- | 545 | switch(RxHdr.Id) |
|
- | 546 | { |
|
- | 547 | case UBX_ID_MON_VER: |
|
- | 548 | if(UbxMsg.Hdr.Length <= UBX_MSG_DATA_SIZE) memcpy(UbxMsg.Data, RxData, RxHdr.Length); |
|
- | 549 | UbxVersionParser(); |
|
- | 550 | break; |
|
Line -... | Line 551... | ||
- | 551 | ||
- | 552 | default: |
|
- | 553 | break; |
|
504 | 554 | } |
|
505 | default: |
555 | default: |
506 | break; |
556 | break; |
Line 507... | Line 557... | ||
507 | } // EOF switch(class) |
557 | } // EOF switch(class) |