Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Venus838_Test Atlas
Venus838.cpp
00001 #include "Venus838.h" 00002 00003 // A0 A1 PL(2b) ID Body CS 0D 0A 00004 Venus838::Venus838(PinName tx, PinName rx) : _gps(tx, rx) { 00005 _gps.baud(115200); 00006 } 00007 00008 void Venus838::setNmeaMessages(const bool gga, const bool gsa, const bool gsv, const bool gll, const bool rmc, const bool vtg) { 00009 char cmd[16] = { 00010 0xA0, 0xA1, 0x00, 0x09, 00011 0x08, gga, gsa, gsv, gll, rmc, vtg, 0x00, 0x01, 00012 0x00, 0x0D, 0x0A 00013 }; 00014 for(int i = 4; i < 13; i++) cmd[13] ^= cmd[i]; 00015 for(int i = 0; i < 16; i++) _gps.putc(cmd[i]); 00016 } 00017 00018 void Venus838::setUpdateRate(const uint8_t rate) { 00019 char cmd[10] = { 00020 0xA0, 0xA1, 0x00, 0x03, 00021 0x0E, rate, 0x01, 00022 0x00, 0x0D, 0x0A 00023 }; 00024 for(int i = 4; i < 7; i++) cmd[7] ^= cmd[i]; 00025 for(int i = 0; i < 10; i++) _gps.putc(cmd[i]); 00026 } 00027 00028 void Venus838::setNavigationMode(const int mode) { 00029 char cmd[] = { 00030 0xA0, 0xA1, 0x00, 0x04, 00031 0x64, 0x17, 0x04, 0x01, 00032 0x00, 0x0D, 0x0A 00033 }; 00034 for(int i = 4; i < 8; i++) cmd[8] ^= cmd[i]; 00035 for(int i = 0; i < 10; i++) _gps.putc(cmd[i]); 00036 } 00037 00038 bool Venus838::readable() { 00039 return _gps.readable(); 00040 } 00041 00042 void Venus838::putc(char in) { 00043 _gps.putc(in); 00044 } 00045 00046 char Venus838::getc() { 00047 return _gps.getc(); 00048 }
Generated on Fri Jul 15 2022 19:43:35 by
1.7.2