diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2022-03-03 14:44:44 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2022-03-03 15:00:26 -0600 |
commit | b1eaaeca6fdcb38d9a247e2deabe1da788a1e1f0 (patch) | |
tree | c7183f8ff02d3090989530740d36164db3630620 /include/General.h | |
parent | 964e90992d6ac73cf287722a3dc136dda86c3ac2 (diff) | |
download | mts-io-sysfs-b1eaaeca6fdcb38d9a247e2deabe1da788a1e1f0.tar.gz mts-io-sysfs-b1eaaeca6fdcb38d9a247e2deabe1da788a1e1f0.tar.bz2 mts-io-sysfs-b1eaaeca6fdcb38d9a247e2deabe1da788a1e1f0.zip |
LoRa updates with MTAC-0030.2.0
Diffstat (limited to 'include/General.h')
-rw-r--r-- | include/General.h | 87 |
1 files changed, 42 insertions, 45 deletions
diff --git a/include/General.h b/include/General.h index c5be2ff..e45f06a 100644 --- a/include/General.h +++ b/include/General.h @@ -2,7 +2,7 @@ #define GENERAL_HPP #ifdef _MSC_VER -#pragma warning ( disable : 4514 4512 4710 4355) +#pragma warning(disable : 4514 4512 4710 4355) #endif typedef signed char sint8; @@ -13,71 +13,68 @@ 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 +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)) +#define memzero(ptr) memset(ptr, 0, sizeof(*(ptr))) +#define ArrayZero(ptr, elements) memset(ptr, 0, sizeof(*(ptr)) * (elements)) +#include <mts/MTS_Logger.h> #include <mts/MTS_System.h> #include <mts/MTS_Text.h> +#include <dirent.h> +#include <fcntl.h> /* open */ #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 <stdio.h> /* printf fprintf */ +#include <stdlib.h> +#include <sys/ioctl.h> #include <sys/stat.h> - +#include <unistd.h> /* lseek, close */ +#include <getopt.h> /* command line parser */ #include "rapidjson/document.h" -#include "rapidjson/writer.h" -#include "rapidjson/stringbuffer.h" +#include "rapidjson/filereadstream.h" #include "rapidjson/istreamwrapper.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/writer.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 HW_VERSION_PATH "/sys/devices/platform/mts-io/hw-version" -#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 MAX_ACC_CARDS 4 +#define VERBOSE false +#define MTS_IO_CONTROLS_STATUS_LED false +#define MTS_IO_CONTROLS_LS_LED false -#define MTAC_SX1301 0x0 -#define MTAC_FPGA 0x1 +#define FIRMWARE_VERSION "Version" +#define FIRMWARE_DATE "Date" +#define FIRMWARE_RELEASE "Release" -#define MTAC_FPGA_ADDRESS 0x1 +#define SYSFS_PLATFORM "/sys/devices/platform/mts-io/" +#define HW_VERSION_PATH "/sys/devices/platform/mts-io/hw-version" +#define LEDS_GPIO_DIR "/sys/devices/platform/leds-gpio/leds/" +#define FIRMWARE_FILE "/etc/issue" +#define CRESET "/creset" -#define READ_ACCESS 0x00 -#define SPI_SPEED 8000000 +#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 DEVICE_INFO_FILE "/var/run/config/device_info.json" -#define RESET_SHORT_CMD "reset_short_handler" -#define RESET_LONG_CMD "reset_long_handler" -#define KILL_SIGNAL "kill -l " +#define DEVICE_INFO_FILE "/var/run/config/device_info.json" +#define RESET_SHORT_CMD "reset_short_handler" +#define RESET_LONG_CMD "reset_long_handler" +#define KILL_SIGNAL "kill -l " +enum HardwareType { + HARDWARE_MTCDT, + HARDWARE_MTCDT3, + HARDWARE_MTCAP, + HARDWARE_INVALID +}; #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - #endif - - - |