Symbian3/PDK/Source/GUID-046E5E45-ADB1-54B7-8242-2B1DC5741640.dita
changeset 1 25a17d01db0c
child 3 46218c8b8afa
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-046E5E45-ADB1-54B7-8242-2B1DC5741640" xml:lang="en"><title>I2S Implementation
       
    13 Guide</title><shortdesc>I2S (Integrated Interchip Sound) is a bus standard developed by
       
    14 Philips to model the interface between producers and consumers of digital
       
    15 audio data in a CPU-based system. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    16 <section id="GUID-D2C1E08C-0D18-5AEF-B24C-6FC298A60DE9"><title>Required background</title> <p>Before
       
    17 you start, you must: </p> <ul>
       
    18 <li id="GUID-E2DF0243-A1D3-571E-9881-34731A2C222E"><p>understand platform
       
    19 implementation, </p> </li>
       
    20 <li id="GUID-370A5667-EE40-53D8-9C63-90FBD30ECD30"><p>understand I2S concepts
       
    21 and terminology, </p> </li>
       
    22 <li id="GUID-AF49BFB1-EB4A-59C8-8F27-469CCD49E222"><p>know the architecture
       
    23 of the platform on which you are implementing, and </p> </li>
       
    24 <li id="GUID-9485A6D5-681B-5415-920D-BD6ABC5A9D43"><p>understand the C++ signature
       
    25 of the functions you are implementing. </p> </li>
       
    26 </ul> </section>
       
    27 <section id="GUID-4F05BE9F-C8C9-5F86-A1F9-0D52A528D92C"><title>Introduction</title> <p>You
       
    28 can provide support for I2S hardware in a board support package by implementing
       
    29 the interface that Symbian platform defines in the I2S class. To provide a
       
    30 consistent interface to clients of the I2S class, your implementation must
       
    31 return certain error codes in certain specified conditions. The details of
       
    32 the functions, conditions and associated required return values are described
       
    33 below. How your implementation of the functions communicates with your I2S
       
    34 hardware will be specific to the hardware you are using. </p> </section>
       
    35 <section id="GUID-D051D0F6-6028-4497-9A7B-6E6B4EAA86C4"><title>Procedure</title><p>Implement each function of class &lt;api-item&gt;I2S&lt;/api-item&gt;
       
    36 with a return  value of </p> <ul id="GUID-353AF454-3EF4-5E15-A5DD-5FD09DE7DA01">
       
    37 <li id="GUID-5B10AC1E-E9F5-5D62-8393-784CC4C53D9B"><p> <xref href="GUID-48BD3B2F-8C36-36EF-95A0-027029C2219F.dita"><apiname>KErrArgument</apiname></xref>, </p> </li>
       
    38 <li id="GUID-52455A74-9BDA-5B27-A32B-10C9B8852318"><p> <xref href="GUID-48BD3B2F-8C36-36EF-95A0-027029C2219F.dita"><apiname>KErrNone</apiname></xref>, </p> </li>
       
    39 <li id="GUID-641B3932-1742-5A44-87DA-E1F63C0714A6"><p> <xref href="GUID-48BD3B2F-8C36-36EF-95A0-027029C2219F.dita"><apiname>KErrNotSupported</apiname></xref>  </p> </li>
       
    40 </ul><p>and other return values as specified for particular functions.</p><p>Implement
       
    41 the following functions which are generic to I2S and do not  depend on access
       
    42 mode. </p><ul>
       
    43 <li><p>Implement each function of class <xref href="GUID-48BD3B2F-8C36-36EF-95A0-027029C2219F.dita"><apiname>I2S</apiname></xref> with a  return
       
    44 value of <xref href="GUID-0BEA3647-7888-3612-A2D3-7E27AC405E29.dita"><apiname>KErrArgument</apiname></xref>. </p><p>The first argument of every
       
    45 function is <codeph>aInterfaceId</codeph>  and represents the ID of an I2S
       
    46 interface. If the passed-in ID is invalid, the   function should return <xref href="GUID-0BEA3647-7888-3612-A2D3-7E27AC405E29.dita"><apiname>KErrArgument</apiname></xref> without
       
    47 further activity. </p></li>
       
    48 <li><p>Implement <xref href="GUID-E6E8BD6D-70DA-3721-BABC-3935F1AD2C68.dita"><apiname>ConfigureInterface()</apiname></xref> with return  value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref> for
       
    49 each possible combination of interface role and interface type.</p><p>The
       
    50 argument <codeph>aConfig</codeph> is a pointer to one or more  instances of <xref href="GUID-DE0D6A8E-A443-308F-B94F-2A0B7CBC1115.dita"><apiname>TI2sConfigBufV01</apiname></xref>.
       
    51  <xref href="GUID-DE0D6A8E-A443-308F-B94F-2A0B7CBC1115.dita"><apiname>TI2sConfigBufV01</apiname></xref> is a class of two members,  <xref href="GUID-623F019D-F088-320B-8EDB-79954E39B475.dita"><apiname>TI2sInterfaceRole</apiname></xref> and
       
    52   <xref href="GUID-A279FCD9-0D2A-33E2-817E-3408BE0E5407.dita"><apiname>TI2sInterfaceType</apiname></xref>. </p><p>The Symbian platform I2S interface
       
    53 allows for any combination of the roles Master and Slave with the types Transmitter,
       
    54 Receiver and Bidirectional.  The type Controller is also supported. You must
       
    55 implement all the  configurations supported by the platform. </p><p>Implement <xref href="GUID-E6E8BD6D-70DA-3721-BABC-3935F1AD2C68.dita"><apiname>ConfigureInterface()</apiname></xref> with
       
    56 return  value <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref> for configurations not supported
       
    57 on  the platform. </p></li>
       
    58 <li><p> Implement <xref href="GUID-5FB8D2BF-EFC3-3C98-B874-170356322309.dita"><apiname>GetInterfaceConfiguration()</apiname></xref>. </p></li>
       
    59 <li><p>Determine the current configuration of the interface and set  the argument <codeph>aConfig</codeph> to
       
    60 that value.</p></li>
       
    61 <li><p>Implement <xref href="GUID-08DA8564-840D-3EF7-B2D7-4542C69980EA.dita"><apiname>SetSamplingRate()</apiname></xref> with return value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref> for
       
    62 each value of the enumeration  <xref href="GUID-77E06AB9-F7D3-30AA-9B60-8DFC85FF915E.dita"><apiname>TI2sSamplingRate</apiname></xref>. </p><p>The
       
    63 Symbian platform I2S interface supports sampling rates in the range  7.35KHz
       
    64 to 96KHz as specified in <xref href="GUID-77E06AB9-F7D3-30AA-9B60-8DFC85FF915E.dita"><apiname>TI2sSamplingRate</apiname></xref>. If possible,
       
    65 implement sampling for each of them. Where one of these sampling  rates is
       
    66 not supported by the hardware, implement  <xref href="GUID-08DA8564-840D-3EF7-B2D7-4542C69980EA.dita"><apiname>SetSamplingRate()</apiname></xref> with
       
    67 return value  <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.</p></li>
       
    68 <li><p>Implement <xref href="GUID-2485EA7C-0086-33F5-ADC1-18028E5D7A7A.dita"><apiname>GetSamplingRate()</apiname></xref>.  &lt;/para&gt; &lt;list
       
    69 ordered="false"&gt;&lt;ls.item&gt;&lt;para ditatype="tutorialinfo"&gt;  Determine the
       
    70 sampling rate and set the argument   <codeph>aSamplingRate</codeph> to that
       
    71 value.</p></li>
       
    72 <li><p>Implement <xref href="GUID-D36C99C0-7C53-3C47-8DE6-D5E2F6A4868D.dita"><apiname>SetFrameLengthAndFormat()</apiname></xref> for each  value
       
    73 of the enumeration <xref href="GUID-F07687C5-09FF-3155-81D0-E8C19D19F550.dita"><apiname>TI2sFrameLength</apiname></xref> and.</p><p>Symbian platform
       
    74 I2S interface supports the values specified in  <xref href="GUID-F07687C5-09FF-3155-81D0-E8C19D19F550.dita"><apiname>TI2sFrameLength</apiname></xref> for
       
    75 lengths of frames in bits. The frame phases are not necessarily of equal length:
       
    76 the API specifies that the  implementation shall calculate the length of the
       
    77 right frame phase by subtracting the value of <codeph>aLeftFramePhaseLength</codeph> from
       
    78 the value of  <codeph>aFrameLength</codeph>. If possible, implement frames
       
    79 and phases to have all  the possible lengths supported by the interface. Where
       
    80 a given length is not supported by the hardware, implement  <xref href="GUID-D36C99C0-7C53-3C47-8DE6-D5E2F6A4868D.dita"><apiname>SetFrameLengthAndFormat()</apiname></xref> with
       
    81 return value  <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.</p></li>
       
    82 <li><p> Implement <xref href="GUID-4C3CE52D-579D-39D8-809B-5D24B4A6C612.dita"><apiname>GetFrameFormat()</apiname></xref>.</p></li>
       
    83 <li><p>Determine the lengths of the left and right frame phases in bits and
       
    84 set the arguments <codeph>aLeftFramePhaseLength</codeph> and  <codeph>aRightFramePhaseLength</codeph> to
       
    85 those values.</p></li>
       
    86 <li><p>Implement <xref href="GUID-1044E644-2D3A-35E6-8AA6-17484AC710DB.dita"><apiname>SetSampleLength()</apiname></xref> for each value of the
       
    87 enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and  <xref href="GUID-AD2F9B40-C6D0-357A-8864-36889109932C.dita"><apiname>TI2sSampleLength</apiname></xref>. </p><p>The
       
    88 length of the sample transmitted in a phase may be less than  the length of
       
    89 the phase for reasons such as compression. You must therefore implement sample
       
    90 length as an independent quantity: this will involve padding  the end of the
       
    91 frame phase with appropriate values, usually 0. Where a given  combination
       
    92 of phase and sample length is not supported by the hardware,  implement <xref href="GUID-B8DAE173-E262-30C0-8923-4446B1051EB8.dita"><apiname>SetSampleLength</apiname></xref> with
       
    93 return value  <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.</p></li>
       
    94 <li><p>Implement <xref href="GUID-2550FD2D-2B62-3065-BD65-EB556E049F0A.dita"><apiname>GetSampleLength()</apiname></xref>.</p><p> For each value
       
    95 of <codeph>TI2sFramePhase</codeph> determine the  sample length and set <codeph>aSampleLength</codeph> to
       
    96 that value.</p></li>
       
    97 <li><p> Implement <xref href="GUID-03D3853E-B659-35F8-9AED-9F4D49A56233.dita"><apiname>SetDelayCycles()</apiname></xref> for each value of the
       
    98 enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p></li>
       
    99 <li><p> Implement <xref href="GUID-03D3853E-B659-35F8-9AED-9F4D49A56233.dita"><apiname>SetDelayCycles()</apiname></xref> for each value of the
       
   100 enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> The implementation
       
   101 should delay the onset of the frame phase by the passed-in number of bit clock
       
   102 cycles. The delay should apply to each frame until a new delay is specifed.
       
   103 It may be necessary to reduce the frame length and truncate the sample.  </p> </li>
       
   104 <li><p> Implement <xref href="GUID-9DB14B95-6153-3593-9D76-DE15A153BD45.dita"><apiname>GetDelayCycles()</apiname></xref> for each value of the
       
   105 enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Determine the number
       
   106 of delay cycles for the frame phase and set the argument <codeph>aDelayCycles</codeph> to
       
   107 that value.  </p> </li>
       
   108 <li><p> Implement <xref href="GUID-6704FC78-E207-35F5-B690-E9B50622E9C4.dita"><apiname>Start()</apiname></xref> for each value of the enumeration <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   109  </p> <p> Implement the interface to start data transmission and data reception
       
   110 in accordance with the argument <codeph>aDirection</codeph>, a bitmask of
       
   111 values of <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>. If the interface is a Controller, <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref> should
       
   112 be ignored. If the device is also a Master it should start generation of data
       
   113 synchronisation signals.  </p> </li>
       
   114 <li><p> Implement <xref href="GUID-7CBDCF0D-1D11-34D1-BF5C-1E5B50DA75B5.dita"><apiname>Stop()</apiname></xref> for each value of the enumeration <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   115  </p> <p> Implement the interface to stop data transmission and data reception
       
   116 in accordance with the argument <codeph>aDirection</codeph>, a bitmask of
       
   117 values of <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.  </p> </li>
       
   118 <li><p> Implement <xref href="GUID-B381C742-3EC2-3B2B-8108-354807EA63C9.dita"><apiname>IsStarted()</apiname></xref> for each value of the enumeration <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   119  </p> <p> Determine whether a transmission or reception is under way. If so,
       
   120 set the argument aStarted to <xref href="GUID-781E8158-805B-3784-8FED-D7A191822FC3.dita"><apiname>ETrue</apiname></xref>: otherwise set it to <xref href="GUID-A759CA2D-8327-348F-9337-4886E619D920.dita"><apiname>EFalse</apiname></xref>.
       
   121  </p> </li>
       
   122 <li><p> Implement each of the following functions with a return value of <xref href="GUID-0BB03881-8862-35FC-8102-48A2932AB738.dita"><apiname>KErrInUse</apiname></xref>.
       
   123  </p> <p> For each function in the list, detemine whether the interface is
       
   124 quiescent or a transfer is under way. If a transfer is under way, the functions
       
   125 should return <xref href="GUID-0BB03881-8862-35FC-8102-48A2932AB738.dita"><apiname>KErrInUse</apiname></xref> without further activity.  </p> <ul>
       
   126 <li><p>   <xref href="GUID-E6E8BD6D-70DA-3721-BABC-3935F1AD2C68.dita"><apiname>ConfigureInterface()</apiname></xref> </p> </li>
       
   127 <li><p>   <xref href="GUID-08DA8564-840D-3EF7-B2D7-4542C69980EA.dita"><apiname>SetSamplingRate()</apiname></xref> </p> </li>
       
   128 <li><p>   <xref href="GUID-D36C99C0-7C53-3C47-8DE6-D5E2F6A4868D.dita"><apiname>SetFrameLengthAndFormat()</apiname></xref> </p> </li>
       
   129 <li><p>   <xref href="GUID-1044E644-2D3A-35E6-8AA6-17484AC710DB.dita"><apiname>SetSampleLength()</apiname></xref> </p> </li>
       
   130 <li><p>   <xref href="GUID-C4E5C1C7-0261-3B92-81C9-6B6B02AE1646.dita"><apiname>SetCycleDelays()</apiname></xref> </p> </li>
       
   131 <li><p>   <xref href="GUID-6704FC78-E207-35F5-B690-E9B50622E9C4.dita"><apiname>Start()</apiname></xref> </p> </li>
       
   132 </ul></li>
       
   133 </ul><ph>Implementing PIO</ph> <p> If the platform supports PIO access mode,
       
   134 implement the following functions with a return value of <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>:
       
   135 otherwise implement them with a return value of <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.
       
   136  </p> <ul>
       
   137 <li><p> Implement <xref href="GUID-4987D177-B1CC-3C84-B164-A6A8C8A49D14.dita"><apiname>ReadReceiveRegister()</apiname></xref> for each value
       
   138 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Implement
       
   139 this function to read the contents of the register which receives data for
       
   140 each frame phase and place the data in the argument <codeph>aData</codeph>.
       
   141  </p> <p> Implementation of this function depends on design decisions. If
       
   142 a single register is used both to transmit and receive with half-duplex operation,
       
   143 read data from that register. If a single register is used to hold the contents
       
   144 of each frame phase, read data from that register, ignoring the argument <codeph>aFramePhase</codeph>.
       
   145 In such cases it will be the responsibility of the user of the API to maintain
       
   146 the integrity of the data, for instance by calling <xref href="GUID-34BD41A9-87DF-35E7-8961-FBBEB9907EE2.dita"><apiname>ReadRegisterModeStatus()</apiname></xref> to
       
   147 determine which frame phase the data belongs to.  </p> </li>
       
   148 <li><p> Implement <xref href="GUID-5D22BA8C-0A1D-3521-98B3-FEBDF2848173.dita"><apiname>WriteTransmitRegister()</apiname></xref> for each value
       
   149 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Implement
       
   150 this function to write the data in the argument <codeph>aData</codeph> to
       
   151 the register which transmits data for each frame phase.  </p> <p> Implementation
       
   152 of this function depends on design decisions. If a single register is used
       
   153 both to transmit and receive with half-duplex operation, write data to that
       
   154 register. If a single register is used to hold the contents of each frame
       
   155 phase, write data to that register, ignoring the argument <codeph>aFramePhase</codeph>.
       
   156 In such cases it will be the responsibility of the user of the API to maintain
       
   157 the integrity of the data, for instance by calling <xref href="GUID-34BD41A9-87DF-35E7-8961-FBBEB9907EE2.dita"><apiname>ReadRegisterModeStatus()</apiname></xref> to
       
   158 determine which frame phase the data belongs to.  </p> </li>
       
   159 <li><p> Implement <xref href="GUID-D37567BB-A533-3E52-A683-7A2B55030437.dita"><apiname>ReadTransmitRegister()</apiname></xref> for each value
       
   160 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Implement
       
   161 this function to read the contents of the register which transmits data for
       
   162 each frame phase and place the data in the argument <codeph>aData</codeph>.
       
   163  </p> <p> Implementation of this function depends on design decisions. If
       
   164 a single register is used both to transmit and receive with half-duplex operation,
       
   165 read data from that register. If a single register is used to hold the contents
       
   166 of each frame phase, read data from that register, ignoring the argument <codeph>aFramePhase</codeph>.
       
   167 In such cases it will be the responsibility of the user of the API to maintain
       
   168 the integrity of the data, for instance by calling <xref href="GUID-34BD41A9-87DF-35E7-8961-FBBEB9907EE2.dita"><apiname>ReadRegisterModeStatus()</apiname></xref> to
       
   169 determine which frame phase the data belongs to.  </p> </li>
       
   170 <li><p> Implement <xref href="GUID-34BD41A9-87DF-35E7-8961-FBBEB9907EE2.dita"><apiname>ReadRegisterModeStatus()</apiname></xref> for each value
       
   171 of the enumeration <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref> and each value of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.
       
   172  </p> <p> Determine whether these conditions are true or false:  </p> <ul>
       
   173 <li><p>   Receive register for the specified frame phase is full. </p> </li>
       
   174 <li><p>   Transmit register for the specified frame phase is empty. </p> </li>
       
   175 <li><p>   Receive register for the specified frame phase has overrun. </p> </li>
       
   176 <li><p>   Transmit register for the specified frame phase has underrun.   </p> </li>
       
   177 <li><p>   A framing error for the specified frame phase has occurred. </p> </li>
       
   178 </ul> <p> Convert the values into a bitmask (1 means the condition is true)
       
   179 and set the argument <codeph>aFlags</codeph> to that bitmask.  </p> </li>
       
   180 <li><p> Implement <xref href="GUID-14D20C5A-1013-3438-9A05-F20E952BF714.dita"><apiname>EnableRegisterInterrupts()</apiname></xref> for each value
       
   181 of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   182  </p> <p> Ensure that there is an interrupt for each interrupt flag in <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   183 Implement the interface to enable the interrupts in response to a bitmask
       
   184 containing the interrupt flags: enable when the flag is set to 1. If there
       
   185 are separate registers for each frame phase, implement the interrupts separately
       
   186 for each frame phase which may be passed as <codeph>aFramePhase</codeph>:
       
   187 otherwise ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   188 <li><p> Implement <xref href="GUID-C1DC5D07-E401-3553-8E4E-427976AF33DF.dita"><apiname>DisableRegisterInterrupts()</apiname></xref> for each
       
   189 value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   190  </p> <p> Ensure that there is an interrupt for each interrupt flag in <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   191 Implement the interface to disable the interrupts in response to a bitmask
       
   192 containing the interrupt flags: disable when the flag is set to 1. If there
       
   193 are separate registers for each frame phase, implement the interrupts separately
       
   194 for each frame phase which may be passed as <codeph>aFramePhase</codeph>:
       
   195 otherwise ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   196 <li><p> Implement <xref href="GUID-4E074F7C-78BD-3DB7-99B9-A7F71ED91276.dita"><apiname>IsRegisterInterruptEnabled()</apiname></xref> for each
       
   197 value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   198  </p> <p> Determine which interrupts are enabled for each frame phase and
       
   199 convert the values to a bitmask. Set the argument <codeph>aEnabled</codeph> to
       
   200 that bitmask.  </p> </li>
       
   201 </ul><ph>Implementing FIFO</ph> <p> If the platform supports FIFO access mode,
       
   202 implement the following functions with a return value of <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>:
       
   203 otherwise implement them with a return value of <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.
       
   204  </p> <ul>
       
   205 <li><p> Implement <xref href="GUID-F99D9D33-15C3-34A4-8035-4929E4721680.dita"><apiname>EnableFIFO()</apiname></xref> for each value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.  </p> <p> Implement the ability to enable FIFO receive and transmit for
       
   206 each direction, as passed in through the bitmask <codeph>aFifoMask</codeph>,
       
   207 and frame phase. If the same FIFO is used for receive and transmit, ignore
       
   208 the argument <codeph>aFifoMask</codeph>. If the same FIFO is used for both
       
   209 frame phases, ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   210 <li><p> Implement <xref href="GUID-4137769C-6FB9-37EE-986F-677C313A87E7.dita"><apiname>DisableFIFO()</apiname></xref> for each value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.  </p> <p> Implement the ability to disable FIFO receive and transmit for
       
   211 each direction, as passed in through the bitmask <codeph>aFifoMask</codeph>,
       
   212 and frame phase. If the same FIFO is used for receive and transmit, ignore
       
   213 the argument <codeph>aFifoMask</codeph>. If the same FIFO is used for both
       
   214 frame phases, ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   215 <li><p> Implement <xref href="GUID-1A4B3FFC-E74D-3046-96C6-6C10F136BFE0.dita"><apiname>IsFIFOEnabled()</apiname></xref> for each value of the
       
   216 enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Determine the enablement
       
   217 status of the FIFOs for each value of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.
       
   218 Convert the values into a bitmask and set the argument <codeph>aEnabled</codeph> to
       
   219 it. If the same FIFO is used for both frame phases, ignore the argument <codeph>aFramePhase</codeph>.
       
   220  </p> </li>
       
   221 <li><p> Implement <xref href="GUID-AAB7B832-99AD-34BF-9735-BEC3A975DA3C.dita"><apiname>SetFIFOThreshold()</apiname></xref> for each value of
       
   222 the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   223  </p> <p> Implement the interface to set the FIFO threshold to the value passed
       
   224 through the argument <codeph>aThreshold</codeph>. If the same FIFO is used
       
   225 for receive and transmit, ignore the argument <codeph>aFifoMask</codeph>.
       
   226 If the same FIFO is used for both frame phases, ignore the argument <codeph>aFramePhase</codeph>.
       
   227  </p> </li>
       
   228 <li><p> Implement <xref href="GUID-83E3305F-E8B0-39B5-B2DA-F18D1BDBC9DF.dita"><apiname>ReadFIFOModeStatus()</apiname></xref> for each value of
       
   229 the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Determine the
       
   230 status of the access modes for each frame phase. Convert the values into a
       
   231 bitmask and set the argument <codeph>aFlags</codeph> to it. If the same FIFO
       
   232 is used for both frame phases, ignore the argument <codeph>aFramePhase</codeph>.
       
   233  </p> </li>
       
   234 <li><p> Implement <xref href="GUID-62D23B05-6C18-3091-A1DD-C93345A1EEDF.dita"><apiname>EnableFIFOInterrupts()</apiname></xref> for each value
       
   235 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> </p> <p> Ensure
       
   236 that there is an interrupt for each interrupt flag in <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   237 Implement the interface to enable the interrupts in response to a bitmask
       
   238 containing the interrupt flags: enable when the flag is set to 1. If there
       
   239 are separate registers for each frame phase, implement the interrupts separately
       
   240 for each frame phase which may be passed as <codeph>aFramePhase</codeph>:
       
   241 otherwise ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   242 <li><p> Implement <xref href="GUID-97E2A18F-1696-3846-BE34-51A6D14A3162.dita"><apiname>DisableFIFOInterrupts()</apiname></xref> for each value
       
   243 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Ensure that
       
   244 there is an interrupt for each interrupt flag in <xref href="GUID-BB325213-7BBA-3073-9D0E-6FB9700D5CC0.dita"><apiname>TI2sFlags</apiname></xref>.
       
   245 Implement the interface to disable the interrupts in response to a bitmask
       
   246 containing the interrupt flags: disable when the flag is set to 1. If there
       
   247 are separate registers for each frame phase, implement the interrupts separately
       
   248 for each frame phase which may be passed as <codeph>aFramePhase</codeph>:
       
   249 otherwise ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   250 <li><p> Implement <xref href="GUID-B46F5FC5-35DB-36A5-9746-1468F319B585.dita"><apiname>IsFIFOInterruptEnabled()</apiname></xref> for each value
       
   251 of the enumeration <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref>.  </p> <p> Determine
       
   252 which interrupts are enabled for each frame phase and convert the values to
       
   253 a bitmask. Set the argument <codeph>aEnabled</codeph> to that bitmask.  </p> </li>
       
   254 <li><p> Implement <xref href="GUID-A0B22E7D-ACAC-3AEE-BB0C-4F6C396924DC.dita"><apiname>ReadFIFOLevel()</apiname></xref> for each value of the
       
   255 enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   256  </p> <p> Implement the interface to return the FIFO level for each pair of
       
   257 values taken from <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.
       
   258 For each pair of values passed as the arguments <codeph>aFramePhase</codeph> and <codeph>aDirection</codeph> write
       
   259 the FIFO level to the argument <codeph>aLevel</codeph>.  </p> </li>
       
   260 </ul> <required-cleanup translate="no"/><ph>Implementing DMA</ph> <p> If
       
   261 the platform supports DMA access mode, implement the following functions with
       
   262 a return value of <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>: otherwise implement them with
       
   263 a return value of <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.  </p> <ul>
       
   264 <li><p> Implement <xref href="GUID-6B21D414-C212-351E-B4CD-ADAAE5F7A691.dita"><apiname>EnableDMA()</apiname></xref> for each value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.  </p> <p> Implement the ability to enable DMA receive and transmit for
       
   265 each direction, as passed in through the bitmask <codeph>aFifoMask</codeph>,
       
   266 and frame phase. If the same FIFO is used for receive and transmit, ignore
       
   267 the argument <codeph>aFifoMask</codeph>. If the same FIFO is used for both
       
   268 frame phases, ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   269 <li><p> Implement <xref href="GUID-3E449142-0447-394A-8C9C-C9BBEE4D61B6.dita"><apiname>DisableDMA()</apiname></xref> for each value of the enumerations <xref href="GUID-9E9EDBC3-31DC-3F0D-B944-658A42C34A3F.dita"><apiname>TI2sFramePhase</apiname></xref> and <xref href="GUID-692EA2DE-53E9-3323-B0BE-2ECEB077B400.dita"><apiname>TI2sDirection</apiname></xref>.  </p> <p> Implement the ability to disable DMA receive and transmit for
       
   270 each direction, as passed in through the bitmask <codeph>aFifoMask</codeph>,
       
   271 and frame phase. If the same FIFO is used for receive and transmit, ignore
       
   272 the argument <codeph>aFifoMask</codeph>. If the same FIFO is used for both
       
   273 frame phases, ignore the argument <codeph>aFramePhase</codeph>.  </p> </li>
       
   274 <li><p> Implement <xref href="GUID-690D35E1-1B2F-339E-A080-D49205A1D5AA.dita"><apiname>IsDMAEnabled()</apiname></xref> for each value of the
       
   275 enumeration <codeph>TI2sDirection</codeph>.  </p> <p> Determine the enablement
       
   276 status of each FIFO and convert the values to a bitmask. Set the argument <codeph>aEnabled</codeph> to
       
   277 that bitmask.  </p> </li>
       
   278 </ul> </section>
       
   279 </conbody><related-links>
       
   280 <link href="GUID-B5A2D9BF-E4D0-52CB-AD19-1EC8B00F8F44.dita"><linktext>I2S Design
       
   281 Considerations</linktext></link>
       
   282 </related-links></concept>