Stima V4 Slave RAIN  4.2
config.h File Reference
#include "sensors_config.h"
#include "stima_config.h"

Go to the source code of this file.

Macros

#define MODULE_MAIN_VERSION   (4)
 Module main version. More...
 
#define MODULE_MINOR_VERSION   (3)
 Module minor version. More...
 
#define RMAP_PROCOTOL_VERSION   (1)
 rmap protocol version More...
 
#define MODULE_TYPE   (STIMA_MODULE_TYPE_TH)
 Type of module. It is defined in registers.h. More...
 
#define DEBUG_MODE   (false)
 Enable control Error for Debug. More...
 
#define ERROR_HANDLER_CB   (false)
 
#define ENABLE_I2C1   (true)
 Enable I2C1 interface. More...
 
#define ENABLE_I2C2   (true)
 Enable I2C2 interface. More...
 
#define ENABLE_QSPI   (true)
 Enable QSPI interface. More...
 
#define ENABLE_CAN   (true)
 Enable CAN BUS interface. More...
 
#define ENABLE_ACCELEROMETER   (true)
 Enable I2C Accelerometer. More...
 
#define ENABLE_DIAG_PIN   (false)
 Enable HW Diag PIN redefine. More...
 
#define ENABLE_WDT   (true)
 Enable WatchDog Task and Module. More...
 
#define WDT_TIMEOUT_BASE_US   (8000000)
 WatchDog Hardware microseconds timeout. More...
 
#define WDT_STARTING_TASK_MS   (60000)
 Init WatchDog Task local milliseconds. More...
 
#define WDT_CONTROLLER_MS   (2000)
 Task milliseconds minimal check. More...
 
#define ENABLE_STACK_USAGE   (true)
 Enable stack usage. More...
 
#define UNUSED_SUB_POSITION   (0)
 Monitor Sub Position not used flag. More...
 
#define NORMAL_STATE   (0)
 Monitor No Sleep / No Suspend. More...
 
#define SLEEP_STATE   (1)
 Sleep Task For Wdt or LowPower Check
More...
 
#define SUSPEND_STATE   (2)
 Suspend Task from Wdt
More...
 
#define ENABLE_RTC   (true)
 Enable RTC Interface. More...
 
#define RTC_WAIT_DELAY_MS   (100)
 Delay for RTC in milliseconds. More...
 
#define START_EEPROM_ADDRESS   (0)
 Starting EEPROM address. More...
 
#define SIZE_EEPROM_RESERVED   (450)
 Size EEPROM reserved address. Must be > CONFIGURATION_EEPROM_END. More...
 
#define BOOT_LOADER_STRUCT_ADDR   (START_EEPROM_ADDRESS)
 Bootloader start address
More...
 
#define BOOT_LOADER_STRUCT_SIZE   (sizeof(bootloader_t))
 Bootloader struct size. More...
 
#define BOOT_LOADER_STRUCT_END   (START_EEPROM_ADDRESS + BOOT_LOADER_STRUCT_SIZE)
 Bootloader struct end address
More...
 
#define CONFIGURATION_EEPROM_ADDRESS   (20)
 Start Address EEPROM configuration. More...
 
#define REGISTER_EEPROM_ADDRESS   (START_EEPROM_ADDRESS + SIZE_EEPROM_RESERVED)
 Start Standard UAVCAN Register. More...
 
#define SERIAL_DEBUG_BAUD_RATE   (115200)
 Monitor Debug Serial speed. More...
 
#define SYSTEM_MESSAGE_QUEUE_LENGTH   (4)
 Request system message queue length. More...
 
#define ELABORATE_DATA_QUEUE_LENGTH   (6)
 Elaborate data message queue length. More...
 
#define REQUEST_DATA_QUEUE_LENGTH   (1)
 Request data message queue length. More...
 
#define REPORT_DATA_QUEUE_LENGTH   (1)
 Report data message queue length. More...
 
#define RAIN_QUEUE_LENGTH   (1)
 Request sensor queue length. More...
 
#define ALL_TASK_ID   (99)
 All task ID. Send message to ALL Task. More...
 
#define SUPERVISOR_TASK_ID   (0)
 Supervisor task ID. More...
 
#define CAN_TASK_ID   (1)
 CAN task ID. More...
 
#define ELABORATE_TASK_ID   (2)
 Elaborate data task ID. More...
 
#define SENSOR_TASK_ID   (3)
 Sensor acquire task ID. More...
 
#define ACCELEROMETER_TASK_ID   (4)
 Accelerometer task ID. More...
 
