]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pasdk/shared/aspMsg_common.h
416ce3f29431624e1f51a1271fb527a8c43842c5
[processor-sdk/performance-audio-sr.git] / pasdk / shared / aspMsg_common.h
2 /*
3 Copyright (c) 2016, 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 #ifndef _ASP_MSG_COMMON_H_
37 #define _ASP_MSG_COMMON_H_
39 #include <xdc/std.h>
40 #include <ti/xdais/ialg.h>
41 #include <ti/ipc/MessageQ.h>
43 /* round up the value 'size' to the next 'align' boundary */
44 #define ROUNDUP(size, align) \
45     (UInt32)(((UInt32)(size) + ((UInt32)(align) - 1)) & ~((UInt32)(align) - 1))
47 #define MASTER_NAME                     ( "CORE0" ) // DSP is MASTER
48 #define SLAVE_NAME                      ( "HOST" )  // ARM is SLAVE
50 #define AspMsg_MasterMsgQueName         ( "MASTER:MsgQ:01" )
51 #define AspMsg_SlaveMsgQueName          ( "%s:MsgQ:01"   ) /* %s is each slave's Proc Name */
53 // ASP (Master-To-)Slave Commands
54 typedef enum ASP_Slave_Cmd {
55     ASP_SLAVE_NULL,                         // 0
56     ASP_SLAVE_START,                        // 1
57     ASP_SLAVE_EXIT,                         // 2
58     ASP_SLAVE_DEC_SOURCE_SELECT,            // 3
59     ASP_SLAVE_DEC_EXIT,                     // 4
60     ASP_SLAVE_DEC_CONTROL,                  // 5
61     ASP_SLAVE_DEC_ACTIVATE,                 // 6
62     ASP_SLAVE_DEC_RESET,                    // 7
63     ASP_SLAVE_DEC_INFO,                     // 8
64     ASP_SLAVE_DEC_DECODE,                   // 9
65     ASP_SLAVE_DEC_DEACTIVATE,               // 10
66     ASP_SLAVE_NCOMMANDS                     // 11
67 } ASP_Slave_Cmd;
69 // ASP (Slave-To-)Master Commands
70 typedef enum ASP_Master_Cmd {
71     ASP_MASTER_NULL = ASP_SLAVE_NCOMMANDS,  // 11
72     ASP_MASTER_START_DONE,                  // 12
73     ASP_MASTER_EXIT_DONE,                   // 13
74     ASP_MASTER_DEC_SOURCE_SELECT_DONE,      // 14
75     ASP_MASTER_DEC_EXIT_DONE,               // 15
76     ASP_MASTER_DEC_CONTROL_DONE,            // 16
77     ASP_MASTER_DEC_ACTIVATE_DONE,           // 17
78     ASP_MASTER_DEC_RESET_DONE,              // 18
79     ASP_MASTER_DEC_INFO_DONE,               // 19     // temp
80     ASP_MASTER_DEC_DECODE_DONE,             // 20     // temp
81     ASP_MASTER_DEC_DEACTIVATE_DONE          // 21
82 } ASP_Master_Cmd;
84 // ASP Message
85 typedef struct ASP_Msg
86 {
87     MessageQ_MsgHeader reserved;
88     
89     UInt32  cmd;        // command
90     UInt16  procId;     // processor Id of sender
91     Uint16  expectResp; // whether response expected from receiver + align buf to 32-bit boundary
92     UInt32  messageId;  // MB bit: response bit, LS 31 bits: message Id
93     Char    buf[32];    // buffer for message parameters
94 } ASP_Msg;
97 #endif /* _ASP_MSG_COMMON_H_ */