Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: inc/admw1001/admw1001_lut_data.h
- Revision:
- 50:d84305e5e1c0
- Parent:
- 6:9d393a9677f4
diff -r c31473bc013e -r d84305e5e1c0 inc/admw1001/admw1001_lut_data.h
--- a/inc/admw1001/admw1001_lut_data.h Thu Feb 06 11:04:31 2020 +0000
+++ b/inc/admw1001/admw1001_lut_data.h Mon Feb 17 11:23:39 2020 +0000
@@ -57,14 +57,15 @@
#endif
/*! LUT data validation signature */
-#define ADMW_LUT_SIGNATURE 0x4C555473
+#define ADMW_LUT_SIGNATURE 0x4C555473
/*! LUT data CRC-16-CCITT seed value */
-#define ADMW_LUT_CRC_SEED 0x4153
+#define ADMW_LUT_CRC_SEED 0x4153
/*! LUT maximum allowed size */
#define ADMW_LUT_MAX_SIZE 10240U
+#define MAX_LUT_NUM_ENTRIES 16
/*! Linearisation look-up table / co-efficient list geometry */
typedef enum {
ADMW1001_LUT_GEOMETRY_RESERVED = 0x00,
@@ -73,12 +74,6 @@
/**< 1D/2D equation coefficient list */
ADMW1001_LUT_GEOMETRY_NES_1D = 0x02,
/**< 1-dimensional not-equally-spaced look-up table */
- ADMW1001_LUT_GEOMETRY_NES_2D = 0x03,
- /**< 2-dimensional not-equally-spaced look-up table */
- ADMW1001_LUT_GEOMETRY_ES_1D = 0x04,
- /**< 1-dimensional equally-spaced look-up table */
- ADMW1001_LUT_GEOMETRY_ES_2D = 0x05,
- /**< 2-dimensional equally-spaced look-up table */
} ADMW1001_LUT_GEOMETRY;
/*! Linearisation equation type */
@@ -220,22 +215,22 @@
/*! Macro to calculate the number of elements in
* a @ref ADMW1001_LUT_1D_NES table */
#define ADMW1001_LUT_1D_NES_NELEMENTS(_t) \
- ((_t).nElements * 2)
+ ((_t).nElements * 2)
/*! Macro to calculate the number of elements in
* a @ref ADMW1001_LUT_2D_ES table */
#define ADMW1001_LUT_2D_ES_NELEMENTS(_t) \
- ((_t).nElementsX * (_t).nElementsX)
+ ((_t).nElementsX * (_t).nElementsX)
/*! Macro to calculate the number of elements in
* a @ref ADMW1001_LUT_2D_NES table */
#define ADMW1001_LUT_2D_NES_NELEMENTS(_t) \
- ((_t).nElementsX + (_t).nElementsY + ((_t).nElementsX * (_t).nElementsY))
+ ((_t).nElementsX + (_t).nElementsY + ((_t).nElementsX * (_t).nElementsY))
/*! Macro to calculate the number of elements in
* a @ref ADMW1001_LUT_2D_POLYN_COEFF_LIST table */
#define ADMW1001_LUT_2D_POLYN_COEFF_LIST_NELEMENTS(_t) \
- (((_t).maxDegree + 1) * ((_t).maxDegree + 2) / 2)
+ (((_t).maxDegree + 1) * ((_t).maxDegree + 2) / 2)
/*! Macro to calculate the storage size in bytes of
* a @ref ADMW1001_LUT_COEFF_LIST table */
@@ -270,14 +265,15 @@
/*! Look-Up Table descriptor */
typedef union __attribute__((packed, aligned(4))) {
struct {
- uint16_t geometry : 6; /**< ADMW1001_LUT_GEOMETRY */
- uint16_t equation : 6; /**< ADMW1001_LUT_EQUATION */
- uint16_t dir : 4; /**< ADMW1001_LUT_TC_DIRECTION */
- uint16_t sensor : 12; /**< ADMW1001_ADC_SENSOR_TYPE */
- uint16_t dataType : 4; /**< ADMW1001_LUT_DATA_TYPE */
- uint16_t length; /**< Length (bytes) of table data section
- (excl. this header) */
- uint16_t crc16; /**< CRC-16-CCITT of the data */
+ uint16_t geometry : 4; /**< ADMW1001_LUT_GEOMETRY */
+ uint8_t channel : 2; /**< ADMW1001_ADC_CHANNEL */
+ uint16_t equation : 6; /**< ADMW1001_LUT_EQUATION */
+ uint16_t dir : 4; /**< ADMW1001_LUT_TC_DIRECTION */
+ uint16_t sensor : 12; /**< ADMW1001_ADC_SENSOR_TYPE */
+ uint16_t dataType : 4; /**< ADMW1001_LUT_DATA_TYPE */
+ uint16_t length; /**< Length (bytes) of table data section
+ (excl. this header) */
+ uint16_t crc16; /**< CRC-16-CCITT of the data */
};
uint64_t value64;
} ADMW1001_LUT_DESCRIPTOR;
@@ -333,7 +329,7 @@
typedef struct __attribute__((packed, aligned(4))) {
ADMW1001_LUT_HEADER header;
/*!< LUT data top-level header structure */
- ADMW1001_LUT_TABLE tables[];
+ ADMW1001_LUT_TABLE tables[1];
/*!< Variable-length array of one-or-more look-up table structures */
} ADMW1001_LUT;