basic lightning detector with gps and sd card logging

Dependencies:   AS3935 AdafruitGPS SDFileSystem TSI mbed ConfigFile

Committer:
cmkachur
Date:
Wed Jul 15 21:25:24 2015 +0000
Revision:
13:3d717008645c
Parent:
0:3328df4c3116
Eliminate 50 ms delay when changing LED in main loop. ; Add a configuration parameter for using the RTC. The default is to use the RTC time.; Update FW version to 5.

Who changed what in which revision?

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