Locale Icon
English
EngineerZone
EngineerZone
Precision Microcontrollers
  • Log In
  • User
  • Site
  • Search
OR
Ask a Question
  • Forums

    Popular Forums

    • LTspice
    • RF and Microwave
    • Video
    • Power Management
    • Precision ADCs
    • FPGA Reference Designs
    • Linux Software Drivers

    Product Forums

    • Amplifiers
    • Microcontrollers
    • Clock and Timing
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy Monitoring and Metering
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Power Management
    • Processors and DSP
    • Switches/Multiplexers
    • Temperature Sensors
    • Voltage References
    View All

    Application Forums

    • A2B
    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing Library
    • Motor Control Hardware Platforms
    • Precision Technology Signal Chains Library
    • Video
    • Wireless Sensor Networks Reference Library

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools and Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Power Studio Designer
    • Power Studio Planner
    • Reference Designs
    • Robot Operating System (ROS) SDK
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Highlighted Webinar

    Maximize Your Power Regulator: Key Considerations for Thermal Performance

    Power regulators with integrated switches deliver a compact, efficient way to supply power. Yet as modern circuits drive toward ever-higher power densities...

    Places

    • ADI Academy
    • ADI Webinars
    • Video Annex
    • Virtual Classroom

    Libraries

    • 3D ToF Depth Sensing Library
    • Continuous-Wave CMOS Time of Flight (TOF) Library
    • Embedded Vision Sensing Library
    • Gigabit Multimedia Serial Link (GMSL) Library
    • Optical Sensing Library
    • Precision Technology Signal Chains Library
    • Software Modules and SDKs Library
    • Supervisory Circuits Library
    • Wireless Sensor Networks Library

    Latest Webinars

    • Power Management Fundamentals II Session 6: Key Layout Considerations for Power
    • A 16T/16R X-Band Direct Sampling Phased Array Subsystem using Apollo MxFE
    • Power Management Fundamentals II Session 5: Deeper Look into Power Protection
    • Power Management Fundamentals II Session 4: Isolated Converters Explained
    • Maximize Your Power Regulator: Key Considerations for Thermal Performance
    View All Webinars
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes AQQ295 about an audio logarithmic volume controller using linear pot - a proposal from Tim O'Brien

      1. Quote of the month: "Think like a proton. Always positive" - Unknown 2. New quiz of the month: AQQ295 about a audio logarithmic volume controller...

    View All

    What's Brewing

      Read a Blog, Take this Quiz for Another Chance to Win a Gift Card!

      Important: Read the blog first . The quiz questions are all based on the content from the blog: Let's Take a Field-Bus Trip Your field-bus engines...

    View All

    Places

    • Community Help
    • Logic Lounge
    • Super User Program
    • Analog Dialogue Quiz

    Resources

    • EZ Code of Conduct
    • EZ How To Help Articles
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • Blogs

    Highlighted Blogs

    Understanding Voltage Domain Isolation in Field-Bus Systems

    By Christopher Nunes In the world of industrial communication, mastering voltage domain isolation is the key to building safer, smarter systems. Last...

     

    Ethernet-APL’s Impact on Functional, Intrinsic, and Cyber Safety

    Power limitations have always plagued process sensors, whether because of intrinsic safety requirements (safety achieved through power limitation) or because...

    Latest Blogs

    • Balancing Enhanced Radar Resolution with FPGA-Based Pulse Compression
    • ​​ISO 26262 Essentials: Ensuring Confidence in Your Software Tools ​
    • Step-by-Step: Implementing a Complete DSP Chain for Signal Analysis
    • Galvanic Isolation in SMPS: Ensuring Safety and Protection: Part 1 of 4
    • Mature, Not Old! The Longevity of 4 – 20 mA
    Read All Blogs

    ADI Blogs

    • EZ Spotlight
    • The Engineering Mind
  • ContentZone

    Visit ContentZone

    ContentZone

    Technical articles. Blogs. Videos. Your ADI content, all in one place.

    View ContentZone

    Featured Content

    Featured Content Title

    Blurb About Content

    View Content By Industry

    • Aerospace and Defense Systems
    • Automotive Solutions
    • Consumer Technology Solutions
    • Data Center Solutions
    • Energy Solutions
    • Healthcare Solutions
    • Industrial Automation Technology Solutions
    • Instrumentation and Measurement Solutions
    • Intelligent Building Solutions
    • Wireless Communication Solutions

    View Content By Technology

    • A2B Audio Bus
    • ADI OtoSense Predictive Maintenance Solutions
    • Dynamic Speaker Management
    • Gallium Nitride (GaN) Technology
    • Gigabit Multimedia Serial Link (GMSL)
    • Industrial Vision
    • Power Solutions
    • Precision Technology
    • RF
    • Sensor Interfaces
    • SmartMesh
