init
Dependencies: aconno_I2C Lis2dh12 WatchdogTimer
main.h@20:5404841fdd2b, 2018-12-19 (annotated)
- Committer:
- pathfindr
- Date:
- Wed Dec 19 09:02:20 2018 +0000
- Revision:
- 20:5404841fdd2b
- Parent:
- 16:3bf5f1a5f869
- Child:
- 21:e0b866630c27
10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pathfindr | 0:94b743e06998 | 1 | /* |
pathfindr | 0:94b743e06998 | 2 | ================================================================================ |
pathfindr | 0:94b743e06998 | 3 | Project: MTU Tracker |
pathfindr | 0:94b743e06998 | 4 | Module: --- |
pathfindr | 0:94b743e06998 | 5 | Status: Development |
pathfindr | 0:94b743e06998 | 6 | Type: .h header file |
pathfindr | 0:94b743e06998 | 7 | Copyright (c) 2018 Pathfindr Ltd |
pathfindr | 0:94b743e06998 | 8 | All Rights Reserved. |
pathfindr | 0:94b743e06998 | 9 | ================================================================================ |
pathfindr | 0:94b743e06998 | 10 | Notes: |
pathfindr | 0:94b743e06998 | 11 | |
pathfindr | 0:94b743e06998 | 12 | ================================================================================ |
pathfindr | 0:94b743e06998 | 13 | */ |
pathfindr | 0:94b743e06998 | 14 | |
pathfindr | 0:94b743e06998 | 15 | #ifndef MAIN_INTERFACE_H_ |
pathfindr | 0:94b743e06998 | 16 | #define MAIN_INTERFACE_H_ |
pathfindr | 0:94b743e06998 | 17 | |
pathfindr | 0:94b743e06998 | 18 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 19 | //mbed Libraries |
pathfindr | 0:94b743e06998 | 20 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 21 | #include "mbed.h" |
pathfindr | 7:e9a19750700d | 22 | #include "board.h" |
pathfindr | 4:8d8e9bfa82e4 | 23 | #include "WatchdogTimer.h" |
pathfindr | 0:94b743e06998 | 24 | #include "ble/BLE.h" |
pathfindr | 7:e9a19750700d | 25 | //#include "nvstore.h" |
pathfindr | 0:94b743e06998 | 26 | |
pathfindr | 0:94b743e06998 | 27 | |
pathfindr | 0:94b743e06998 | 28 | //------------------------------------------------------------------------------ |
pathfindr | 2:fd554f01abdf | 29 | //peripheral Libraries |
pathfindr | 0:94b743e06998 | 30 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 31 | #include "LIS3DH.h" |
pathfindr | 11:60eb0ff945f2 | 32 | #include "SI7060.h" |
pathfindr | 14:9a54b1b65bc8 | 33 | #include "acd_nrf52_saadc.h" |
pathfindr | 0:94b743e06998 | 34 | |
pathfindr | 0:94b743e06998 | 35 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 36 | //C Standard Libraries |
pathfindr | 0:94b743e06998 | 37 | //------------------------------------------------------------------------------ |
pathfindr | 2:fd554f01abdf | 38 | /* |
pathfindr | 0:94b743e06998 | 39 | #include <ctype.h> |
pathfindr | 0:94b743e06998 | 40 | #include <errno.h> |
pathfindr | 0:94b743e06998 | 41 | #include <stddef.h> |
pathfindr | 0:94b743e06998 | 42 | #include <math.h> |
pathfindr | 0:94b743e06998 | 43 | #include <stdarg.h> |
pathfindr | 0:94b743e06998 | 44 | #include <stdlib.h> |
pathfindr | 0:94b743e06998 | 45 | #include <stdio.h> |
pathfindr | 0:94b743e06998 | 46 | #include <ctype.h> |
pathfindr | 0:94b743e06998 | 47 | #include <string.h> |
pathfindr | 0:94b743e06998 | 48 | #include <stdbool.h> |
pathfindr | 0:94b743e06998 | 49 | #include <stdint.h> |
pathfindr | 2:fd554f01abdf | 50 | */ |
pathfindr | 2:fd554f01abdf | 51 | //include <string> // dont use - causes 2ma sleep |
pathfindr | 2:fd554f01abdf | 52 | //using std::string; |
pathfindr | 2:fd554f01abdf | 53 | |
pathfindr | 0:94b743e06998 | 54 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 55 | //Application headers |
pathfindr | 0:94b743e06998 | 56 | //------------------------------------------------------------------------------ |
pathfindr | 16:3bf5f1a5f869 | 57 | #include "states.h" |
pathfindr | 7:e9a19750700d | 58 | #include "common.h" |
pathfindr | 7:e9a19750700d | 59 | #include "sensors.h" |
pathfindr | 7:e9a19750700d | 60 | #include "modem.h" |
pathfindr | 11:60eb0ff945f2 | 61 | #include "filesystem.h" |
pathfindr | 5:8f8951127724 | 62 | |
pathfindr | 0:94b743e06998 | 63 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 64 | //Global macros |
pathfindr | 0:94b743e06998 | 65 | //------------------------------------------------------------------------------ |
pathfindr | 16:3bf5f1a5f869 | 66 | //#define lowByte(w) ((uint8_t) ((w) & 0xff)) |
pathfindr | 16:3bf5f1a5f869 | 67 | //#define highByte(w) ((uint8_t) ((w) >> 8)) |
pathfindr | 0:94b743e06998 | 68 | |
pathfindr | 11:60eb0ff945f2 | 69 | #define CONSOLE_DEBUG 1 /* Set this if you need debug messages on the console; * it will have an impact on code-size and power consumption. */ |
pathfindr | 11:60eb0ff945f2 | 70 | #if CONSOLE_DEBUG |
pathfindr | 0:94b743e06998 | 71 | #define DEBUG(...) { uart.printf(__VA_ARGS__); } |
pathfindr | 0:94b743e06998 | 72 | #else |
pathfindr | 0:94b743e06998 | 73 | #define DEBUG(...) /* nothing */ |
pathfindr | 11:60eb0ff945f2 | 74 | #endif /* #if CONSOLE_DEBUG */ |
pathfindr | 0:94b743e06998 | 75 | |
pathfindr | 0:94b743e06998 | 76 | //------------------------------------------------------------------------------ |
pathfindr | 0:94b743e06998 | 77 | //Global data structures |
pathfindr | 0:94b743e06998 | 78 | //------------------------------------------------------------------------------ |
pathfindr | 13:29f67f256709 | 79 | //PERFS |
pathfindr | 13:29f67f256709 | 80 | extern Serial uart; |
pathfindr | 0:94b743e06998 | 81 | |
pathfindr | 7:e9a19750700d | 82 | //VARS |
pathfindr | 13:29f67f256709 | 83 | extern bool GLOBAL_accel_healthy; |
pathfindr | 13:29f67f256709 | 84 | extern bool GLOBAL_requireSoftReset; |
pathfindr | 13:29f67f256709 | 85 | extern bool GLOBAL_motionFlagTriggered; |
pathfindr | 13:29f67f256709 | 86 | extern bool GLOBAL_debugLED; |
pathfindr | 13:29f67f256709 | 87 | extern bool GLOBAL_needToConfigureLis3dh; |
pathfindr | 13:29f67f256709 | 88 | extern bool GLOBAL_registeredOnNetwork; |
pathfindr | 13:29f67f256709 | 89 | extern long long GLOBAL_imei; |
pathfindr | 13:29f67f256709 | 90 | extern float GLOBAL_voltage; |
pathfindr | 13:29f67f256709 | 91 | extern time_t GLOBAL_RTCunixtime; |
pathfindr | 13:29f67f256709 | 92 | extern time_t GLOBAL_wakeTime; |
pathfindr | 20:5404841fdd2b | 93 | |
pathfindr | 20:5404841fdd2b | 94 | //FUNCS |
pathfindr | 20:5404841fdd2b | 95 | extern void watchdogKick(); |
pathfindr | 20:5404841fdd2b | 96 | |
pathfindr | 16:3bf5f1a5f869 | 97 | #endif |