2245474ab1fb471c6b85ab8453624a86f7d375b5
2 /*
3 Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 /*
37 * ======== audioStreamOutIo.h ========
38 */
40 #ifndef _ASOP_IO_H_
41 #define _ASOP_IO_H_
43 #include <xdc/std.h>
45 #include "audioStreamOutProc.h"
47 // status codes
48 #define ASOP_IO_SOK ( 0 ) // ok
49 #define ASOP_IO_ERR_INV_PARAMS ( -1 ) // error, invalid parameters
50 #define ASOP_IO_ERR_IO_UNINIT ( -2 ) // error, IO uninitialized
51 #define ASOP_IO_ERR_MCASP_CFG ( -3 ) // error, McASP configuration
52 #define ASOP_IO_ERR_IOBUFF_INIT ( -4 ) // error, IO Buff initialization
53 #define ASOP_IO_ERR_IOPHY_INIT ( -5 ) // error, IO Phy initialization
54 #define ASOP_IO_ERR_OUTBUF_OVERFLOW ( -6 ) // error, Output buffer overflow
57 // Select Output devices
58 Int asopSelectDevices(
59 void *pConfig,
60 PAF_AST_IoOut *pOut
61 );
63 // Check if Output device SIO selection changed
64 Int checkOutDevSioSelUpdate(
65 const PAF_ASOT_Params *pP,
66 PAF_ASOT_Config *pAsotCfg,
67 Int z,
68 Bool *pOutDevSelUpdate
69 );
71 // Check if any Output device SIO selection changed
72 Int checkAnyOutDevSioSelUpdate(
73 const PAF_ASOT_Params *pP,
74 PAF_ASOT_Config *pAsotCfg,
75 Bool *pOutDevSelUpdate
76 );
78 // Re-initiate Output
79 Int asopSetCheckRateX(
80 const PAF_ASOT_Params *pP,
81 const PAF_ASOT_Patchs *pQ,
82 PAF_ASOT_Config *pAsotCfg,
83 Int check);
85 // Initiate Output
86 Int asopStartOutput(
87 const PAF_ASOT_Params *pP,
88 const PAF_ASOT_Patchs *pQ,
89 PAF_ASOT_Config *pAsotCfg
90 );
92 // Terminate Output
93 Int asopStopOutput(
94 const PAF_ASOT_Params *pP,
95 const PAF_ASOT_Patchs *pQ,
96 PAF_ASOT_Config *pAsotCfg
97 );
99 // Initialize I/O components for output processing
100 Int asopIoCompsInit(
101 PAF_AST_OutBuf *pOutBuf,
102 PAF_AST_IoOut *pOutIo
103 );
105 // Check I/O physical layer initialized
106 Bool asopIoPhyCheckInit(Void);
108 // I/O physical layer prime operation required by McASP LLD
109 Void asopIoPhyPrime(
110 PAF_AST_IoOut *pOut
111 );
113 // Initialize Output buffer configuration
114 Int asopInitOutBufConfig(
115 PAF_AST_OutBuf *pOutBuf,
116 PAF_AST_IoOut *pOutIo
117 );
119 // Get output buffer write pointers for encoder to write
120 Int asopGetOutBufPtrs(
121 PAF_AST_IoOut *pOutIo,
122 size_t writeSize
123 );
125 // Update Output buffer configuration
126 Int asopUpdateOutBufConfig(
127 PAF_AST_OutBuf *pOutBuf,
128 PAF_AST_IoOut *pOutIo
129 );
131 // Mark Output buffers write complete
132 Int asopMarkOutBuffsWriteComplete(
133 PAF_AST_OutBuf *pOutBuf,
134 PAF_AST_IoOut *pOutIo
135 );
137 // This function starts an I/O PHY transfer for output
138 Void asopPhyTransferStart(
139 PAF_AST_IoOut *pOut
140 );
143 #endif /* _ASOP_IO_H_ */