⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nmea_lcd.c

📁 the example file that can decode the NMEA protocol
💻 C
字号:
#include <stdlib.h>#include <string.h>#include "NMEA_Lib.h"#if (NMEA_INCLUDE_LCD == 1)#include "NMEA_LCD.h"BOOL NMEA_ParseLCDSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    if('L' == sentence[0] && 'C' == sentence[1] && 'D' == sentence[2])    {        sentenceToUINT16(sentence, &NMEAObject->LCDObject.GRIMicroseconds10, &sentence_index, NMEA_LCD_GRIMICROSECONDS10, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.MasterRelativeSNR, &sentence_index, NMEA_LCD_MASTERRELATIVESNR, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.MasterRelativeECD, &sentence_index, NMEA_LCD_MASTERRELATIVEECD, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference1Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE1MICROSECONDS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference1SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE1SIGNALSTATUS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference2Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE2MICROSECONDS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference2SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE2SIGNALSTATUS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference3Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE3MICROSECONDS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference3SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE3SIGNALSTATUS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference4Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE4MICROSECONDS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference4SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE4SIGNALSTATUS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference5Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE5MICROSECONDS, flags);        sentenceToUINT16(sentence, &NMEAObject->LCDObject.TimeDifference5SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE5SIGNALSTATUS, flags);    }    return ret_val;}BOOL NMEA_CreateLCDSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    sentence[0] = 'L';    sentence[1] = 'C';    sentence[2] = 'D';    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.GRIMicroseconds10, &sentence_index, NMEA_LCD_GRIMICROSECONDS10, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.MasterRelativeSNR, &sentence_index, NMEA_LCD_MASTERRELATIVESNR, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.MasterRelativeECD, &sentence_index, NMEA_LCD_MASTERRELATIVEECD, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference1Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE1MICROSECONDS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference1SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE1SIGNALSTATUS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference2Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE2MICROSECONDS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference2SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE2SIGNALSTATUS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference3Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE3MICROSECONDS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference3SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE3SIGNALSTATUS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference4Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE4MICROSECONDS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference4SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE4SIGNALSTATUS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference5Microseconds, &sentence_index, NMEA_LCD_TIMEDIFFERENCE5MICROSECONDS, flags);    sentenceFromUINT16(sentence, &NMEAObject->LCDObject.TimeDifference5SignalStatus, &sentence_index, NMEA_LCD_TIMEDIFFERENCE5SIGNALSTATUS, flags);    return ret_val;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -