<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <IP xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
    ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Modes.xsd"
    xmlns="http://mcd.rou.st.com/modules.php?name=mcu"
    DBVersion="V4.0"
    IPType="middleware"
    IpGroup="Middleware"
    Name="PDM2PCM"
    Version="pdm2pcm_v3.3.0_Cube">
  <About>PDM2PCM : Software expansion for STM23Cube</About>

  <!-- RefParameters for PDM2PCM -->
  <!-- RefParameters for PDM2PCM - Version-->
  <RefParameter Name="PDM2PCM_Version" Comment="PDM2PCM version" DefaultValue="3.3.0" Type="String" Group="Version">
    <PossibleValue Comment="Current version of PDM2PCM" Value="3.3.0"/>
  </RefParameter>

  <RefParameter Name="Instance" Comment="PDM2PCM instance" DefaultValue="PDM2PCM_M$Index" Type="list" Visible="false"/>

  <!-- RefParameters for PDM2PCM - channels number -->
  <RefParameter Name="NbCHANNEL" Comment="How many channel do you use ?" DefaultValue="1" Type="Integer" Min="1" Max="64" Group="PDM2PCM">
  </RefParameter>


  <!-- RefParameters for PDM2PCM - General settings -->

  <!-- RefParameters for PDM2PCM - Initialisation -->
  <RefParameter Name="CHANNEL1_initialisation" Comment="Initialisation" DefaultValue="" Type="String" Group="CHANNEL1" TabName="CHANNEL1"/>

  <RefParameter Name="CHANNEL1_bit_order" Comment="    bit_order (define the bit order)" DefaultValue="PDM_FILTER_BIT_ORDER_LSB" Type="list" Group="CHANNEL1" TabName="CHANNEL1">
    <PossibleValue Comment="PDM_FILTER_BIT_ORDER_LSB" Value="PDM_FILTER_BIT_ORDER_LSB"/>
    <PossibleValue Comment="PDM_FILTER_BIT_ORDER_MSB" Value="PDM_FILTER_BIT_ORDER_MSB"/>
    <Description>Specifies the bit order for input. &lt;br&gt;- 0x0000 : Least Signficant Bit &lt;br&gt;- 0x0001 : Most Significant Bit</Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_endianness" Comment="    endianness (define the byte order)" DefaultValue="PDM_FILTER_ENDIANNESS_BE" Type="list" Group="CHANNEL1" TabName="CHANNEL1">
    <PossibleValue Comment="PDM_FILTER_ENDIANNESS_LE" Value="PDM_FILTER_ENDIANNESS_LE"/>
    <PossibleValue Comment="PDM_FILTER_ENDIANNESS_BE" Value="PDM_FILTER_ENDIANNESS_BE"/>
    <Description>Specifies if byte inversion is required. &lt;br&gt;- 0x0000 : Little Endian&lt;br&gt;- 0x0001 : Big Endian </Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_high_pass_tap" Comment="    high_pass_tap (the high pass filter alpha)" DefaultValue="2104533974" Min="0" Max="2147483647" Type="integer" Group="CHANNEL1" TabName="CHANNEL1">
    <Description>Specifies the HP filter tap value. &lt;br&gt;-0 : filter not used &lt;br&gt;</Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_in_ptr_channels" Comment="    in_ptr_channels (the channels number in the input PDM stream)" DefaultValue="2" Min="1" Type="integer" Group="CHANNEL1" TabName="CHANNEL1">
    <Description>Specifies the number of channels in the input PDM Stream.</Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_out_ptr_channels" Comment="    out_ptr_channels (the channels number in the output PCM stream)" DefaultValue="2" Min="1" Type="integer" Group="CHANNEL1" TabName="CHANNEL1">
    <Description>Specifies the number of channels in the output PCM stream.</Description>
  </RefParameter>

  <!-- RefParameters for PDM2PCM - initial configuration -->
  <RefParameter Name="CHANNEL1_initial_configuration" Comment="Initial Configuration" DefaultValue="" Type="String" Group="CHANNEL1" TabName="CHANNEL1"/>

  <RefParameter Name="CHANNEL1_decimation_factor" Comment="    decimation_factor (the factor to adapt PDM frequency to PCM frequency)" DefaultValue="PDM_FILTER_DEC_FACTOR_64" Type="list" Group="CHANNEL1" TabName="CHANNEL1">
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_16" Value="PDM_FILTER_DEC_FACTOR_16"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_24" Value="PDM_FILTER_DEC_FACTOR_24"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_32" Value="PDM_FILTER_DEC_FACTOR_32"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_48" Value="PDM_FILTER_DEC_FACTOR_48"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_64" Value="PDM_FILTER_DEC_FACTOR_64"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_80" Value="PDM_FILTER_DEC_FACTOR_80"/>
    <PossibleValue Comment="PDM_FILTER_DEC_FACTOR_128" Value="PDM_FILTER_DEC_FACTOR_128"/>
    <Description>Specifies the decimation factor.</Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_output_samples_number" Comment="    output_samples_number (the number of samples by request)" DefaultValue="16" Min="1" Type="integer" Group="CHANNEL1" TabName="CHANNEL1">
    <Description>Specifies the number of PCM samples to be generated at each call to PDM_filter() function.</Description>
  </RefParameter>

  <RefParameter Name="CHANNEL1_mic_gain" Comment="    mic_gain (the microphone gain in dB)" DefaultValue="0" Min="-12" Max="51" Type="integer" Group="CHANNEL1" TabName="CHANNEL1">
    <Description>Specifies the microphone gain in dB.</Description>
  </RefParameter>

  <!-- This RefParameter is defined in order to be able to have the LibMethod with the status == OK -->
  <RefParameter Name="CHANNEL1_gState" Comment="gState" DefaultValue="Init"  Max="NoInit" Min="Init" Type="integer" Group="CHANNEL1" Visible="false"/>

  <!-- RefMode for PDM2PCM -->
  <RefMode Name="PDM2PCM_Common" Abstract="true" Group="PDM2PCM_Common">
    <!-- Parameters for PDM2PCM - Version-->
    <Parameter Name="PDM2PCM_Version"/>
    <!-- RefParameters for PDM2PCM - channels number -->
    <Parameter Name="NbCHANNEL"/>
  </RefMode>

  <!-- RefMode for Microphone -->
  <RefMode Name="PDM2PCM_Channel" BaseMode="PDM2PCM_Common" Group="PDM2PCM_Channel">
    <ConfigForMode>PDM2PCM_ENABLE_Init</ConfigForMode>
    <!-- Parameters for PDM2PCM - General settings (each MIC init and config) -->
    <Parameter Name="CHANNEL1_initialisation"/>
    <Parameter Name="CHANNEL1_bit_order"/>
    <Parameter Name="CHANNEL1_endianness"/>
    <Parameter Name="CHANNEL1_high_pass_tap"/>
    <Parameter Name="CHANNEL1_in_ptr_channels"/>
    <Parameter Name="CHANNEL1_out_ptr_channels"/>
    <Parameter Name="CHANNEL1_initial_configuration"/>
    <Parameter Name="CHANNEL1_decimation_factor"/>
    <Parameter Name="CHANNEL1_output_samples_number"/>
    <Parameter Name="CHANNEL1_mic_gain"/>
    <Parameter Name="CHANNEL1_gState"/>
  </RefMode>

  <!-- ModeLogicOperator for PDM2PCM -->
  <ModeLogicOperator Name="OR">
    <Mode Name="Enabled">
      <ModeLogicOperator Name="XOR">
        <Mode Name="PDM2PCM_Channel">
          <SignalLogicalOp Name="AND">
            <Signal IOMode="" Name="VS_PDM2PCM"/>
          </SignalLogicalOp>
          <Semaphore>S_PDM2PCM$context</Semaphore>
        </Mode>
      </ModeLogicOperator>
      <Condition Expression="CRC &amp; $IpInstance=PDM2PCM_M$Index" Diagnostic="Active only with CRC IP configured for PDM2PCM_M$Index"/>
    </Mode>
  </ModeLogicOperator>
  
  <!-- RefSignal for PDM2PCM -->
  <RefSignal Name="VS_PDM2PCM" Virtual="true" />

</IP>
