From 8ce2b9763c880084fd9d38fae6033e487fde58d9 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Thu, 19 Dec 2019 11:53:10 -0600 Subject: Initial commit --- include/General.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 include/General.h (limited to 'include/General.h') diff --git a/include/General.h b/include/General.h new file mode 100644 index 0000000..3e89c20 --- /dev/null +++ b/include/General.h @@ -0,0 +1,82 @@ +#ifndef GENERAL_HPP +#define GENERAL_HPP + +#ifdef _MSC_VER +#pragma warning ( disable : 4514 4512 4710 4355) +#endif + +typedef signed char sint8; +typedef unsigned char uint8; +typedef signed short sint16; +typedef unsigned short uint16; +typedef signed int sint32; +typedef unsigned int uint32; +typedef signed long long sint64; +typedef unsigned long long uint64; +typedef signed int sint; //32 bit - even on 64 bit machines +typedef unsigned int uint; //32 bit - even on 64 bit machines + +#define memzero(ptr) memset(ptr,0,sizeof(*(ptr))) +#define ArrayZero(ptr,elements) memset(ptr,0,sizeof(*(ptr)) * (elements)) + +#include +#include + +#include +#include +#include +#include /* printf fprintf */ +#include /* open */ +#include +#include +#include /* lseek, close */ +#include +#include +#include + + +#include "rapidjson/document.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/istreamwrapper.h" + +#define MAX_ACC_CARDS 4 + +#define VERBOSE false +#define MTS_IO_CONTROLS_STATUS_LED false +#define MTS_IO_CONTROLS_LS_LED false + +#define FIRMWARE_VERSION "Version" +#define FIRMWARE_DATE "Date" + +#define SYSFS_PLATFORM "/sys/devices/platform/mts-io/" +#define LEDS_GPIO_DIR "/sys/devices/platform/leds-gpio/leds/" +#define FIRMWARE_FILE "/etc/issue" + +#define LORA_1_5_AP1_FPGA_VERSION "mts-fpga-loader -p 1 -c | grep version | awk '{printf $4}'" +#define LORA_1_5_AP2_FPGA_VERSION "mts-fpga-loader -p 2 -c | grep version | awk '{printf $4}'" +#define LORA_2_1_FPGA_VERSION "mts-fpga-loader -g | grep version | awk '{printf $4}'" +#define LORA_2_1_EXT_FPGA_VERSION "mts-fpga-loader -b 1 -g | grep version | awk '{printf $4}'" + + +#define MTAC_SX1301 0x0 +#define MTAC_FPGA 0x1 + +#define MTAC_FPGA_ADDRESS 0x1 + +#define READ_ACCESS 0x00 +#define SPI_SPEED 8000000 + + +#define RESET_SHORT_CMD "reset_short_handler" +#define RESET_LONG_CMD "reset_long_handler" +#define KILL_SIGNAL "kill -l " + + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + + +#endif + + + -- cgit v1.2.3