initial commit

Revision:
54:31921ad29828
Parent:
53:644c5f6300da
Child:
55:215da406282b
--- a/inc/admw_api.h	Wed Feb 19 09:09:59 2020 +0000
+++ b/inc/admw_api.h	Wed Feb 19 10:08:13 2020 +0000
@@ -51,6 +51,7 @@
 #include "inc/admw_log.h"
 #include "inc/admw_time.h"
 #include "inc/admw1001/admw1001_sensor_types.h"
+#include "inc/admw1001/admw1001_lut_data.h"
 
 /*! @defgroup ADMW_Api ADMW Host Library API
  *  Host library API common to the ADMW product family.
@@ -658,6 +659,72 @@
     ADMW_STATUS         * const pStatus);
 
 /*!
+ * @brief Assemble a list of separate Look-Up Tables into a single buffer
+ *
+ * @param[out] pLutBuffer    Pointer to the Look-Up Table data buffer where
+ *                           the assembled Look-Up Table data will be placed
+ * @param[in] nLutBufferSize Allocated size, in bytes, of the output data buffer
+ * @param[in] nNumTables     Number of tables to add to the Look-Up Table buffer
+ * @param[in] ppDesc         Array of pointers to the table descriptors to be added
+ * @param[in] ppData         Array of pointers to the table data to be added
+ *
+ * @return Status
+ *         - #ADMW_SUCCESS Call completed successfully.
+ *
+ * @details This utiliity function fills the Look-up Table header fields; then
+ *          walks through the array of individual table descriptor and data
+ *          pointers provided, appending (copying) each one to the Look-Up Table
+ *          data buffer. The length and crc16 fields of each table descriptor
+ *          will be calculated and filled by this function, but other fields in
+ *          the descriptor structure must be filled by the caller beforehand.
+ *
+ * @note    The assembled LUT data buffer filled by this function can then be
+ *          written to the device memory using @ref admw1001_SetLutData.
+ */
+ADMW_RESULT admw1001_AssembleLutData(
+    ADMW1001_LUT            *pLutBuffer,
+    unsigned                nLutBufferSize,
+    unsigned                const nNumTables,
+    ADMW1001_LUT_DESCRIPTOR *const ppDesc[],
+    ADMW1001_LUT_TABLE_DATA *const ppData[]);
+
+/*!
+ * @brief Write Look-Up Table data to the device memory
+ *
+ * @param[in]  hDevice  ADMW1001 device context handle
+ * @param[out] pLutData Pointer to the Look-Up Table data structure
+ *
+ * @return Status
+ *         - #ADMW_SUCCESS Call completed successfully.
+ *
+ * @details Validates the Look-Up Table data format and loads it into
+ *          device memory via dedicated keyhole registers.
+ *
+ * @note Settings are not applied until admw_ApplyConfigUpdates() is called
+ */
+ADMW_RESULT admw1001_SetLutData(
+    ADMW_DEVICE_HANDLE  hDevice,
+    ADMW1001_LUT        *const pLutData);
+
+/*!
+ * @brief Write Look-Up Table raw data to the device memory
+ *
+ * @param[in]  hDevice  ADMW device context handle
+ * @param[out] pLutData Pointer to the Look-Up Table raw data structure
+ *
+ * @return Status
+ *         - #ADMW_SUCCESS Call completed successfully.
+ *
+ * @details This can be used instead of @ref admw1001_SetLutData for
+ *          loading LUT data from the alternative raw data format.  See
+ *          @ref admw1001_SetLutData for more information.
+ *
+ * @note Settings are not applied until admw_ApplyConfigUpdates() is called
+ */
+ADMW_RESULT admw1001_SetLutDataRaw(
+    ADMW_DEVICE_HANDLE  hDevice,
+    ADMW1001_LUT_RAW    *const pLutData);
+/*!
  * @brief Read measurement data samples from the device registers.
  *
  * @param[in]  hDevice          ADMW device context handle