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 #ifndef _ASP_MSG_COMMON_H_
37 #define _ASP_MSG_COMMON_H_
39 #include <xdc/std.h>
40 #include <ti/ipc/MessageQ.h>
42 // round up the value 'size' to the next 'align' boundary
43 #define ROUNDUP(size, align) \
44 (UInt32)(((UInt32)(size) + ((UInt32)(align) - 1)) & ~((UInt32)(align) - 1))
46 #define AspMsg_MasterMsgQueName ( "MASTER:MsgQ:01" ) // master MessageQ name
47 #define AspMsg_SlaveMsgQueName ( "%s:MsgQ:01" ) // slave MessageQ name, %s is each slave's Proc Name
49 #define ASP_MSG_BUF_LEN ( 32 ) // message buffer length in bytes
51 // ASP (Master-To-)Slave Commands
52 typedef enum ASP_Slave_Cmd {
53 ASP_SLAVE_NULL, // 0
54 ASP_SLAVE_START, // 1
55 ASP_SLAVE_EXIT, // 2
56 ASP_SLAVE_DEC_SOURCE_SELECT, // 3
57 ASP_SLAVE_DEC_EXIT, // 4
58 ASP_SLAVE_DEC_CONTROL, // 5
59 ASP_SLAVE_DEC_ACTIVATE, // 6
60 ASP_SLAVE_DEC_RESET, // 7
61 ASP_SLAVE_DEC_INFO, // 8
62 ASP_SLAVE_DEC_DECODE, // 9
63 ASP_SLAVE_DEC_DEACTIVATE, // 10
64 ASP_SLAVE_NCOMMANDS // 11
65 } ASP_Slave_Cmd;
67 // ASP (Slave-To-)Master Command Acknowledgments
68 typedef enum ASP_Master_Cmd {
69 ASP_MASTER_NULL = ASP_SLAVE_NCOMMANDS, // 11
70 ASP_MASTER_START_DONE, // 12
71 ASP_MASTER_EXIT_DONE, // 13
72 ASP_MASTER_DEC_SOURCE_SELECT_DONE, // 14
73 ASP_MASTER_DEC_EXIT_DONE, // 15
74 ASP_MASTER_DEC_CONTROL_DONE, // 16
75 ASP_MASTER_DEC_ACTIVATE_DONE, // 17
76 ASP_MASTER_DEC_RESET_DONE, // 18
77 ASP_MASTER_DEC_INFO_DONE, // 19
78 ASP_MASTER_DEC_DECODE_DONE, // 20
79 ASP_MASTER_DEC_DEACTIVATE_DONE // 21
80 } ASP_Master_Cmd;
82 // ASP message
83 typedef struct AspMsg
84 {
85 MessageQ_MsgHeader reserved;
87 UInt16 procId; // processor Id of sender
88 UInt32 messageId; // MB bit: ack bit, LS 31 bits: message Id
89 UInt32 cmd; // command
90 Char buf[ASP_MSG_BUF_LEN]; // buffer for message parameters
91 } AspMsg;
94 #endif /* _ASP_MSG_COMMON_H_ */