Added calibration setpoints
git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@417 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file CalibrationSetpoints.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 CalibrationSetpoints.h
|
||||
/// @ingroup {group_name}
|
||||
|
||||
#ifndef CALIBRATIONPARAMETERS_H_
|
||||
#define CALIBRATIONPARAMETERS_H_
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "CalibrationParameters.h"
|
||||
#include "MemoryDevice.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationParameters_construct
|
||||
* Description of function
|
||||
*
|
||||
* @param para1_name
|
||||
* @param para2_name
|
||||
* @return return_type
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus CalibrationParameters_construct(struct MemoryDevice* memoryDevice);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationParameters_destruct
|
||||
* Description of function
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationParameters_destruct(void);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationParameters_getCalibrationSetpoints
|
||||
* Description of function
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return struct CalibrationSetpoints*
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern struct CalibrationSetpoints* CalibrationParameters_getCalibrationSetpoints(void);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationParameters_setCalibrationSetpoints
|
||||
* Description of function
|
||||
*
|
||||
* @param setpoints
|
||||
*
|
||||
* @return ErrorStatus
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus CalibrationParameters_setCalibrationSetpoints(struct CalibrationSetpoints* setpoints);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationParameters_saveParameters
|
||||
* Description of function
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationParameters_saveParameters(void);
|
||||
|
||||
|
||||
#endif /* CALIBRATIONPARAMETERS_H_ */
|
||||
@@ -0,0 +1,85 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file CalibrationSetpoint.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 CalibrationSetpoint.h
|
||||
/// @ingroup {group_name}
|
||||
|
||||
#ifndef CALIBRATIONSETPOINT_H_
|
||||
#define CALIBRATIONSETPOINT_H_
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
struct CalibrationSetpoint
|
||||
{
|
||||
int low; // Low calibration setpoint
|
||||
int high; // High calibration setpoint
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoint_LowSetpoint
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param lowSetpoint
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationSetpoint_setLowSetpoint(struct CalibrationSetpoint* self, int lowSetpoint);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoints_setHighSetpoint
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param highSetpoint
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationSetpoint_setHighSetpoint(struct CalibrationSetpoint* self, int highSetpoint);
|
||||
|
||||
|
||||
#endif /* CALIBRATIONSETPOINT_H_ */
|
||||
@@ -0,0 +1,121 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file CalibrationSetpoints.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 CalibrationSetpoints.h
|
||||
/// @ingroup {group_name}
|
||||
|
||||
#ifndef CALIBRATIONSETPOINTS_H_
|
||||
#define CALIBRATIONSETPOINTS_H_
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "CalibrationSetpoint.h"
|
||||
|
||||
enum CALIBRATION_SETPOINT_ID
|
||||
{
|
||||
CALIBRATION_SETPOINT_CATHODE,
|
||||
CALIBRATION_SETPOINT_MCP,
|
||||
CALIBRATION_SETPOINT_TESLA,
|
||||
CALIBRATION_SETPOINT_ANODE,
|
||||
CALIBRATION_SETPOINT_LAST
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
struct CalibrationSetpoints
|
||||
{
|
||||
struct CalibrationSetpoint setpoints[CALIBRATION_SETPOINT_LAST];
|
||||
enum CALIBRATION_SETPOINT_ID currentActiveSetpointSet;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoints_generateDefaultParameters
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationSetpoints_generateDefaultParameters(struct CalibrationSetpoints* self);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoints_getSetpoint
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param setpointIdentifier
|
||||
* @return struct CalibrationSetpoint*
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern struct CalibrationSetpoint* CalibrationSetpoints_getSetpoint(struct CalibrationSetpoints* self, enum CALIBRATION_SETPOINT_ID setpointIdentifier);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoints_setActiveSetpointSet
|
||||
* Description of function
|
||||
*
|
||||
* @param para1_name
|
||||
* @param para2_name
|
||||
* @return return_type
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void CalibrationSetpoints_setActiveSetpointSet(struct CalibrationSetpoints* self, enum CALIBRATION_SETPOINT_ID setpointIdentifier);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* CalibrationSetpoints_getActiveSetpointSet
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param setpointIdentifier
|
||||
* @return struct CalibrationSetpoint*
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern struct CalibrationSetpoint* CalibrationSetpoints_getActiveSetpointSet(struct CalibrationSetpoints* self);
|
||||
|
||||
|
||||
|
||||
#endif /* CALIBRATIONSETPOINTS_H_ */
|
||||
@@ -11,9 +11,9 @@
|
||||
// Email: support@microkey.nl
|
||||
// Web: www.microkey.nl
|
||||
// -----------------------------------------------------------------------------
|
||||
/// $Revision: $
|
||||
/// $Author: $
|
||||
/// $Date: $
|
||||
/// $Revision$
|
||||
/// $Author$
|
||||
/// $Date$
|
||||
// (c) 2015 Micro-Key bv
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
#include "PIDParameters.h"
|
||||
#include "PIN.h"
|
||||
|
||||
#include "CachedStorage.h"
|
||||
#include "MemoryDevice.h"
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
@@ -64,7 +65,7 @@
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus DeviceParameters_construct(struct CachedStorage* parametersStorage, struct MemoryDevice* memoryDevice);
|
||||
extern ErrorStatus DeviceParameters_construct(struct MemoryDevice* memoryDevice);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
@@ -121,6 +122,8 @@ extern struct PIN* DeviceParameters_getPIN(void);
|
||||
extern void DeviceParameters_saveParameters(void);
|
||||
|
||||
ErrorStatus DeviceParameters_writePIDParameters(struct PIDParameters* parameters);
|
||||
|
||||
|
||||
ErrorStatus DeviceParameters_writePIN(struct PIN* pin);
|
||||
|
||||
#endif /* DEVICEPARAMETERS_H_ */
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef enum
|
||||
REPAIR_FAIL,
|
||||
ERROR_CRC_PIN,
|
||||
ERROR_CRC_PARAMETERS,
|
||||
ERROR_CRC_CALIBRATION,
|
||||
ERROR_CRC_PRESETS
|
||||
} T_ErrorCode;
|
||||
|
||||
|
||||
@@ -103,6 +103,10 @@ typedef enum
|
||||
// --------------------------------------------------------------------------
|
||||
RM_CALIBRATIONMENU_PIN_VERIFICATION,
|
||||
RM_CALIBRATIONMENU,
|
||||
RM_CALIBRATION_CATHOEMCP_SELECT,
|
||||
RM_CALIBRATION_SETPOINT_MENU,
|
||||
RM_CALIBRATION_SETPOINT_LOW,
|
||||
RM_CALIBRATION_SETPOINT_HIGH,
|
||||
|
||||
RM_ERROR_STATE,
|
||||
RM_WARNING_STATE,
|
||||
|
||||
@@ -146,6 +146,17 @@ static const char MenuText_ERROR_CRC_PARAMETERS[MENUTEXT_NUMBER_OF_LANGUAGES][ME
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_CRC_CALIBRATION[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
// MAX 20 CHARACTERS
|
||||
{
|
||||
"SETPOINT CRC ERROR"
|
||||
},
|
||||
{
|
||||
"ERREUR SETPOINT CRC"
|
||||
}
|
||||
};
|
||||
|
||||
static const char MenuText_ERROR_CRC_PRESETS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] =
|
||||
{
|
||||
// MAX 20 CHARACTERS
|
||||
@@ -665,7 +676,7 @@ static const char MenuText_CALIBRATIONMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCOR
|
||||
// MAX 20 CHARACTERS - MIND THE TWO BLANKS AT STRING START - THIS IS WHERE THE CURSOR IS PUT
|
||||
{
|
||||
"Calibration",
|
||||
" 1.To be written",
|
||||
" 1.Setpoint check",
|
||||
|
||||
},
|
||||
{
|
||||
@@ -674,6 +685,24 @@ static const char MenuText_CALIBRATIONMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCOR
|
||||
}
|
||||
};
|
||||
|
||||
// Calibration SETPOINT CHECK
|
||||
static const char MenuText_CALIBRATION_SETPOINTMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_NUMBER_OF_ROWS][MENUCORE_DISPLAY_ROW_LENGTH] =
|
||||
{
|
||||
// MAX 20 CHARACTERS - MIND THE TWO BLANKS AT STRING START - THIS IS WHERE THE CURSOR IS PUT
|
||||
{
|
||||
"Setpoint check",
|
||||
" 1.Low Setpoint",
|
||||
" 2.High Setpoint"
|
||||
|
||||
},
|
||||
{
|
||||
"Setpoint check",
|
||||
" 1.Low Setpoint",
|
||||
" 2.High Setpoint"
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -68,7 +68,7 @@ typedef enum
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus RepairPresets_construct(struct CachedStorage* presetStorage, struct MemoryDevice* memoryDevice);
|
||||
extern ErrorStatus RepairPresets_construct(struct MemoryDevice* memoryDevice);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
|
||||
@@ -73,16 +73,20 @@
|
||||
// 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_PRESET_ANODE_PAGE (121)
|
||||
#define APP_FLASH_PRESET_CATHODE_PAGE (122)
|
||||
#define APP_FLASH_PRESET_MCP_PAGE (123)
|
||||
#define APP_FLASH_PRESET_TESLA_PAGE (124)
|
||||
#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 Calibration parameters (setpoints etc)
|
||||
#define APP_FLASH_CALIBRATION_PAGE (125)
|
||||
#define APP_FLASH_STORAGE_CALIBRATION (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_CALIBRATION_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)
|
||||
|
||||
Reference in New Issue
Block a user