#define WDT_TASK_ID   (5)
 Watch Dog task ID. More...
 
#define TOTAL_INFO_TASK   (WDT_TASK_ID + 1)
 Total Max Task for WDT Task Control. More...
 
#define WAIT_QUEUE_REQUEST_PUSHDATA_MS   (500)
 Time to wait pushing data queue. More...
 
#define WAIT_QUEUE_REQUEST_COMMAND_MS   (500)
 Time to wait pushing command queue. More...
 
#define WAIT_QUEUE_REQUEST_RESET_TIP_MS   (2000)
 Time to wait event reset get tips command. More...
 
#define RAIN_TIPPING_DELAY_MS   (100)
 Default value for sensor acquire task delay tipping. More...
 
#define RAIN_TIPPING_INIBITH_DELAY_MS   (500)
 Default value for inibith tipping from 2 events. More...
 
#define RAIN_TIPS_FOR_EVENT   (2)
 How much mm (scaled RMAP) of rain for one tip of tipping bucket rain gauge. More...
 
#define USE_TIPPING_BUCKET_REDUNDANT   (true)
 Use redundant PIN tipping (verify and alert) More...
 
#define USE_CLOGGED_UP_CONTROL   (true)
 Use clogged UP system control (verify and alert) More...
 
#define USE_TIPPING_CONTROL   (false)
 Use strict tipping timings mode. More...
 
#define TIPPING_EVENT_VALUE   HIGH
 Input PIN tipping expected event value. More...
 
#define TIPPING_BUCKET_PIN   PIN_IN0
 Input PIN tipping. More...
 
#define TIPPING_BUCKET_PIN_REDUNDANT   PIN_IN1
 Redundant PIN tipping (verify and alert) More...
 
#define CLOGGED_UP_PIN   PIN_IN2
 Clogged Up Alert PIN. More...
 
#define CLOGGED_EVENT_VALUE   LOW
 Input PIN clogged expected event value. More...
 
#define SAMPLES_COUNT_MAX   (3600)
 Sample and default value for elaborate task. More...
 
#define OBSERVATIONS_TIME_S   (60)
 Default observation (RMAP) time in second. More...
 
#define REPORTS_TIME_S   (900)
 Default report (RMAP) time in second. More...
 
#define USE_MOBILE_TPR_60_S_AVG_MODE   (false)
 Using mobile scrolling max -> avg value by 60 sec. on all data buffered consecutive. More...
 
#define REPORT_INVALID_ACQUIRE_MIN_MS   (3000)
 Minimal timing for 2 report calculate (less can be only a command retry) More...
 
#define SAMPLES_ACQUIRE_MS   (10000)
 Timing for acquire and check TPR elaboration. More...
 
#define SAMPLES_NEED_TPR_60_S   (60000 / SAMPLES_ACQUIRE_MS)
 Samples need for TPR over 1'. More...
 
#define SAMPLES_NEED_TPR_05_M   (300000 / SAMPLES_ACQUIRE_MS)
 Samples need for TPR over 5'. More...
 
#define RAIN_TIPS_INDEX   (0)
 
#define RAIN_RAIN_INDEX   (1)
 
#define RAIN_FULL_INDEX   (2)
 
#define RAIN_TIPS_RESET   (3)
 
#define RAIN_SCROLL_INDEX   (4)
 
#define RAIN_SCROLL_RESET   (5)
 
#define MAX_VALID_RAIN   (1000.0)
 Limit MAX valid range for module sensor. More...
 
#define MIN_VALID_RAIN   (0.0)
 Limit MIN valid range for module sensor. More...
 
#define RAIN_RATE_MULTIPLY   (1000)
 RMAP Multiply value for TPR Elaboration. More...
 
#define SAMPLE_ERROR_PERCENTAGE_MIN   (90.0)
 Samples min percent valid on elaboration data. More...
 
#define OBSERVATION_ERROR_PERCENTAGE_MIN   (90.0)
 Observation min percent valid on elaboration data. More...
 

Macro Definition Documentation

◆ ACCELEROMETER_TASK_ID

#define ACCELEROMETER_TASK_ID   (4)

Accelerometer task ID.

Definition at line 176 of file config.h.

◆ ALL_TASK_ID

#define ALL_TASK_ID   (99)

All task ID. Send message to ALL Task.

Definition at line 166 of file config.h.

◆ BOOT_LOADER_STRUCT_ADDR

#define BOOT_LOADER_STRUCT_ADDR   (START_EEPROM_ADDRESS)

Bootloader start address

Definition at line 118 of file config.h.

