diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2019-12-19 11:53:10 -0600 |
---|---|---|
committer | Harsh Sharma <harsh.sharma@multitech.com> | 2019-12-19 11:53:10 -0600 |
commit | 8ce2b9763c880084fd9d38fae6033e487fde58d9 (patch) | |
tree | 8b77e3d0c5f24bb8ba4b9ade6298684781a91665 /include/General.h | |
download | mts-io-sysfs-8ce2b9763c880084fd9d38fae6033e487fde58d9.tar.gz mts-io-sysfs-8ce2b9763c880084fd9d38fae6033e487fde58d9.tar.bz2 mts-io-sysfs-8ce2b9763c880084fd9d38fae6033e487fde58d9.zip |
Initial commit
Diffstat (limited to 'include/General.h')
-rw-r--r-- | include/General.h | 82 |
1 files changed, 82 insertions, 0 deletions
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 <mts/MTS_System.h> +#include <mts/MTS_Text.h> + +#include <fstream> +#include <iostream> +#include <stdlib.h> +#include <stdio.h> /* printf fprintf */ +#include <fcntl.h> /* open */ +#include <linux/spi/spidev.h> +#include <sys/ioctl.h> +#include <unistd.h> /* lseek, close */ +#include <dirent.h> +#include <regex> +#include <sys/stat.h> + + +#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 + + + |