Precision Microcontrollers
  • Microcontrollers
Precision Microcontrollers
Documents ADuCM350 FAQ SDK Driver Specific FAQs
  • Q&A
  • Docs/FAQs
  • File Uploads
  • Members
  • Tags
  • Cancel
  • +Documents
  • +ADuCM Cortex-M3: FAQ
  • +Aducm320: FAQ
  • -ADuCM350: FAQ
    • 4Wire-Isolated-Bioimpedance ADuCM350 Connections To Sensor
    • ADUCM350 DESIGN SUPPORT COMMUNITY - INTRO
    • ADuCM350 FAQ DFT / Impedance Measurement
    • ADuCM350 FAQ Debug
    • ADuCM350 FAQ Evaluation Kit Software Platform
    • AFE Transmit Stage
    • ADuCM350 FAQ GPIOs and Pinmuxing
    • ADuCM350 FAQ I2C serial interface
    • ADuCM350 FAQ Operational Supply Range / Power Supplies
    • ADuCM350 FAQ Parallel Display Interface(PDI)
    • ADuCM350 FAQ Power Consumption
    • ADuCM350 FAQ Power Management Unit
    • ADuCM350 FAQ Random Number Generator
    • ADuCM350 FAQ SDK Driver Specific FAQs
    • ADuCM350 FAQ SPI
    • ADuCM350 FAQ Switch Matrix
    • ADuCM350 FAQ System Clocks
    • ADuCM350 FAQ System Integrity
    • ADuCM350 SDK v2.3.0.0 now available
    • Bioimpedance Measurement Using ADuCM350
    • Optimizing RCAL,RTIA,CTIA and DAC voltage of ADuCM350 for 4-Wire Measurement.
    • Potentiostat / Amperometric Measurement Using ADuCM350
    • Unipolar Current Measurement Using ADuCM350
    • Errata for ADuCM350 I2C serial interface
    • FAQ ADuCM350 Embedded Software Development
    • How to get SDK + Eval-ADuCM350EBZ Working together.
    • FAQ for Captouch on ADuCM350
    • Known Issues for ADuCM350 Silicon and Support Material
    • ADuCM350 FAQ ADuCM350 Evaluation Kit
    • ADuCM350 FAQ AFE / ADC Measurement Channel
    • ADuCM350 FAQ AFE Measurement Circuit Impedance Range
    • ADuCM350 FAQ AFE TIA
    • ADuCM350 FAQ AFE Sequencer
    • ADuCM350 FAQ Amperometric Measurement Example
    • ADuCM350 FAQ Calibrate
    • ADuCM350 FAQ CRC accelerator
    • ADuCM350 FAQ GP Timers
    • ADuCM350 FAQ LCD controller
    • New Revision of UG-587 Available
    • ADuCM350 FAQ Potentiostat / Amperometric
    • ADuCM350 FAQ Real Time Clock (RTC)
    • First Steps: Quick Measurement with Eval-ADuCM350 & EKSP Labview GUI
  • +ADuCM355: FAQ
  • +ADuCM360: FAQ
  • +ADuCM361: FAQ
  • +ADuCRF101: FAQ
  • +Bio-Impedance & ECG Measurement Solution: FAQ
  • +CN0300: FAQ
  • +Continuously Amperometric Measurement: FAQ
  • Do we need new Maxim supplied algorithms for the MAX32664, as I assume that the ones provided for the MAXREFDES101 do not support SpO2?
  • +MAX32663A: FAQ
  • MAX32664-A HRM & SPO2 FIRMWARE V10.0.0: FAQ
  • +MAX32664GTGA+: FAQ
  • +MAX32664GTGC+: FAQ
  • +MAX32664GTGZ+: FAQ
  • +MAX32664GWEA+: FAQ
  • +MAX32664GWEB+: FAQ
  • +MAX32664GWEC+: FAQ
  • +MAX32664GWED+T: FAQ
  • +MAX32674C: FAQ

