Index: NVDataMgmt.h =================================================================== diff -u -r9a59cef171550b5a9cb4f3028520c5d3f9d0c4c0 -r0f1d0c443daee3e30ae823711e85f3410bbf49fe --- NVDataMgmt.h (.../NVDataMgmt.h) (revision 9a59cef171550b5a9cb4f3028520c5d3f9d0c4c0) +++ NVDataMgmt.h (.../NVDataMgmt.h) (revision 0f1d0c443daee3e30ae823711e85f3410bbf49fe) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file NVDataMgmt.h * -* @author (last) Dara Navaei -* @date (last) 20-Mar-2020 +* @author (last) Sean Nash +* @date (last) 20-Nov-2020 * * @author (original) Dara Navaei * @date (original) 12-Feb-2020 @@ -20,13 +20,22 @@ #include "Common.h" +/** + * @defgroup NVDataMgmt NVDataMgmt + * @brief Non-volatile data management module. Handles Bank 7 of the TI processor and the + * RAM of the RTC chip + * + * @addtogroup NVDataMgmt + * @{ + */ + // ********** public definitions ********** #define MAX_SYS_SERIAL_NUMBER_CHARACTERS 7U ///< Max number of characters for SYS serial number #define MAX_HW_SERIAL_NUMBER_CHARACTERS 5U ///< Max number of characters for HD serial number #define MAX_DATE_CHARACTERS 10U ///< Max number of characters for date -/// Log event enum +/// Log event enumeration. typedef enum LOG_EVENT { NVDATAMGMT_MODE_CHANGE = 0, ///< Mode change @@ -38,7 +47,7 @@ NVDATAMGMT_UI_CRASHED ///< UI crashed } NVDATAMGMT_LOG_EVENT_T; -/// Read status enum +/// Read status enumeration. typedef enum READ_STATUS { NVDATAMGMT_READ_IDLE = 0, ///< Read status idle @@ -47,15 +56,15 @@ } NVDATAMGMT_READ_STATUS_T; #pragma pack(push, 1) -/// Manufacturing data struct +/// Manufacturing data structure. typedef struct mfg_Data { char SYSSerialNumber [ MAX_SYS_SERIAL_NUMBER_CHARACTERS ]; ///< SYS serial number char HWSerialNumber [ MAX_HW_SERIAL_NUMBER_CHARACTERS ]; ///< HW serial number char mfgDate [ MAX_DATE_CHARACTERS ]; ///< Manufacturing date } MFG_DATA_T; -/// Calibration data struct +/// Calibration data structure. typedef struct calibration_Data { U32 calRecordRevision; ///< Revision of calibration record (rev when structure changes to determine compatibility with f/w version) @@ -73,21 +82,21 @@ char calDateAccel[ MAX_DATE_CHARACTERS ]; ///< Last calibration date of accelerometer } CALIBRATION_DATA_T; -/// Service dates struct +/// Service dates structure. typedef struct service_dates { char currentServiceDate [ MAX_DATE_CHARACTERS ]; ///< Current service date char nextServiceDate [ MAX_DATE_CHARACTERS ]; ///< Next service date } SERVICE_DATA_T; -/// Read data status +/// Read data status structure. typedef struct get_data { NVDATAMGMT_READ_STATUS_T status; ///< Read data status U08* externalBuffer; ///< External buffer address } READ_DATA_T; -/// Log data struct +/// Log data structure. typedef struct { U32 epochTime; ///< Log data time in epoch @@ -100,11 +109,19 @@ F32 data5; ///< Log data 5 } LOG_DATA_T; -/// Disinfection date struct +/// Disinfection date structure. typedef struct { - char disinfectionDate [ MAX_DATE_CHARACTERS ]; ///< Disinfection Date + char disinfectionDate [ MAX_DATE_CHARACTERS ]; ///< Disinfection Date } DISINFECTION_DATE_T; + +/// Payload record structure for a linear calibration message. +typedef struct +{ + F32 gain; + F32 offset; +} LINEAR_F32_CAL_PAYLOAD_T; + #pragma pack(pop) void initNVDataMgmt ( void ); @@ -116,35 +133,30 @@ SELF_TEST_STATUS_T execNVDataMgmtSelfTest ( void ); BOOL setBootloaderFlag ( U32 flag ); - U32 getBootloaderFlag ( void ); BOOL setMfgData ( MFG_DATA_T data ); - BOOL getMfgData ( MFG_DATA_T* buffer ); BOOL setCalibrationData ( CALIBRATION_DATA_T data ); - BOOL getCalibrationData ( CALIBRATION_DATA_T* buffer ); +BOOL testResetCalibrationData( U32 key ); BOOL setServiceDate ( SERVICE_DATA_T data ); - BOOL getServiceDate ( SERVICE_DATA_T* buffer ); BOOL setTreatmentTime ( U32 hours ); - U32 getTreatmentTime ( void ); BOOL setWaterConsumption ( U32 liters ); - U32 getWaterConsumption ( void ); BOOL setDisinfectionDate ( DISINFECTION_DATE_T date ); - BOOL getDisinfectionDate ( DISINFECTION_DATE_T* buffer ); BOOL writeLogData ( LOG_DATA_T* data ); - BOOL readLogData ( READ_DATA_T* buffer, U32 length ); -#endif /* FWCOMMON_NVDATAMGMT_H_ */ +/**@}*/ + +#endif