diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-19 12:08:40 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-12-19 12:08:40 +0100 |
commit | 0e9dd76c707b07b476b9b02946e55bb795af8cfb (patch) | |
tree | dbcaaed6edee4cfb3cf56a12ba07170c1a07768e /src/fsm/gps.h | |
parent | 97981058c4408d4403546e2371aba494fac33b09 (diff) | |
download | glutte-o-matic-0e9dd76c707b07b476b9b02946e55bb795af8cfb.tar.gz glutte-o-matic-0e9dd76c707b07b476b9b02946e55bb795af8cfb.tar.bz2 glutte-o-matic-0e9dd76c707b07b476b9b02946e55bb795af8cfb.zip |
Add GPS routine and UBX parser
Diffstat (limited to 'src/fsm/gps.h')
-rw-r--r-- | src/fsm/gps.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/fsm/gps.h b/src/fsm/gps.h new file mode 100644 index 0000000..e54524b --- /dev/null +++ b/src/fsm/gps.h @@ -0,0 +1,49 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2015 Matthias P. Braendli + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#ifndef __GPS_H_ +#define __GPS_H_ + +/* Setup GPS receiver over I2C and parse time */ + +/* I2C connections: + * SCL on PB6 + * SDA on PB9 + */ + +#define GPS_I2C_ADDR 0x42 // I2C address of GPS receiver + +#include "ubx.h" + +// Setup communication and GPS receiver +void gps_init(); + +// Return 1 of the GPS is receiving time +int gps_locked(); + +// Get current time from GPS +ubx_nav_timeutc_t* gps_utctime(); + +#endif // __GPS_H_ + |