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.
Fork of C027_Support by
Diff: GPS.h
- Revision:
- 75:ce6e12067d0c
- Parent:
- 74:208e3e32d263
- Child:
- 76:f7c3dd568dae
--- a/GPS.h Thu May 15 22:20:42 2014 +0000
+++ b/GPS.h Fri May 16 14:13:00 2014 +0000
@@ -5,9 +5,9 @@
#include "SerialPipe.h"
#ifdef TARGET_UBLOX_C027
- #define _IF(onboard, shield) onboard
+ #define GPS_IF(onboard, shield) onboard
#else
- #define _IF(onboard, shield) shield
+ #define GPS_IF(onboard, shield) shield
#endif
/** basic gps parser class
@@ -21,7 +21,7 @@
/** Power on / Wake up the gps
*/
- virtual bool init(void) = 0;
+ virtual bool init(PinName pn) = 0;
enum {
// getLine Responses
@@ -178,13 +178,13 @@
\param rxSize the size of the serial rx buffer
\param txSize the size of the serial tx buffer
*/
- GPSSerial(PinName tx _IF( = GPSTXD, /* = D8 */), // resistor on shield not populated
- PinName rx _IF( = GPSRXD, /* = D9 */), // resistor on shield not populated
- int baudrate _IF( = GPSBAUD, = 9600 ),
+ GPSSerial(PinName tx GPS_IF( = GPSTXD, /* = D8 */), // resistor on shield not populated
+ PinName rx GPS_IF( = GPSRXD, /* = D9 */), // resistor on shield not populated
+ int baudrate GPS_IF( = GPSBAUD, = 9600 ),
int rxSize = 256 ,
int txSize = 128 );
- virtual bool init(void);
+ virtual bool init(PinName pn = NC);
/** Get a line from the physical interface.
\param buf the buffer to store it
@@ -215,15 +215,15 @@
\param adr the I2C address of the GPS set to (66<<1)
\param rxSize the size of the serial rx buffer
*/
- GPSI2C(PinName sda _IF( = GPSSDA, = D14 ),
- PinName scl _IF( = GPSSCL, = D15 ),
- unsigned char i2cAdr _IF( = GPSADR, = (66<<1) ),
+ GPSI2C(PinName sda GPS_IF( = GPSSDA, = D14 ),
+ PinName scl GPS_IF( = GPSSCL, = D15 ),
+ unsigned char i2cAdr GPS_IF( = GPSADR, = (66<<1) ),
int rxSize = 256 );
/** helper function to probe the i2c device
\return true if successfully detected the gps.
*/
- virtual bool init(void);
+ virtual bool init(PinName pn = GPS_IF( GPSINT, NC /* D7 resistor R67 on shield not mounted */));
/** Get a line from the physical interface.
\param buf the buffer to store it
