diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 0b6a00a..38e2235 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -217,11 +217,23 @@ //#define YUNHORN_STS_M10_LORA_APP_DATA_PORT 9U //#define YUNHORN_STS_M10_LORA_APP_HTBT_PORT 9U - +#define STS_IOC_IN_0 ((uint8_t)0x01) /* I/O Control sensor 1 */ +#define STS_IOC_IN_1 ((uint8_t)0x02) /* I/O Control sensor 2 */ +#define STS_IOC_IN_2 ((uint8_t)0x04) /* I/O Control sensor 3 */ +#define STS_IOC_IN_3 ((uint8_t)0x08) /* I/O Control sensor 4 */ +#define STS_IOC_OUT_0 ((uint8_t)0x10) /* I/O Control out interface 1 */ +#define STS_IOC_OUT_1 ((uint8_t)0x20) /* I/O Control out interface 2 */ +#define STS_IOC_OUT_2 ((uint8_t)0x40) /* I/O Control out interface 3 */ +#define STS_IOC_OUT_3 ((uint8_t)0x80) /* I/O Control out interface 4 */ +#define STS_IOC_MASK (0xFFu) /* I/O Control mask */ +#define STS_IOC_IN_ALL (STS_IOC_IN_0|STS_IOC_IN_1 |STS_IOC_IN_2 |STS_IOC_IN_3) +#define STS_IOC_OUT_ALL (STS_IOC_OUT_0|STS_IOC_OUT_1|STS_IOC_OUT_2|STS_IOC_OUT_3) +#define IS_STS_LAMP_BAR_OUTPUT_ENABLE STS_IOC_OUT_0 +#define IS_STS_RS485_OUTPUT_ENABLE STS_IOC_OUT_1 #define MajorVer 24U -#define MinorVer 06U -#define SubMinorVer 13U +#define MinorVer 07U +#define SubMinorVer 18U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U diff --git a/Core/Inc/yunhorn_sts_sensors.h b/Core/Inc/yunhorn_sts_sensors.h index 5ae1db5..7e23eed 100644 --- a/Core/Inc/yunhorn_sts_sensors.h +++ b/Core/Inc/yunhorn_sts_sensors.h @@ -607,7 +607,7 @@ typedef struct sts_cfg_nvm { uint8_t s_unit; // sampling time unit of duty cycle duration, in 'S', 'M','H' seconds, minutes, hours uint8_t work_mode; uint8_t sts_service_mask; - uint8_t reseve01; + uint8_t sts_ioc_mask; // I/O Control mask enable all 0xFF, Disable all 0x00 0b0000 0000 uint8_t length; // length of following parameters except AC CODE(20bytes) uint8_t p[STS_O7_CFG_PCFG_SIZE]; diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 23e78b8..d3ecf00 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -92,8 +92,8 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = { 0x03, 'S', //Sampling sensor interval for real-time sensing of MEMS 0x04, // dual mode=4, uni_mode =5 - 0x00, // service mask - 0x00, //reserve01 + 0x00, // sts service mask + 0x00, //sts_ioc_mask 0x20, //32 bytes, below start of p[0] 20 BYTES AND 12 BYTES FALL DOWN CFG { // below 20 bytes 0x08, //start_m [8]*0.1 meter =0.8