◆ BOOT_LOADER_STRUCT_END

#define BOOT_LOADER_STRUCT_END   (START_EEPROM_ADDRESS + BOOT_LOADER_STRUCT_SIZE)

Bootloader struct end address

Definition at line 122 of file config.h.

◆ BOOT_LOADER_STRUCT_SIZE

#define BOOT_LOADER_STRUCT_SIZE   (sizeof(bootloader_t))

Bootloader struct size.

Definition at line 120 of file config.h.

◆ CAN_TASK_ID

#define CAN_TASK_ID   (1)

CAN task ID.

Definition at line 170 of file config.h.

◆ CLOGGED_EVENT_VALUE

#define CLOGGED_EVENT_VALUE   LOW

Input PIN clogged expected event value.

Definition at line 219 of file config.h.

◆ CLOGGED_UP_PIN

#define CLOGGED_UP_PIN   PIN_IN2

Clogged Up Alert PIN.

Definition at line 217 of file config.h.

◆ CONFIGURATION_EEPROM_ADDRESS

#define CONFIGURATION_EEPROM_ADDRESS   (20)

Start Address EEPROM configuration.

Definition at line 128 of file config.h.

◆ DEBUG_MODE

#define DEBUG_MODE   (false)

Enable control Error for Debug.

Definition at line 61 of file config.h.

◆ ELABORATE_DATA_QUEUE_LENGTH

#define ELABORATE_DATA_QUEUE_LENGTH   (6)

Elaborate data message queue length.

Definition at line 154 of file config.h.

◆ ELABORATE_TASK_ID

#define ELABORATE_TASK_ID   (2)

Elaborate data task ID.

Definition at line 172 of file config.h.

◆ ENABLE_ACCELEROMETER

#define ENABLE_ACCELEROMETER   (true)

Enable I2C Accelerometer.

Definition at line 77 of file config.h.

◆ ENABLE_CAN

#define ENABLE_CAN   (true)

Enable CAN BUS interface.

Definition at line 75 of file config.h.

◆ ENABLE_DIAG_PIN

#define ENABLE_DIAG_PIN   (false)

Enable HW Diag PIN redefine.

Definition at line 80 of file config.h.

◆ ENABLE_I2C1

#define ENABLE_I2C1   (true)

Enable I2C1 interface.

Definition at line 69 of file config.h.

◆ ENABLE_I2C2

#define ENABLE_I2C2   (true)

Enable I2C2 interface.

Definition at line 71 of file config.h.

◆ ENABLE_QSPI

#define ENABLE_QSPI   (true)

Enable QSPI interface.

Definition at line 73 of file config.h.

◆ ENABLE_RTC

#define ENABLE_RTC   (true)

Enable RTC Interface.

Definition at line 106 of file config.h.

◆ ENABLE_STACK_USAGE

#define ENABLE_STACK_USAGE   (true)

Enable stack usage.

Definition at line 92 of file config.h.

◆ ENABLE_WDT

#define ENABLE_WDT   (true)

Enable WatchDog Task and Module.

Definition at line 84 of file config.h.

◆ ERROR_HANDLER_CB

#define ERROR_HANDLER_CB   (false)

Definition at line 62 of file config.h.

◆ MAX_VALID_RAIN

#define MAX_VALID_RAIN   (1000.0)

Limit MAX valid range for module sensor.

Definition at line 255 of file config.h.

◆ MIN_VALID_RAIN

#define MIN_VALID_RAIN   (0.0)

Limit MIN valid range for module sensor.

Definition at line 257 of file config.h.

◆ MODULE_MAIN_VERSION

#define MODULE_MAIN_VERSION   (4)

Module main version.

Definition at line 34 of file config.h.

◆ MODULE_MINOR_VERSION

#define MODULE_MINOR_VERSION   (3)

Module minor version.

Definition at line 37 of file config.h.

◆ MODULE_TYPE

#define MODULE_TYPE   (STIMA_MODULE_TYPE_TH)

Type of module. It is defined in registers.h.

Definition at line 55 of file config.h.

◆ NORMAL_STATE

#define NORMAL_STATE   (0)

Monitor No Sleep / No Suspend.

Definition at line 96 of file config.h.

◆ OBSERVATION_ERROR_PERCENTAGE_MIN

#define OBSERVATION_ERROR_PERCENTAGE_MIN   (90.0)

Observation min percent valid on elaboration data.

Definition at line 264 of file config.h.

◆ OBSERVATIONS_TIME_S

#define OBSERVATIONS_TIME_S   (60)

