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_config.h
- Revision:
- 77:d90214f44903
- Parent:
- 75:434d91af4cc7
--- a/inc/admw1001/admw1001_config.h Tue May 05 09:23:06 2020 +0000
+++ b/inc/admw1001/admw1001_config.h Thu May 07 08:50:22 2020 +0000
@@ -58,8 +58,7 @@
#define ADMW1001_SENSOR_COMMAND_MAX_LENGTH 7
/*! ADMW1001 channel priority options */
-typedef enum
-{
+typedef enum {
ADMW1001_CHANNEL_PRIORITY_0 = 0,
ADMW1001_CHANNEL_PRIORITY_1,
ADMW1001_CHANNEL_PRIORITY_2,
@@ -80,8 +79,7 @@
} ADMW1001_CHANNEL_PRIORITY;
/*! ADMW1001 operating mode options */
-typedef enum
-{
+typedef enum {
ADMW1001_OPERATING_MODE_SINGLECYCLE = 0,
/*!< Executes a single measurement cycle and stops */
ADMW1001_OPERATING_MODE_CONTINUOUS,
@@ -90,8 +88,7 @@
} ADMW1001_OPERATING_MODE;
/*! ADMW1001 data ready mode options */
-typedef enum
-{
+typedef enum {
ADMW1001_DATAREADY_PER_CONVERSION = 0,
/*!< The DATAREADY signal is asserted after completion of each conversion
* - a single data sample only from the latest completed conversion is
@@ -112,8 +109,7 @@
} ADMW1001_DATAREADY_MODE;
/*! ADMW1001 power mode options */
-typedef enum
-{
+typedef enum {
ADMW1001_POWER_MODE_ACTIVE = 0,
/*!< Part is fully powered up and either cycling through a sequence or awaiting a configuration */
ADMW1001_POWER_MODE_HIBERNATION,
@@ -122,15 +118,14 @@
} ADMW1001_POWER_MODE;
/*! ADMW1001 External Vref Buffer Mode options */
-typedef enum
-{
+typedef enum {
ADMW1001_VREF_BUFF_MODE_DISABLE_BOTH = 0,
/*!< Both Vref+ and Vref- buffers to be disabled */
ADMW1001_VREF_BUFF_MODE_ONLY_POS,
/*!< only Vref+ buffer to be disabled */
ADMW1001_VREF_BUFF_MODE_ONLY_NEG,
/*!< Only Vref- buffers to be disabled */
- ADMW1001_VREF_BUFF_MODE_ENABLE_BOTH,
+ ADMW1001_VREF_BUFF_MODE_ENABLE_BOTH,
/*!< Both Vref+ and Vref- buffers to be Enabled */
} ADMW1001_VREF_BUFFER_MODE;
@@ -139,8 +134,7 @@
* Optionally select a measurement unit for final conversion results.
* Currently applicable only to specific temperature sensor types.
*/
-typedef enum
-{
+typedef enum {
ADMW1001_MEASUREMENT_UNIT_UNSPECIFIED = 0,
/*!< No measurement unit specified */
ADMW1001_MEASUREMENT_UNIT_CELSIUS,
@@ -150,8 +144,7 @@
} ADMW1001_MEASUREMENT_UNIT;
-typedef enum
-{
+typedef enum {
ADMW1001_BUFFER_BYPASSS_DISABLED = 0,
/*!< Buffer Bypass Disabled */
ADMW1001_BUFFER_BYPASSS_ENABLED,
@@ -163,8 +156,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_RTD_CURVE_EUROPEAN = 0,
/*!< EUROPEAN RTD curve used. */
ADMW1001_ADC_RTD_CURVE_AMERICAN,
@@ -179,8 +171,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_GAIN_1X = 0,
/*!< no amplification gain */
ADMW1001_ADC_GAIN_2X,
@@ -203,8 +194,7 @@
* @note applicable only to ADC analog sensor channels, and
* specific sensor types
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_EXC_STATE_CYCLE_POWER = 0,
/*!< Excitation for measurement is active only during measurement */
ADMW1001_ADC_EXC_STATE_ALWAYS_ON,
@@ -217,8 +207,7 @@
* @note applicable only to ADC analog sensor channels, and
* specific sensor types
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_NO_EXTERNAL_EXC_CURRENT = -1,
/*!< NO External excitation is provided */
ADMW1001_ADC_EXC_CURRENT_EXTERNAL = 0,
@@ -240,8 +229,7 @@
*
* @note applicable only to a diode sensor
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_10UA_100UA = 0,
/**< 2 Current measurement 10uA 100uA */
ADMW1001_ADC_EXC_CURRENT_IOUT_DIODE_20UA_160UA,
@@ -266,8 +254,7 @@
* @note applicable only to ADC analog sensor channels, and
* specific sensor types
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_REFERENCE_VOLTAGE_INTERNAL = 0,
/*!< Internal VRef - 1.2V */
ADMW1001_ADC_REFERENCE_VOLTAGE_EXTERNAL_1 = 1,
@@ -281,8 +268,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_GND_SW_OPEN = 0,
/*!< Ground switch not enabled for measurement. */
ADMW1001_ADC_GND_SW_CLOSED,
@@ -294,8 +280,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_DISABLE_CHOP = 0,
/*!< chop performed. */
ADMW1001_ENABLE_CHOP,
@@ -306,8 +291,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_ADC_FILTER_SINC4 = 0,
/*!< SINC4 - 4th order sinc response filter */
ADMW1001_ADC_FILTER_SINC3,
@@ -321,29 +305,28 @@
* @note SF must be set in conjunction with chop mode
* and sinc filter type to achieve the desired sampling rate.
*/
-typedef enum
-{
- ADMW1001_SF_122HZ = 7,
- /*!< SF setting for 122Hz sample rate. */
- ADMW1001_SF_61HZ = 31,
- /*!< SF setting for 61Hz sample rate. */
- ADMW1001_SF_30P5HZ = 51,
- /*!< SF setting for 61Hz sample rate. */
- ADMW1001_SF_10HZ = 124,
- /*!< SF setting for 10Hz sample rate. */
- ADMW1001_SF_8P24HZ = 125,
- /*!< SF setting for 8.24Hz sample rate. */
- ADMW1001_SF_5HZ = 127,
- /*!< SF setting for 5Hz sample rate. */
+typedef enum {
+ ADMW1001_SF_7 = 7,
+ /*!< SF setting for fastest sampling rate, enable SINC4 filter. */
+ ADMW1001_SF_31 = 31,
+ /*!< SF setting for medium speed mode, enable SINC3 Filter. */
+ ADMW1001_SF_51 = 51,
+ /*!< SF setting for medium speed mode, enable SINC3 Filter. */
+ ADMW1001_SF_124 = 124,
+ /*!< SF setting for 60Hz rejection. */
+ ADMW1001_SF_125 = 125,
+ /*!< SF setting for 50Hz and 60Hz rejection when notch1p2 is enabled. Enable SINC3 Filter. */
+ ADMW1001_SF_127 = 127,
+ /*!< SF setting for Lowest noise, enable SINC3 Filter. */
} ADMW1001_SINC_FILTER_RANGE;
+
/*! ADMW1001 I2C clock speed options
*
* @note applicable only for I2C sensors
*/
-typedef enum
-{
+typedef enum {
ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_100K = 0,
/*!< 100kHz I2C clock speed */
ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED_400K,
@@ -353,8 +336,7 @@
/*! ADMW1001 Power Configuration options */
-typedef struct
-{
+typedef struct {
ADMW1001_POWER_MODE powerMode;
/*!< Power mode selection */
@@ -365,8 +347,7 @@
* @note required only when ADMW1001_OPERATING_MODE_MULTICYCLE is selected
* as the operatingMode (@ref ADMW1001_MEASUREMENT_CONFIG)
*/
-typedef struct
-{
+typedef struct {
uint32_t cyclesPerBurst;
/*!< Number of cycles to complete for a single burst */
uint32_t burstInterval;
@@ -375,8 +356,7 @@
} ADMW1001_MULTICYCLE_CONFIG;
/*! ADMW1001 Measurement Configuration options */
-typedef struct
-{
+typedef struct {
ADMW1001_OPERATING_MODE operatingMode;
/*!< Operating mode - specifies how measurement cycles are scheduled */
ADMW1001_DATAREADY_MODE dataReadyMode;
@@ -411,11 +391,11 @@
float32_t AVDDVoltage;
/*!< AVDD Voltage.
*/
- uint8_t extVrefBuffMode;
- /*!< External Vref Buff mode.
+ uint8_t extVrefBuffMode;
+ /*!< External Vref Buff mode.
uint32_t reserved1[3];
/*!< Reserved for future use and ensure word alignment.
- */
+ */
} ADMW1001_MEASUREMENT_CONFIG;
@@ -424,8 +404,7 @@
* @note applicable only to ADC analog sensor channels, and
* specific sensor types
*/
-typedef struct
-{
+typedef struct {
ADMW1001_ADC_EXC_CURRENT outputLevel;
/*!< Excitation current output level */
ADMW1001_ADC_EXC_CURRENT_DIODE_RATIO diodeRatio;
@@ -438,8 +417,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef struct
-{
+typedef struct {
ADMW1001_ADC_FILTER_TYPE type;
/*!< Filter type selection */
ADMW1001_SINC_FILTER_RANGE sf;
@@ -455,8 +433,7 @@
*
* @note applicable only to ADC analog sensor channels
*/
-typedef struct
-{
+typedef struct {
ADMW1001_ADC_SENSOR_TYPE sensor;
/*!< Sensor type selection */
ADMW1001_ADC_RTD_CURVE rtdCurve;
@@ -470,7 +447,7 @@
ADMW1001_ADC_REFERENCE_TYPE reference;
/*!< ADC Reference configuration */
uint8_t bufferBypass;
- /*!< Buffer Bypass configuration */
+ /*!< Buffer Bypass configuration */
uint8_t reserved0[2];
/*!< Reserved for future use and ensure word alignment. */
uint32_t reserved1[6];
@@ -481,8 +458,7 @@
/*! ADMW1001 look-up table selection
* Select table used to linearise the measurement.
*/
-typedef enum
-{
+typedef enum {
ADMW1001_LUT_DEFAULT = 0,
/*!< Default LUT */
ADMW1001_LUT_CUSTOM = 1,
@@ -496,8 +472,7 @@
*
* @note applicable only to SPI and I2C digital sensor channels
*/
-typedef enum
-{
+typedef enum {
ADMW1001_DIGITAL_SENSOR_DATA_CODING_NONE = 0,
/**< None/Invalid - data format is ignored if coding is set to this value */
ADMW1001_DIGITAL_SENSOR_DATA_CODING_UNIPOLAR,
@@ -514,8 +489,7 @@
*
* @note applicable only to SPI and I2C digital sensor channels
*/
-typedef struct
-{
+typedef struct {
ADMW1001_DIGITAL_SENSOR_DATA_CODING coding;
/**< Data Encoding of Sensor Result */
bool littleEndian;
@@ -538,8 +512,7 @@
*
* @note applicable only to digital sensor channels
*/
-typedef struct
-{
+typedef struct {
bool useCustomCommsConfig;
/*!< Optional parameter to enable user digital communication settings */
ADMW1001_DIGITAL_SENSOR_COMMS_I2C_CLOCK_SPEED i2cClockSpeed;
@@ -551,8 +524,7 @@
*
* @note applicable only to I2C digital sensor channels
*/
-typedef struct
-{
+typedef struct {
ADMW1001_I2C_SENSOR_TYPE sensor;
/*!< Sensor type selection */
uint8_t deviceAddress;
@@ -574,8 +546,7 @@
/*! ADMW1001 Measurement Channel configuration details */
-typedef struct
-{
+typedef struct {
bool enableChannel;
/*!< Option to include this channel in normal measurement cycles */
bool disablePublishing;
@@ -652,8 +623,7 @@
* ID. Lower numbers indicate higher priority, with 0 being the highest.
* Set to 0 if not required.
*/
- union
- {
+ union {
ADMW1001_ADC_CHANNEL_CONFIG adcChannelConfig;
/*!< ADC channel configuration - applicable only to ADC channels */
ADMW1001_I2C_CHANNEL_CONFIG i2cChannelConfig;
@@ -667,8 +637,7 @@
} ADMW1001_CHANNEL_CONFIG;
/*! ADMW1001 Diagnostics configuration details */
-typedef struct
-{
+typedef struct {
bool disableGlobalDiag;
/*!< Option to disable the following diagnostic checks on the ADC:
* - Reference Detection errors
@@ -692,8 +661,7 @@
/*! ADMW1001 Device configuration details */
-typedef struct
-{
+typedef struct {
ADMW1001_POWER_CONFIG power;
/*!< Power configuration details */
ADMW1001_MEASUREMENT_CONFIG measurement;