// ----------------------------------------------------------------------------- /// @file hsb-mrts.h /// @brief File description // ----------------------------------------------------------------------------- // Micro-Key bv // Industrieweg 28, 9804 TG Noordhorn // Postbus 92, 9800 AB Zuidhorn // The Netherlands // Tel: +31 594 503020 // Fax: +31 594 505825 // Email: support@microkey.nl // Web: www.microkey.nl // ----------------------------------------------------------------------------- /// $Revision$ /// $Author$ /// $Date$ // (c) 2015 Micro-Key bv // ----------------------------------------------------------------------------- /// @defgroup {group_name} {group_description} /// Description /// @file hsb-mrts.h /// @ingroup {group_name} #ifndef HSB_MRTS_H_ #define HSB_MRTS_H_ // ----------------------------------------------------------------------------- // Include files // ----------------------------------------------------------------------------- #include "stm32f10x.h" #include "RepairPreset.h" #include "RepairPresets.h" #include "gpio.h" #include "InternalFlash.h" // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- #define HSB_MAINMENU_TASK_PRIORITY (2) #define HSB_MAINMENU_TASK_STACKSIZE (512) #define HSB_MAINDISP_TASK_PRIORITY (2) #define HSB_MAINDISP_TASK_STACKSIZE (256) #define HSB_MAINREPR_TASK_PRIORITY (2) #define HSB_MAINREPR_TASK_STACKSIZE (512) #define HSB_MAINREPR_OOL_DURATION (20) #define HSB_MAINREPR_OOL_VALUE (300) #define HSB_SECURITY_VOLTAGE_THRESHOLD (100) #define HSB_ADC_ANODE_MIN_VOLTAGE (0) #define HSB_ADC_ANODE_MAX_VOLTAGE (10042) #define HSB_ADC_CMCP_MIN_VOLTAGE (0) #define HSB_ADC_CMCP_MAX_VOLTAGE (-2018) #define HSB_ADC_TESLA_MIN_VOLTAGE (0) #define HSB_ADC_TESLA_MAX_VOLTAGE (6070) #define HSB_DAC_ANODE_MIN_VOLTAGE (0) #define HSB_DAC_ANODE_MAX_VOLTAGE (10100) #define HSB_DAC_CMCP_MIN_VOLTAGE (0) #define HSB_DAC_CMCP_MAX_VOLTAGE (-2200) #define HSB_DAC_TESLA_MIN_VOLTAGE (0) #define HSB_DAC_TESLA_MAX_VOLTAGE (6200) // FLASH ADDRESSES FOR DATA STORAGE // Define storage for presets, which is the biggest storage part // Each set of presets is written/saved on a dedicated page. This reduces // cache size when erasing page prior to write #define APP_FLASH_PRESET_ANODE_PAGE (122) #define APP_FLASH_PRESET_CATHODE_PAGE (123) #define APP_FLASH_PRESET_MCP_PAGE (124) #define APP_FLASH_PRESET_TESLA_PAGE (125) #define APP_FLASH_STORAGE_PRESET_SIZE (sizeof(struct RepairPreset) * REPAIR_PRESETS_NUMBER_OF_PRESETS) #define APP_FLASH_STORAGE_PRESET_ANODE (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PRESET_ANODE_PAGE) #define APP_FLASH_STORAGE_PRESET_CATHODE (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PRESET_CATHODE_PAGE) #define APP_FLASH_STORAGE_PRESET_MCP (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PRESET_MCP_PAGE) #define APP_FLASH_STORAGE_PRESET_TESLA (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PRESET_TESLA_PAGE) // Define storage for device parameters like PID constants and others #define APP_FLASH_PARAMETERS_PAGE (126) #define APP_FLASH_STORAGE_PARAMETERS (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PARAMETERS_PAGE) // Define storage for power-down detection flag #define APP_FLASH_POWERDOWN_PAGE (127) #define APP_FLASH_STORAGE_POWERDOWN (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_POWERDOWN_PAGE) // Exports of objects on application level extern struct Display* const mainDisplay; // ----------------------------------------------------------------------------- // Type definitions. // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Function declarations // ----------------------------------------------------------------------------- /** ---------------------------------------------------------------------------- * hsb_generateStartScreen * Description of function * * @param Display * @param * @return ErrorStatus * * @todo * ----------------------------------------------------------------------------- */ extern ErrorStatus hsb_generateStartScreen(struct Display* Display); extern ErrorStatus hsb_enableSafety(void); extern ErrorStatus hsb_disableSafety(void); #endif /* HSB_MRTS_H_ */