Default observation (RMAP) time in second.

Definition at line 227 of file config.h.

◆ RAIN_FULL_INDEX

#define RAIN_FULL_INDEX   (2)

Definition at line 249 of file config.h.

◆ RAIN_QUEUE_LENGTH

#define RAIN_QUEUE_LENGTH   (1)

Request sensor queue length.

Definition at line 160 of file config.h.

◆ RAIN_RAIN_INDEX

#define RAIN_RAIN_INDEX   (1)

Definition at line 248 of file config.h.

◆ RAIN_RATE_MULTIPLY

#define RAIN_RATE_MULTIPLY   (1000)

RMAP Multiply value for TPR Elaboration.

Definition at line 259 of file config.h.

◆ RAIN_SCROLL_INDEX

#define RAIN_SCROLL_INDEX   (4)

Definition at line 251 of file config.h.

◆ RAIN_SCROLL_RESET

#define RAIN_SCROLL_RESET   (5)

Definition at line 252 of file config.h.

◆ RAIN_TIPPING_DELAY_MS

#define RAIN_TIPPING_DELAY_MS   (100)

Default value for sensor acquire task delay tipping.

Definition at line 193 of file config.h.

◆ RAIN_TIPPING_INIBITH_DELAY_MS

#define RAIN_TIPPING_INIBITH_DELAY_MS   (500)

Default value for inibith tipping from 2 events.

Definition at line 195 of file config.h.

◆ RAIN_TIPS_FOR_EVENT

#define RAIN_TIPS_FOR_EVENT   (2)

How much mm (scaled RMAP) of rain for one tip of tipping bucket rain gauge.

Definition at line 198 of file config.h.

◆ RAIN_TIPS_INDEX

#define RAIN_TIPS_INDEX   (0)

Definition at line 247 of file config.h.

◆ RAIN_TIPS_RESET

#define RAIN_TIPS_RESET   (3)

Definition at line 250 of file config.h.

◆ REGISTER_EEPROM_ADDRESS

#define REGISTER_EEPROM_ADDRESS   (START_EEPROM_ADDRESS + SIZE_EEPROM_RESERVED)

Start Standard UAVCAN Register.

Definition at line 130 of file config.h.

◆ REPORT_DATA_QUEUE_LENGTH

#define REPORT_DATA_QUEUE_LENGTH   (1)

Report data message queue length.

Definition at line 158 of file config.h.

◆ REPORT_INVALID_ACQUIRE_MIN_MS

#define REPORT_INVALID_ACQUIRE_MIN_MS   (3000)

Minimal timing for 2 report calculate (less can be only a command retry)

Definition at line 238 of file config.h.

◆ REPORTS_TIME_S

#define REPORTS_TIME_S   (900)

Default report (RMAP) time in second.

Definition at line 229 of file config.h.

◆ REQUEST_DATA_QUEUE_LENGTH

#define REQUEST_DATA_QUEUE_LENGTH   (1)

Request data message queue length.

Definition at line 156 of file config.h.

◆ RMAP_PROCOTOL_VERSION

#define RMAP_PROCOTOL_VERSION   (1)

rmap protocol version

Definition at line 40 of file config.h.

◆ RTC_WAIT_DELAY_MS

#define RTC_WAIT_DELAY_MS   (100)

Delay for RTC in milliseconds.

Definition at line 108 of file config.h.

◆ SAMPLE_ERROR_PERCENTAGE_MIN

#define SAMPLE_ERROR_PERCENTAGE_MIN   (90.0)

Samples min percent valid on elaboration data.

Definition at line 262 of file config.h.

◆ SAMPLES_ACQUIRE_MS

#define SAMPLES_ACQUIRE_MS   (10000)

Timing for acquire and check TPR elaboration.

Definition at line 240 of file config.h.

◆ SAMPLES_COUNT_MAX

#define SAMPLES_COUNT_MAX   (3600)

Sample and default value for elaborate task.

Definition at line 225 of file config.h.

◆ SAMPLES_NEED_TPR_05_M

#define SAMPLES_NEED_TPR_05_M   (300000 / SAMPLES_ACQUIRE_MS)

Samples need for TPR over 5'.

Definition at line 244 of file config.h.

◆ SAMPLES_NEED_TPR_60_S

#define SAMPLES_NEED_TPR_60_S   (60000 / SAMPLES_ACQUIRE_MS)

Samples need for TPR over 1'.

Definition at line 242 of file config.h.

◆ SENSOR_TASK_ID

#define SENSOR_TASK_ID   (3)

Sensor acquire task ID.

