example program demonstrating use of the adafruit gps and logging to an sd card
Dependencies: AdafruitGPS SDFileSystem TSI mbed
main.h@0:b23bd622e0cc, 2015-06-16 (annotated)
- Committer:
- ftagius
- Date:
- Tue Jun 16 12:05:21 2015 +0000
- Revision:
- 0:b23bd622e0cc
example program to interface with an adafruit ultimate gps and to log gps data to an sd card
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ftagius | 0:b23bd622e0cc | 1 | /* |
ftagius | 0:b23bd622e0cc | 2 | / _____) _ | | |
ftagius | 0:b23bd622e0cc | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
ftagius | 0:b23bd622e0cc | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
ftagius | 0:b23bd622e0cc | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
ftagius | 0:b23bd622e0cc | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
ftagius | 0:b23bd622e0cc | 7 | ( C )2014 Semtech |
ftagius | 0:b23bd622e0cc | 8 | |
ftagius | 0:b23bd622e0cc | 9 | Description: Contains the callbacks for the IRQs and any application related details |
ftagius | 0:b23bd622e0cc | 10 | |
ftagius | 0:b23bd622e0cc | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
ftagius | 0:b23bd622e0cc | 12 | |
ftagius | 0:b23bd622e0cc | 13 | Maintainer: Miguel Luis and Gregory Cristian |
ftagius | 0:b23bd622e0cc | 14 | */ |
ftagius | 0:b23bd622e0cc | 15 | #ifndef __MAIN_H__ |
ftagius | 0:b23bd622e0cc | 16 | #define __MAIN_H__ |
ftagius | 0:b23bd622e0cc | 17 | #include "GPS.h" |
ftagius | 0:b23bd622e0cc | 18 | |
ftagius | 0:b23bd622e0cc | 19 | /*! |
ftagius | 0:b23bd622e0cc | 20 | * @brief Function executed on CAD Done event |
ftagius | 0:b23bd622e0cc | 21 | */ |
ftagius | 0:b23bd622e0cc | 22 | void OnCadDone( void ); |
ftagius | 0:b23bd622e0cc | 23 | |
ftagius | 0:b23bd622e0cc | 24 | char* itoa(int val, int base); |
ftagius | 0:b23bd622e0cc | 25 | unsigned int randomSeed(void); |
ftagius | 0:b23bd622e0cc | 26 | void start_ping_pong(void); |
ftagius | 0:b23bd622e0cc | 27 | void ping_pong(void); |
ftagius | 0:b23bd622e0cc | 28 | void start_hello(void); |
ftagius | 0:b23bd622e0cc | 29 | void hello(void); |
ftagius | 0:b23bd622e0cc | 30 | void check_gps(void); |
ftagius | 0:b23bd622e0cc | 31 | int get_kbd_str(char* buf, int size); |
ftagius | 0:b23bd622e0cc | 32 | void console_chat(); |
ftagius | 0:b23bd622e0cc | 33 | void console(); |
ftagius | 0:b23bd622e0cc | 34 | |
ftagius | 0:b23bd622e0cc | 35 | /* |
ftagius | 0:b23bd622e0cc | 36 | * Global variables declarations |
ftagius | 0:b23bd622e0cc | 37 | */ |
ftagius | 0:b23bd622e0cc | 38 | extern Serial pc; |
ftagius | 0:b23bd622e0cc | 39 | |
ftagius | 0:b23bd622e0cc | 40 | #define BUFFER_SIZE 256 // Define the payload size here |
ftagius | 0:b23bd622e0cc | 41 | |
ftagius | 0:b23bd622e0cc | 42 | #if( defined ( TARGET_KL25Z ) || defined ( TARGET_LPC11U6X ) ) |
ftagius | 0:b23bd622e0cc | 43 | extern DigitalOut led; |
ftagius | 0:b23bd622e0cc | 44 | #else |
ftagius | 0:b23bd622e0cc | 45 | extern DigitalOut led; |
ftagius | 0:b23bd622e0cc | 46 | #endif |
ftagius | 0:b23bd622e0cc | 47 | |
ftagius | 0:b23bd622e0cc | 48 | |
ftagius | 0:b23bd622e0cc | 49 | extern GPS gpsd; |
ftagius | 0:b23bd622e0cc | 50 | extern uint8_t PingMsg[]; |
ftagius | 0:b23bd622e0cc | 51 | extern uint8_t PongMsg[]; |
ftagius | 0:b23bd622e0cc | 52 | extern uint8_t HelloMsg[]; |
ftagius | 0:b23bd622e0cc | 53 | extern uint16_t BufferSize; |
ftagius | 0:b23bd622e0cc | 54 | extern uint8_t BufferTx[]; |
ftagius | 0:b23bd622e0cc | 55 | extern uint8_t BufferRx[]; |
ftagius | 0:b23bd622e0cc | 56 | extern float Frequency; |
ftagius | 0:b23bd622e0cc | 57 | extern int TxPower; |
ftagius | 0:b23bd622e0cc | 58 | extern int Bandwidth; |
ftagius | 0:b23bd622e0cc | 59 | extern int SpreadingFactor; |
ftagius | 0:b23bd622e0cc | 60 | extern int CodingRate; |
ftagius | 0:b23bd622e0cc | 61 | extern bool isMaster; |
ftagius | 0:b23bd622e0cc | 62 | extern bool AlwaysMaster; |
ftagius | 0:b23bd622e0cc | 63 | extern bool AlwaysSlave; |
ftagius | 0:b23bd622e0cc | 64 | extern bool rxTimeout; |
ftagius | 0:b23bd622e0cc | 65 | extern char pcbuf[]; |
ftagius | 0:b23bd622e0cc | 66 | extern bool ackRcvd; |
ftagius | 0:b23bd622e0cc | 67 | extern bool gpsEnabled; |
ftagius | 0:b23bd622e0cc | 68 | extern int txLen; |
ftagius | 0:b23bd622e0cc | 69 | extern int16_t RssiValue; |
ftagius | 0:b23bd622e0cc | 70 | extern int8_t SnrValue; |
ftagius | 0:b23bd622e0cc | 71 | #define PCBUF_SIZE 64 |
ftagius | 0:b23bd622e0cc | 72 | |
ftagius | 0:b23bd622e0cc | 73 | typedef enum { |
ftagius | 0:b23bd622e0cc | 74 | APP_NONE = 0, |
ftagius | 0:b23bd622e0cc | 75 | APP_PING, |
ftagius | 0:b23bd622e0cc | 76 | APP_CHAT, |
ftagius | 0:b23bd622e0cc | 77 | APP_HELLO, |
ftagius | 0:b23bd622e0cc | 78 | APP_CONSOLE, |
ftagius | 0:b23bd622e0cc | 79 | APP_GPS |
ftagius | 0:b23bd622e0cc | 80 | } app_e; |
ftagius | 0:b23bd622e0cc | 81 | |
ftagius | 0:b23bd622e0cc | 82 | extern app_e app; |
ftagius | 0:b23bd622e0cc | 83 | |
ftagius | 0:b23bd622e0cc | 84 | #endif // __MAIN_H__ |