-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathATT_LoRaWAN_TRACKTRACE.h
91 lines (69 loc) · 1.99 KB
/
ATT_LoRaWAN_TRACKTRACE.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
Copyright 2016 AllThingsTalk
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#ifndef _att_common_h
#define _att_common_h
#include <ATT_LoRaWAN.h>
#include <MicrochipLoRaModem.h>
#include "ATT_LoRaWAN_rtcZero.h"
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
//////////////////////
//power
void initPower();
void setGPSPower(int8_t value);
void setPower(int8_t value);
//////////////////////
void informStartOfCalibration();
void informEndOfCalibration();
void signalSendResult(bool value);
void signalSendStart();
// Ledcolors
enum LedColor {
NONE = 0,
RED,
GREEN,
BLUE,
YELLOW,
MAGENTA,
CYAN,
WHITE
};
/**
* Turns the led on according to the given color. Makes no assumptions about the status of the pins
* i.e. it sets them every time,
*/
void setLedColor(LedColor color);
//////////////////////
// wire communication
uint8_t readReg(uint8_t reg);
uint8_t writeReg(uint8_t reg, uint8_t val);
//////////////////////
//board
void initAcceleroInterrupts();
void attach(int pin, voidFuncPtr callback, int mode);
//returns true if the accelerometer reported a change in the magnetic field
//resets the switch so that a new change can be detected on the next run.
bool magnetoChanged();
//returns true if the accelerometer reported movement
//resets the switch so that new movement can be detected on the next run.
bool hasMoved();
//put the device is a deep sleep mode.
void sleep();
void disableUSB();
void enableUSB();
//////////////////////
//battery
//calculates the current battery level.
int batteryStatus();
#endif