Definition at line 174 of file config.h.

◆ SERIAL_DEBUG_BAUD_RATE

#define SERIAL_DEBUG_BAUD_RATE   (115200)

Monitor Debug Serial speed.

Definition at line 133 of file config.h.

◆ SIZE_EEPROM_RESERVED

#define SIZE_EEPROM_RESERVED   (450)

Size EEPROM reserved address. Must be > CONFIGURATION_EEPROM_END.

Definition at line 116 of file config.h.

◆ SLEEP_STATE

#define SLEEP_STATE   (1)

Sleep Task For Wdt or LowPower Check

Definition at line 98 of file config.h.

◆ START_EEPROM_ADDRESS

#define START_EEPROM_ADDRESS   (0)

Starting EEPROM address.

Definition at line 114 of file config.h.

◆ SUPERVISOR_TASK_ID

#define SUPERVISOR_TASK_ID   (0)

Supervisor task ID.

Definition at line 168 of file config.h.

◆ SUSPEND_STATE

#define SUSPEND_STATE   (2)

Suspend Task from Wdt

Definition at line 100 of file config.h.

◆ SYSTEM_MESSAGE_QUEUE_LENGTH

#define SYSTEM_MESSAGE_QUEUE_LENGTH   (4)

Request system message queue length.

Definition at line 152 of file config.h.

◆ TIPPING_BUCKET_PIN

#define TIPPING_BUCKET_PIN   PIN_IN0

Input PIN tipping.

Definition at line 213 of file config.h.

◆ TIPPING_BUCKET_PIN_REDUNDANT

#define TIPPING_BUCKET_PIN_REDUNDANT   PIN_IN1

Redundant PIN tipping (verify and alert)

Definition at line 215 of file config.h.

◆ TIPPING_EVENT_VALUE

#define TIPPING_EVENT_VALUE   HIGH

Input PIN tipping expected event value.

Definition at line 211 of file config.h.

◆ TOTAL_INFO_TASK

#define TOTAL_INFO_TASK   (WDT_TASK_ID + 1)

Total Max Task for WDT Task Control.

Definition at line 180 of file config.h.

◆ UNUSED_SUB_POSITION

#define UNUSED_SUB_POSITION   (0)

Monitor Sub Position not used flag.

Definition at line 94 of file config.h.

◆ USE_CLOGGED_UP_CONTROL

#define USE_CLOGGED_UP_CONTROL   (true)

Use clogged UP system control (verify and alert)

Definition at line 206 of file config.h.

◆ USE_MOBILE_TPR_60_S_AVG_MODE

#define USE_MOBILE_TPR_60_S_AVG_MODE   (false)

Using mobile scrolling max -> avg value by 60 sec. on all data buffered consecutive.

Definition at line 236 of file config.h.

◆ USE_TIPPING_BUCKET_REDUNDANT

#define USE_TIPPING_BUCKET_REDUNDANT   (true)

Use redundant PIN tipping (verify and alert)

Definition at line 204 of file config.h.

◆ USE_TIPPING_CONTROL

#define USE_TIPPING_CONTROL   (false)

Use strict tipping timings mode.

Definition at line 208 of file config.h.

◆ WAIT_QUEUE_REQUEST_COMMAND_MS

#define WAIT_QUEUE_REQUEST_COMMAND_MS   (500)

Time to wait pushing command queue.

Definition at line 188 of file config.h.

◆ WAIT_QUEUE_REQUEST_PUSHDATA_MS

#define WAIT_QUEUE_REQUEST_PUSHDATA_MS   (500)

Time to wait pushing data queue.

Definition at line 186 of file config.h.

◆ WAIT_QUEUE_REQUEST_RESET_TIP_MS

#define WAIT_QUEUE_REQUEST_RESET_TIP_MS   (2000)

Time to wait event reset get tips command.

Definition at line 190 of file config.h.

◆ WDT_CONTROLLER_MS

#define WDT_CONTROLLER_MS   (2000)

Task milliseconds minimal check.

Definition at line 90 of file config.h.

◆ WDT_STARTING_TASK_MS

#define WDT_STARTING_TASK_MS   (60000)

Init WatchDog Task local milliseconds.

Definition at line 88 of file config.h.

◆ WDT_TASK_ID

#define WDT_TASK_ID   (5)

Watch Dog task ID.

Definition at line 178 of file config.h.

◆ WDT_TIMEOUT_BASE_US

#define WDT_TIMEOUT_BASE_US   (8000000)

WatchDog Hardware microseconds timeout.

Definition at line 86 of file config.h.