/*---------------------------------------------------------------------------*
  Project:  NitroSDK - WM - include
  File:     wm_sp.h

  Copyright 2003,2004 Nintendo.  All rights reserved.

  These coded instructions, statements, and computer programs contain
  proprietary information of Nintendo of America Inc. and/or Nintendo
  Company Ltd., and are protected by Federal copyright law.  They may
  not be disclosed to third parties or copied or duplicated in any form,
  in whole or in part, without the prior written consent of Nintendo.

  $Log: wm_sp.h,v $
  Revision 1.15  2004/11/09 06:47:13  terui
  Added definition of WM_WL_HEAP_SIZE constant.

  Revision 1.14  2004/10/06 07:06:19  ooe
  Changed the default setting of the SDK_SMALL_BUILD_WL switch to OFF.

  Revision 1.13  2004/10/01 04:08:40  terui
  Defined the compile switch so that WL library does not use DMA copy.

  Revision 1.12  2004/09/29 10:07:24  terui
  Added support for specifications allowing two levels of priority for wireless threads.

  Revision 1.11  2004/09/07 00:13:52  terui
  Changed name of buffer size constant definition for WL.

  Revision 1.10  2004/09/06 13:04:06  terui
  Moved definition so that you can control the
  used DMA number and DMA max length with this file.

  Revision 1.9  2004/08/31 23:56:01  terui
  Changed DMA number used by WL from 3 to 2. Tentatively solved
  problem of sound coexistence.

  Revision 1.8  2004/08/27 08:17:30  terui
  Change pass to version_wl.h

  Revision 1.7  2004/08/26 09:38:43  miya
  define WL DMA No.

  Revision 1.6  2004/07/27 09:54:11  yasu
  Append version_wl.h

  Revision 1.5  2004/07/20 01:18:41  terui
  Removed definitions that are no longer used because of changes to WMSP specifications.

  Revision 1.4  2004/07/10 11:49:24  terui
  Revision caused by change in installation location of Marionea

  Revision 1.3  2004/07/08 09:48:32  terui
  Changes due to beginning of WM7 revision

  Revision 1.2  2004/06/19 04:03:19  miya
  ver. up Marionea-1.48.00

  Revision 1.1  2004/05/26 08:50:01  terui
  Additions in accordance with wireless insertion.

  $NoKeywords: $
 *---------------------------------------------------------------------------*/
#ifndef NITRO_WM_ARM7_WM_SP_H_
#define NITRO_WM_ARM7_WM_SP_H_

#ifdef  __cplusplus
extern "C" {
#endif

/*===========================================================================*/

#include <nitro.h>
#include <nitro_wl/common/version_wl.h>
#include <nitro_wl/ARM7/WlLib.h>


/*---------------------------------------------------------------------------*
    Constant definitions
 *---------------------------------------------------------------------------*/
#define WM_WL_WORK_SIZE         0x700
#define WM_WL_STACK_SIZE        0x600
#define WM_WL_CAMTABLE_NUM      16
#define WM_WL_HEAP_SIZE         0x2100

/* No specification is relevant because the changes were made not to use DMA in WMSP. */
// DMA number used by WM library
#define WM_SP_WM_DMA_NO         3

/* No specification is relevant because the switch described below makes WL not to use DMA. */
// Number of DMA used by WL library
#define WM_SP_WL_DMA_NO         2
// maximum size of DMA used by WL library
//(Has a decision been made relating to quality of DMA sound?)
#define WM_DMA_MAX_SIZE         64

// Sets WL library not to use DMA
//#define SDK_SMALL_BUILD_WL      1       // Switch that is valid with Marionea1.87.01 or later
//#define   SDK_SIMPLE_DIAG_WL  1       // Switch that is valid with Marionea1.87.01 or later
#define SDK_CPU_COPY_WL         1       // Switch that is valid with Marionea2.10.00 or later
/* It is necessary to recompile WL library while in this state.  */


/*---------------------------------------------------------------------------*
    Structure definitions
 *---------------------------------------------------------------------------*/
// Structure for WMSP initialization
#if ( SDK_VERSION_WL >= 20900 )
    typedef struct WmInit
    {
        u32     dmaNo;
        u32     indPrio_low;
        u32     indPrio_high;
        u32     reqPrio_low;
        u32     reqPrio_high;
        u32     wlPrio_low;
        u32     wlPrio_high;
    } WmInit;
#else
    typedef struct WmInit
    {
        u32     dmaNo;
        u32     indPrio;
        u32     reqPrio;

    } WmInit;
#endif

/*---------------------------------------------------------------------------*
    Function definitions
 *---------------------------------------------------------------------------*/
// WMSP initialization process
/*  Starts WL, creates and starts WM thread, and configures the FIFO used by WM.    When starting, call this once with NitroSpMain(). */
void WM_sp_init(WlInit *wlInit, WmInit *wmInit);


/*===========================================================================*/

#ifdef  __cplusplus
}       /* extern "C" */
#endif

#endif  /* NITRO_WM_ARM7_WM_SP_H_ */

/*---------------------------------------------------------------------------*
  End of file
 *---------------------------------------------------------------------------*/
