text: /**
   *   @file  cfarcaproccommon.h
   *
   *   @brief
   *      Implements Common definition across cfarcaProc DPU.
   *
   *  \par
   *  NOTE:
   *      (C) Copyright 2018 Texas Instruments, Inc.
   *
   *  Redistribution and use in source and binary forms, with or without
   *  modification, are permitted provided that the following conditions
   *  are met:
   *
   *    Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   *    Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the
   *    distribution.
   *
   *    Neither the name of Texas Instruments Incorporated nor the names of
   *    its contributors may be used to endorse or promote products derived
   *    from this software without specific prior written permission.
   *
   *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
  /**************************************************************************
   *************************** Include Files ********************************
   **************************************************************************/
  #ifndef CFARCAROC_COMMON_H
  #define CFARCAROC_COMMON_H
  
  /* Standard Include Files. */
  #include <stdint.h>
  #include <stdlib.h>
  #include <stddef.h>
  #include <string.h>
  #include <stdio.h>
  #include <math.h>
  
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  
  /**
   * @brief   CFAR detection in range domain
   */
  #define DPU_CFAR_RANGE_DOMAIN   0
  /**
   * @brief   CFAR detection in Doppler domain
   */
  #define DPU_CFAR_DOPPLER_DOMAIN 1
  
  /**
   * @brief
   *  CFAR Configuration
   *
   * @details
   *  The structure contains the cfar configuration used in data path
   */
  typedef struct DPU_CFARCAProc_CfarCfg_t
  {
      /*! @brief    CFAR threshold scale */
      uint16_t       thresholdScale;
  
      /*! @brief    CFAR averagining mode 0-CFAR_CA, 1-CFAR_CAGO, 2-CFAR_CASO */
      uint8_t        averageMode;
  
      /*! @brief    CFAR noise avraging window length */
      uint8_t        winLen;
  
      /*! @brief    CFAR guard length*/
      uint8_t        guardLen;
  
      /*! @brief    CFAR cumulative noise sum divisor */
      uint8_t        noiseDivShift;
  
      /*! @brief    CFAR 0-cyclic mode disabled, 1-cyclic mode enabled */
      uint8_t        cyclicMode;
  
      /*! @brief    Peak grouping scheme 1-based on neighboring peaks from detection matrix
       *                                 2-based on on neighboring CFAR detected peaks.
       *            Scheme 2 is not supported on the HWA version (cfarcaprochwa.h) */
      uint8_t        peakGroupingScheme;
  
      /*! @brief     Peak grouping, 0- disabled, 1-enabled */
      uint8_t        peakGroupingEn;
  
  } DPU_CFARCAProc_CfarCfg;
  
  /**
   * @brief
   *  Data processing Unit statistics
   *
   * @details
   *  The structure is used to hold the statistics of the DPU 
   *
   *  \ingroup INTERNAL_DATA_STRUCTURE
   */
  typedef struct DPU_CFARCAProc_Stats_t
  {
      /*! @brief total number of calls of DPU processing */
      uint32_t            numProcess;
  
      /*! @brief total processing time during all chirps in a frame excluding EDMA waiting time*/
      uint32_t            processingTime;
  
      /*! @brief total wait time for EDMA data transfer during all chirps in a frame*/
      uint32_t            waitTime;
  }DPU_CFARCAProc_Stats;
  
  
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif 
  