init

Dependencies:   aconno_I2C Lis2dh12 WatchdogTimer

main.h

Committer:
pathfindr
Date:
2020-02-13
Revision:
57:066dfbe8b4b9
Parent:
56:efd9f5613549
Child:
58:8d4a354816b1

File content as of revision 57:066dfbe8b4b9:

/*
================================================================================
Project:    GPS Tracker
Module:     ---
Status:     Development
Type:       .h header file
Copyright (c) 2018 Pathfindr Ltd
All Rights Reserved.
================================================================================
Notes:
================================================================================
*/
#ifndef MAIN_INTERFACE_H_
#define MAIN_INTERFACE_H_

//------------------------------------------------------------------------------
//FW DETAILS
//------------------------------------------------------------------------------ 
#define FW_VERSION          1
#define SKU                 "UWBBEACON"
#define HW_MAJORREVISION    "001"

//OPTIONS
#define USE_NRF_TEMP_SENSOR                 false

//DEFAULT VELUES
#define DEFAULT_SLEEP_FRAME                 120000
#define DEFAULT_MOTION_G                    7
#define DEFAULT_MOTION_START_SECONDS        120
#define DEFAULT_MOTION_STOP_SECONDS         120
#define DEFAULT_IMPACT_G                    127
#define DEFAULT_BEACON_INTERVAL_MS          3000
#define DEFAULT_BEACON_INTERVAL_FAST_MS     100
#define DEFAULT_BEACON_POWER                4 //(accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm)
#define DEFAULT_SETTINGSSCANTIME_MS         10000

//CONSTS
#define ONEDAYINSECONDS                     86400
#define THREEDAYSINSECONDS                  259200
#define SEVENDAYSINSECONDS                  604800
#define TENDAYSINSECONDS                    864000

//DEFAULT EVENT TIMES IN SECONDS
#define DEFAULT_INTERVAL_MOTIONCLEAR        120
#define DEFAULT_INTERVAL_BUTTONCLEAR        20
#define DEFAULT_INTERVAL_BATTERY            ONEDAYINSECONDS
#define DEFAULT_INTERVAL_TEMPERATURE        60
#define DEFAULT_INTERVAL_HUMIDITY           120
#define DEFAULT_INTERVAL_SETTINGSSCAN       60


//DEFINES
#define ACTIVITY_BUFFERSIZE                 100
#define DEBUG_BUFFERSIZE                    200

//------------------------------------------------------------------------------
//mbed Libraries
//------------------------------------------------------------------------------
#include "mbed.h"
//#include "nrf_soc.h"
#include "board.h"
#include "ble/BLE.h" 

//------------------------------------------------------------------------------
//peripheral Libraries
//------------------------------------------------------------------------------
#include "WatchdogTimer.h"
#include "acd_nrf52_saadc.h"

//------------------------------------------------------------------------------
//Application headers
//------------------------------------------------------------------------------
#include "NRFuart.h"
#include "app_data.h"
#include "states.h"
#include "LED.h"

//BLE SERVICE IDS
#define BLE_SERVICEID_PFDETECTOR2           0xfb40
#define BLE_SERVICEID_UWBBEACON             0xfb50

//------------------------------------------------------------------------------
//Global macros
//------------------------------------------------------------------------------
//#define lowByte(w) ((uint8_t) ((w) & 0xff))
//#define highByte(w) ((uint8_t) ((w) >> 8))

//------------------------------------------------------------------------------
//GLOBAL VARS
//------------------------------------------------------------------------------ 

extern bool GLOBAL_accel_healthy;
extern bool GLOBAL_requireSoftReset;
extern bool GLOBAL_motionFlagTriggered;
extern bool GLOBAL_debugLED;
extern bool GLOBAL_needToConfigureLis3dh;
extern bool GLOBAL_LEDSequenceinProgress;
extern time_t GLOBAL_RTCunixtime;
extern char GLOBAL_debug_buffer[DEBUG_BUFFERSIZE];
//FUNCS
extern void watchdogKick();
#endif