LoRaWAN-Signal-Mapping/iot/main/settings.h

86 lines
2.9 KiB
C
Raw Permalink Normal View History

#pragma once
2019-06-24 13:27:22 +00:00
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include "settings.custom.h"
/*
* This is the main settings file - customise it to match your setup.
2019-06-24 13:47:14 +00:00
* Don't forget that you need to take a copy of settings.custom.cpp.example as
* settings.custom.cpp, and fill in the private keys the program needs to talk
2019-06-24 13:27:22 +00:00
* over LORaWAN.
*/
//////////////////////////////////
////////////// Main //////////////
//////////////////////////////////
// The speed at which we should talk over our main hardware serial connection.
#define BAUD_PC 115200
// Multiple devices can use the same SPI data pin AFAIKT, but some libraries
// *cough* SD *cough* are too stupid to figure out which pin it is on their own.
#define PIN_SPI_DATA 9
// The 'done' pin to pulse to signal to the TPL5111
#define PIN_TPL_DONE A0
// Uncomment to print RAM diagnostics at regular intervals.
//#define ENABLE_MEMORY_DIAGNOSTICS
/////////////
/// RFM95 ///
/////////////
// Whether to actually enable LMIC-based transmission or not.
#define ENABLE_RADIO
2019-06-24 13:27:22 +00:00
// The SPI chip-select pin for the RFM 95
#define PIN_SPI_CS_RFM95 10
2019-06-24 13:47:14 +00:00
// Pin mapping - see settings.custom.cpp
/////////////////////////////////
////////////// GPS //////////////
/////////////////////////////////
// The *TX* gin of the GPS device.
// This is swapped because we receive the GPS device's message on our side on
// the RX pin, and the GPS device transmits messages on the TX.
2019-06-13 14:10:12 +00:00
#define PIN_GPS_RX 5
// The *RX* pin on the GPS device.
2019-07-15 14:25:51 +00:00
// This is swapped because where the GPS device is receiving, we aresending and
// vice versa.
// The TX / RX here are according to *our* side, not the GPS device's side.
2019-06-13 14:10:12 +00:00
#define PIN_GPS_TX 4
// The speed at which we should talk to the GPS device. Some GPS devices
// require a certain speed in order to use certain commands, so it's important
// that you check the datasheets for the device you're using.
// 9600 is the correct speed for a NEO-6M.
#define BAUD_GPS 9600
2019-07-15 14:25:51 +00:00
// Uncomment to cause the system to check the newest GPS value against the last one, and only transmit a reading if they differ by more than (0.0003, 0.0002) - ~(20m, 14m).
// Unhelpful for debugging, but useful in production to reduce the number of messages sent when stationary.
2019-07-19 12:10:47 +00:00
// #define GPS_DELTA_CHECK
2019-07-15 14:25:51 +00:00
#define GPS_DELTA_MIN_LAT 0.0003
#define GPS_DELTA_MIN_LNG 0.0002
//////////////////////////////////
////////// microSD Card //////////
//////////////////////////////////
// The chip select pin that activates the connection to the microSD card over SPI.
#define PIN_SPI_CS_SD 3
// The filename on the microSD card to store data in.
2019-07-11 12:17:01 +00:00
#define SD_FILENAME "DATA.TSV"
// Whether to write debug information to the filename below. This could compromise privacy, so it should be commented out for production.
// #define SD_DEBUG_ENABLED
// The filename on the microSD card to store debug information in
2019-07-11 12:17:01 +00:00
#define SD_FILENAME_DEBUG "DEBUG.LOG"