ADuCM350 FAQ SDK Driver Specific FAQs

AFE Driver

Q: The v2.2.0 SDK AFE driver (afe.c) has interrupt handlers for the Command FIFO interrupt (AFE_CmdFIFO_Int_Handler) and the Data FIFO interrupt (AFE_DataFIFO_Int_Handler), but not for the Generate or Capture interrupts. Are there handlers available for the Generate and Capture interrupts?

A: The v2.3.X SDK is currently under development (at time of print, 11 Feb 2015). The AFE driver in this new revision of the SDK will handle Generate and Capture interrupts and will introduce a new function which can register a callback for any of the 4 AFE interrupts. Preliminary code for the Generate and Capture interrupts and the register callback function are below for reference ahead of the v2.3.X SDK release.

/* ANALOG_CAPTURE_INT handler */

ADI_INT_HANDLER(AFE_Capture_Int_Handler) {

    /* Only 1 instance of the AFE in the system */

    ADI_AFE_DEV_HANDLE  hDevice = pAFE_DevData;

    uint32_t            sources;

    uint32_t            enables;

    uint32_t            clear = 0;

    uint32_t            disable = 0;

    sources = hDevice->pAFE->AFE_ANALOG_CAPTURE_INT;

    enables = hDevice->pAFE->AFE_ANALOG_CAPTURE_IEN;

    /* Interrupt bit: ADC_RESULT_READY */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_ADC_RESULT_READY) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_RESULT_READY_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_CAPTURE_INT_ADC_RESULT_READY;

    }

    /* Interrupt bit: DFT_RESULT_READY */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_DFT_RESULT_READY) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_DFT_RESULT_READY_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_CAPTURE_INT_DFT_RESULT_READY;

    }

    /* Interrupt bit: SUPPLY_LPF_RESULT_READY */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_SUPPLY_LPF_RESULT_READY) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_SUPPLY_LPF_RESULT_READY_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_CAPTURE_INT_SUPPLY_LPF_RESULT_READY;

    }

    /* Interrupt bit: TEMP_RESULT_READY */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_TEMP_RESULT_READY) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_TEMP_RESULT_READY_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_CAPTURE_INT_TEMP_RESULT_READY;

    }

    /* Interrupt bit: ADC_MIN_FAIL */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_ADC_MIN_FAIL) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_MIN_FAIL_IEN)) {

        /* Since this is typically an error condition, we don't care if there is one */

        /* or multiple interrupts, so schedule interrupt to be disabled. */

        disable |= BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_MIN_FAIL_IEN;

    }

    /* Interrupt bit: ADC_MAX_FAIL */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_ADC_MAX_FAIL) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_MAX_FAIL_IEN)) {

        /* Since this is typically an error condition, we don't care if there is one */

        /* or multiple interrupts, so schedule interrupt to be disabled. */

        disable |= BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_MAX_FAIL_IEN;

    }

    /* Interrupt bit: ADC_DELTA_FAIL */

    if ((sources & BITM_AFE_AFE_ANALOG_CAPTURE_INT_ADC_DELTA_FAIL) &&

        (enables & BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_DELTA_FAIL_IEN)) {

        /* Since this is typically an error condition, we don't care if there is one */

        /* or multiple interrupts, so schedule interrupt to be disabled. */

        disable |= BITM_AFE_AFE_ANALOG_CAPTURE_IEN_ADC_DELTA_FAIL_IEN;

    }

    /* Check if there is a callback defined */

    if (hDevice->cbCaptureFcn) {

        /* Call the function if the interrupt is watched         */

        /* Need to check both interrupts scheduled to be cleared */

        /* and interrupts scheduled to be disabled to find out   */

        /* what interrupt caused this ISR to be entered          */

        if ((clear | disable) & hDevice->cbCaptureWatch) {

            /* Passing to the callback the bits scheduled for clear or disable */

            hDevice->cbCaptureFcn(hDevice, 0, NULL);

        }

    }

    adi_AFE_EnableInterruptSource(hDevice, ADI_AFE_INT_GROUP_CAPTURE, disable, false);

    adi_AFE_ClearInterruptSource(hDevice, ADI_AFE_INT_GROUP_CAPTURE, clear);

}

