adc16_config_t has no member named 'hardwareAverageMode'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

adc16_config_t has no member named 'hardwareAverageMode'

Jump to solution
765 Views
aaronminner
Contributor III

I'm using MCUXpresso v11.5.0, and SDK_2.x_FRDM-K66F 2.11.0.  My board is a FRDM-K66F.

For ADC0 and ADC1, both of which have "hardware averaging disabled" in the Peripherals configuration screen, I get:

.hardwareAverageMode = kADC16_HardwareAverageDisabled,

in the generated "peripherals.c" file.  However, that gives me a compiler error:

../board/peripherals.c:400:4: error: 'adc16_config_t' {aka 'const struct _adc16_config'} has no member named 'hardwareAverageMode'

  400 |   .hardwareAverageMode = kADC16_HardwareAverageDisabled,

      |    ^~~~~~~~~~~~~~~~~~~

I've commented it out so I can compile, but I'm perplexed that I'm getting this error at all in a MCUXpresso-generated file.  It also risks breaking the XML needed by the Peripherals page.

Any suggestion for why this is happening, and how to fix it?

Thanks, Aaron

0 Kudos
1 Solution
726 Views
aaronminner
Contributor III

Thanks for getting back to me, Pablo.  Actually, it turns out it's more related to this:

/*!
 * @brief ADC16 converter configuration.
 */
typedef struct _adc16_config
{
    adc16_reference_voltage_source_t referenceVoltageSource; /*!< Select the reference voltage source. */
    adc16_clock_source_t clockSource;                        /*!< Select the input clock source to converter. */
    bool enableAsynchronousClock;                            /*!< Enable the asynchronous clock output. */
    adc16_clock_divider_t clockDivider;                      /*!< Select the divider of input clock source. */
    adc16_resolution_t resolution;                           /*!< Select the sample resolution mode. */
    adc16_long_sample_mode_t longSampleMode;                 /*!< Select the long sample mode. */
    bool enableHighSpeed;                                    /*!< Enable the high-speed mode. */
    bool enableLowPower;                                     /*!< Enable low power. */
    bool enableContinuousConversion;                         /*!< Enable continuous conversion mode. */
#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE
    adc16_hardware_average_mode_t hardwareAverageMode; /*!< Set hardware average mode. */
#endif                                                 /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */
} adc16_config_t;

This is in fsl_adc16.h.  I don't recall doing anything in particular to make FSL_FEATURE_ADC16_HAS_HW_AVERAGE defined, but my project is now compiling without any work-arounds for this particular aspect.  It might have been when I tried to clone a 2.8 SDK project - which worked as expected - and then updated the SDK to 2.11.  At some point, I stopped trying to do that - it was too much hassle and never worked correctly - and just created a 2.11 project, instead.  At any rate, yeah, I'll close this issue, now.

View solution in original post

0 Kudos
2 Replies
730 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @aaronminner 

 

I would like to apologize for the delay, we are experiencing a high volume of questions these days. I really appreciate your patience.

Regarding your issue, I see that you probably are missing to add the pointer to the structure with the operator -> in order to avoid the error as shown as below:

PabloAvalos_0-1645151322218.png

 

Hope this helps, please let me know if you have more questions.

 

Best Regards.
Pablo Avalos.

 

0 Kudos
727 Views
aaronminner
Contributor III

Thanks for getting back to me, Pablo.  Actually, it turns out it's more related to this:

/*!
 * @brief ADC16 converter configuration.
 */
typedef struct _adc16_config
{
    adc16_reference_voltage_source_t referenceVoltageSource; /*!< Select the reference voltage source. */
    adc16_clock_source_t clockSource;                        /*!< Select the input clock source to converter. */
    bool enableAsynchronousClock;                            /*!< Enable the asynchronous clock output. */
    adc16_clock_divider_t clockDivider;                      /*!< Select the divider of input clock source. */
    adc16_resolution_t resolution;                           /*!< Select the sample resolution mode. */
    adc16_long_sample_mode_t longSampleMode;                 /*!< Select the long sample mode. */
    bool enableHighSpeed;                                    /*!< Enable the high-speed mode. */
    bool enableLowPower;                                     /*!< Enable low power. */
    bool enableContinuousConversion;                         /*!< Enable continuous conversion mode. */
#if defined(FSL_FEATURE_ADC16_HAS_HW_AVERAGE) && FSL_FEATURE_ADC16_HAS_HW_AVERAGE
    adc16_hardware_average_mode_t hardwareAverageMode; /*!< Set hardware average mode. */
#endif                                                 /* FSL_FEATURE_ADC16_HAS_HW_AVERAGE */
} adc16_config_t;

This is in fsl_adc16.h.  I don't recall doing anything in particular to make FSL_FEATURE_ADC16_HAS_HW_AVERAGE defined, but my project is now compiling without any work-arounds for this particular aspect.  It might have been when I tried to clone a 2.8 SDK project - which worked as expected - and then updated the SDK to 2.11.  At some point, I stopped trying to do that - it was too much hassle and never worked correctly - and just created a 2.11 project, instead.  At any rate, yeah, I'll close this issue, now.

0 Kudos