]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_dsp/framework/audioStreamOutProc.h
PASDK-516:Add ASOT event creation
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamOutProc.h
index 3d8e3d2a389a97e224ee65e954b19891f3a55b39..a767d8a1a2e1d8ff25a842ab899600c529247696 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
-Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
 All rights reserved.
 
 * Redistribution and use in source and binary forms, with or without 
@@ -41,12 +41,29 @@ All rights reserved.
 #define _ASOP_H_
  
 #include <xdc/std.h>
+#include <ti/sysbios/knl/Event.h>
 #include <ti/sysbios/knl/Task.h>
 
 #include "audioStreamProc_params.h"
 #include "audioStreamProc_patchs.h"
 #include "audioStreamProc_config.h"
 #include "audioStreamProc_master.h"
+#include "ioPhy.h"
+#include "ioBuff.h"
+
+/* !!!!!!!!! Revisit !!!!!!!!!!!!!!
+ * Purpose : Temporary ASOT FL sizes.
+ *                      Deprecate PAF_SYS_FRAMELENGTH in phases.*/
+#define PAF_ASOT_FRAMELENGTH           256
+#define PAF_ASOT_MAX_FRAMELENGTH       1024
+
+/* Event IDs */
+#define Evt_Id_WakeTimer   Event_Id_00  // Wake Timer event
+#define Evt_Id_RxMsgAsit   Event_Id_01  // Rx ASIT message event
+#define Evt_Id_RxMsgAsdt   Event_Id_02  // Rx ASDT message event
+#define Evt_Id_TxMcaspEdma Event_Id_03  // Tx McASP EDMA event
+/* Event handle - to put in structure */
+extern Event_Handle asopEvt;
 
 // Global debug counter */
 extern Uint32 gTaskAsopCnt; // debug counter for ASOP task
@@ -63,10 +80,16 @@ typedef struct PAF_ASOT_Fxns {
     //Int (*passProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
     //Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
     //Int (*autoProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, ALG_Handle);
-    Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);    
+    
+    //Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);    
+    Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);    
+    
     //Int (*decodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
     Int (*encodeCommand) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
-    Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+    
+    //Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+    Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+    
     //Int (*decodeInfo) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
     Int (*decodeInfo1) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
     Int (*decodeInfo2) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
@@ -74,7 +97,10 @@ typedef struct PAF_ASOT_Fxns {
     //Int (*decodeDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
     Int (*decodeStream) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
     Int (*decodeEncode) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
+
     //Int (*decodeFinalTest) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);    
+    Int (*decodeFinalTest) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);    
+
     Int (*decodeComplete) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, ALG_Handle *, Int, Int);
     Int (*selectDevices) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
     //Int (*sourceDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
@@ -175,12 +201,36 @@ typedef struct PAF_ASOT_Patchs {
     const PAF_ASP_LinkInit * const (*i_encLinkInit);
 } PAF_ASOT_Patchs;
 
+typedef struct PAF_AST_OutIO {
+    ioPhyHandle_t        hIoPhy;     /* handle to I/O physical layer */
+    ioBuffHandle_t       hIoBuff;    /* handle to I/O buffer management */
+    Ptr                  hMcaspChan; /* handle to McASP LLD channel for output */
+    uint32_t             phyXferSize;
+
+    void     *mcaspTxBuf1;
+    void     *mcaspTxBuf2;
+    uint32_t  mcaspTxSize1;
+    uint32_t  mcaspTxSize2;
+    int       mcaspTxtwoXfers;
+
+    int       numPrimeXfers;
+
+    uint32_t  mcaspXferErr;
+
+    // debugging counters
+    uint32_t num_xfers;
+
+} PAF_AST_IoOut;
+
 // Audio Stream Input Task (ASOT) configuration
 typedef struct PAF_ASOT_Config {
-    Task_Handle taskHandle;     // ASOT handle
-    ACP_Handle acp;             // ASOT local ACP handle
-    PAF_ASPM_Config *pAspmCfg;  // ASIT/ASOT shared configuration
-    PAF_AST_Config *pAstCfg;    // ASIT/ASOT/ASDT shared configuration
+    Task_Handle     taskHandle;                 // ASOT task handle
+    uint_least16_t  state;                      // ASOT state
+    ACP_Handle      acp;                        // ASOT ACP handle
+    Int8            cbDrainedFlag[DECODEN_MAX]; // CB drained flags
+    PAF_ASPM_Config *pAspmCfg;                  // ASIT/ASOT shared configuration
+    PAF_AST_Config  *pAstCfg;                   // ASIT/ASOT/ASDT shared configuration
+    PAF_AST_IoOut   *pIoOut;
 } PAF_ASOT_Config;
 
 
@@ -284,8 +334,7 @@ Int
 PAF_ASOT_decodeProcessing(
     const PAF_ASOT_Params *pP, 
     const PAF_ASOT_Patchs *pQ, 
-    PAF_ASOT_Config *pAsotCfg, 
-    Int sourceSelect
+    PAF_ASOT_Config *pAsotCfg 
 );
 
 //   Purpose:   Decoding Function for processing Encode Commands.
@@ -301,8 +350,7 @@ Int
 PAF_ASOT_decodeInit(
     const PAF_ASOT_Params *pP, 
     const PAF_ASOT_Patchs *pQ, 
-    PAF_ASOT_Config *pAsotCfg, 
-    Int sourceSelect
+    PAF_ASOT_Config *pAsotCfg
 );
 
 //   Purpose:   Decoding Function for processing information in a manner that
@@ -407,5 +455,15 @@ PAF_ASOT_streamChainFunction(
     Int logArg
 );
 
-#endif /* _ASOP_H_ */
+//   Purpose:   Decoding Function for determining whether processing of the
+//              current stream is complete.
+Int
+PAF_ASOT_decodeFinalTest(
+    const struct PAF_ASOT_Params *pP, 
+    const struct PAF_ASOT_Patchs *pQ, 
+    struct PAF_ASOT_Config *pAsotCfg, 
+    Int frame, 
+    Int block
+);
 
+#endif /* _ASOP_H_ */