/* ANALOG_GEN_INT handler */

ADI_INT_HANDLER(AFE_Generate_Int_Handler) {

    /* Only 1 instance of the AFE in the system */

    ADI_AFE_DEV_HANDLE  hDevice = pAFE_DevData;

    uint32_t            sources;

    uint32_t            enables;

    uint32_t            clear = 0;

    sources = hDevice->pAFE->AFE_ANALOG_GEN_INT;

    enables = hDevice->pAFE->AFE_ANALOG_GEN_IEN;

    /* Interrupt bit: DELAY_COMMAND_DONE */

    if ((sources & BITM_AFE_AFE_ANALOG_GEN_INT_DELAY_COMMAND_DONE) &&

        (enables & BITM_AFE_AFE_ANALOG_GEN_IEN_DELAY_COMMAND_DONE_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_GEN_INT_DELAY_COMMAND_DONE;

    }

    /* Interrupt bit: HARDWARE_SETUP_DONE */

    if ((sources & BITM_AFE_AFE_ANALOG_GEN_INT_HARDWARE_SETUP_DONE) &&

        (enables & BITM_AFE_AFE_ANALOG_GEN_IEN_HARDWARE_SETUP_DONE_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_GEN_INT_HARDWARE_SETUP_DONE;

    }

    /* Interrupt bit: BREAK_SEQUENCE_ORG */

    if ((sources & BITM_AFE_AFE_ANALOG_GEN_INT_BREAK_SEQUENCE_ORG) &&

        (enables & BITM_AFE_AFE_ANALOG_GEN_IEN_BREAK_SEQUENCE_ORG_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_GEN_INT_BREAK_SEQUENCE_ORG;

    }

    /* Interrupt bit: CUSTOM_INT */

    if ((sources & BITM_AFE_AFE_ANALOG_GEN_INT_CUSTOM_INT) &&

        (enables & BITM_AFE_AFE_ANALOG_GEN_IEN_CUSTOM_INT_IEN)) {

        /* Schedule interrupt to be cleared */

        clear |= BITM_AFE_AFE_ANALOG_GEN_INT_CUSTOM_INT;

    }

    /* Check if there is a callback defined */

    if (hDevice->cbGenerateFcn) {

        /* Call the function if the interrupt is watched         */

        /* Need to check both interrupts scheduled to be cleared */

        /* and interrupts scheduled to be disabled to find out   */

        /* what interrupt caused this ISR to be entered          */

        if (clear & hDevice->cbGenerateWatch) {

            /* Passing to the callback the bits scheduled for clear or disable */

            hDevice->cbGenerateFcn(hDevice, 0, NULL);

        }

    }

    adi_AFE_ClearInterruptSource(hDevice, ADI_AFE_INT_GROUP_GENERATE, clear);

}

/*!

* @brief       Application callback registration for AFE interrupt handlers.

*

* @param[in]   hDevice                                 Device handle obtained from adi_AFE_Init().

* @param[in]   group                                   AFE interrupt group type identifier.

* @param[in]   cbFunc                                  Application callback address; the function to call.

* @param[in]   cbWatch                                 The interrupts to watch, controlling which interrupts result in a callback.

*

* @return      Status

*              - #ADI_AFE_SUCCESS                      Call completed successfully.

*              - #ADI_AFE_ERR_BAD_DEV_HANDLE           Invalid device handle.

*              - #ADI_AFE_ERR_NOT_INITIALIZED          Device not initialized.

*              - #ADI_AFE_ERR_ACLKOFF                  ACLK disabled from the clock gate.

*              - #ADI_AFE_ERR_WRONG_ACLK_FREQUENCY     Programmed ACLK frequency is not the required 16MHz.

*              - #ADI_AFE_ERR_CALLBACK_OVERWRITE       Attempt to overwrite existing callback.

*

* @details     Registers an application-defined callback function with one of the AFE interrupt handlers.

*              Callbacks are made in response to received AFE interrupts, depending on whether they are enabled

*              and whether the corresponding callback watch bits are set.  This allows the application to control which

*              interrupts it wants to be called back on.

*              The callback to the application is made in context of the originating interrupt (i.e. the AFE

*              interrupt handler that is registered in the system's interrupt vector table).  Extended processing

*              during the callback (an extension of the AFE interrupt handler) is discouraged so as to avoid lower-priority

*              interrupt blocking.  Also, any register read-modify-write operations should be protected using the

*              ADI_ENTER_CRITICAL_REGION()/ADI_EXIT_CRITICAL_REGION() pair to prevent higher-priority interrupts from modifying

*              said register during the read-modify-write operation.

*

*   @note      CALLBACKS: AFE interrupt callbacks are \a disabled by default during the API initialization (#adi_AFE_Init()).

*              The application may use the #adi_AFE_RegisterCallback() API to register an application-defined

*              callback function with the interrupt handler that will be called in response to selected AFE interrupts.

*              The callback registration API takes an interrupt mask (of type uint32_t) that designates the set of interrupts

*              to watch (upon which to dispatch the callback).  When any of the watched interrupts occur, the appropriate AFE

*              interrupt handler will make the callback to the application for application-based interrupt handling. The application

*              callback should \a avoid \a extended \a processing during the callback as the callback is made context of the initiating

*              interrupt and will block lower-priority interrupts.  If extended application-level interrupt processing is required, the

*              application should schedule it for the main application loop and exit the callback as soon as possible.\n\n

*

*/

ADI_AFE_RESULT_TYPE adi_AFE_RegisterAfeCallback(ADI_AFE_DEV_HANDLE hDevice, ADI_AFE_INT_GROUP_TYPE group, ADI_CALLBACK cbFunc, uint32_t cbWatch) {

    ADI_AFE_RESULT_TYPE result = ADI_AFE_SUCCESS;

#ifdef ADI_DEBUG

    if (adi_AFE_InvalidHandle(hDevice)) {

        return ADI_AFE_ERR_BAD_DEV_HANDLE;

    }

    if (adi_AFE_HandleNotInitialized(hDevice)) {

        return ADI_AFE_ERR_NOT_INITIALIZED;

    }

    if (pADI_SYSCLK->CLKCON5 & BITM_SYSCLK_CLKCON5_ACLKOFF) {

        return ADI_AFE_ERR_ACLKOFF;

    }

    if (16000000 != SystemGetClockFrequency(ADI_SYS_CLOCK_ACLK)) {

        return ADI_AFE_ERR_WRONG_ACLK_FREQUENCY;

    }

   

    if (!((ADI_AFE_INT_GROUP_CAPTURE == group) || (ADI_AFE_INT_GROUP_GENERATE == group) || (ADI_AFE_INT_GROUP_CMD_FIFO == group) || (ADI_AFE_INT_GROUP_DATA_FIFO == group))) {

        return ADI_AFE_ERR_INVALID_IRQ;

    }

    if ((cbFunc && hDevice->cbCaptureFcn) || (cbFunc && hDevice->cbGenerateFcn) || (cbFunc && hDevice->cbCmdFifoFcn) || (cbFunc && hDevice->cbDataFifoFcn)) {

        return ADI_AFE_ERR_CALLBACK_OVERWRITE;

    }

#endif

    switch (group)

    {

        case ADI_AFE_INT_GROUP_CAPTURE:

            hDevice->cbCaptureFcn       = cbFunc;

            hDevice->cbCaptureWatch     = cbWatch;

            break;

        case ADI_AFE_INT_GROUP_GENERATE:

            hDevice->cbGenerateFcn      = cbFunc;

            hDevice->cbGenerateWatch    = cbWatch;

            break;

        case ADI_AFE_INT_GROUP_CMD_FIFO:

            hDevice->cbCmdFifoFcn       = cbFunc;

            hDevice->cbCmdFifoWatch     = cbWatch;

            break;

        case ADI_AFE_INT_GROUP_DATA_FIFO:

            hDevice->cbDataFifoFcn      = cbFunc;

            hDevice->cbDataFifoWatch    = cbWatch;

            break;

    }

   

    return result;

}

Tags: generate aducm350 capture afe callback sdk driver aducm35x Show More
  • Share
  • History
  • More
  • Cancel
analog-devices logo

About Analog Devices

  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
  • Instagram page
  • Twitter page
  • Linkedin page
  • Youtube page
  • Facebook
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2025 Analog Devices, Inc. All Rights Reserved

analog-devices

About Analog Devices

Down Up
  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

Down Up
  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
Instagram page Facebook Twitter page Linkedin page Youtube page
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2025 Analog Devices, Inc. All Rights Reserved