/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/******************************************************************************
* File Name    : sample_scux.h
* Description  : Sample SCUX Application
******************************************************************************/
/* Guards against multiple inclusion */
#ifndef SAMPLE_SCUX_H
#define SAMPLE_SCUX_H

/******************************************************************************
Includes   <System Includes> , "Project Includes"
******************************************************************************/
#include "r_typedefs.h"

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

/******************************************************************************
Macro definitions
******************************************************************************/
/* Sample SCUX software version */
#define SAMPLE_SCUX_SOFT_VER	"Ver.0.50"

/* INT Prohibition */
#define MASK_INT_LV			(0)

/* Return value for SCUX Sample Application  */
#define SCUX_APP_SUCCESS	(0)
#define SCUX_APP_ERROR		(-1)

/* ==== SCUX usecase list ==== */
enum scux_usecase
{
		SCUX_USECASE_1	/*        SSIF0 -> SRC0(Async) -> SSIF0           */
	,	SCUX_USECASE_2	/*        SSIF0 -> SRC0(Async) -> SSIF3           */
	,	SCUX_USECASE_3	/*        SSIF0 -> SRC0(Async) -> Memory -> SSIF0 */
	,	SCUX_USECASE_4	/* Fixed Memory -> SRC2(Async) -> SSIF4           */
	,	SCUX_USECASE_5	/* Fixed Memory -> SRC2(sync)  -> Memory -> SSIF0 */
	,	SCUX_USECASE_6	/* Fixed Memory -> SRC3(Async) -> Memory -> SSIF0 */
	,	SCUX_USECASE_7	/* [SSIF0->SRC0(Async), Memory->SRC1(Async)]->MIX->SSIF3 */
	,	NUM_SCUX_USECASE
};

/* ==== SCUX ID to change setup list ==== */
enum scux_change_setup_id
{
		SETUP_CHANGE_SRC_BYPASS
	,	SETUP_CHANGE_DVU_BYPASS
	,	SETUP_CHANGE_DVU_ZCMUTE
	,	SETUP_CHANGE_DVU_RAMP_TIME
	,	SETUP_CHANGE_DVU_RAMP_LEVEL
	,	SETUP_CHANGE_DVU_RAMP_WAIT
	,	SETUP_CHANGE_DVU_VOLUP
	,	SETUP_CHANGE_DVU_VOLDOWN
	,	SETUP_CHANGE_MIX_GAIN_LEVEL
	,	NUM_SETUP_ID
};

/* ==== SCUX error interrupt ID list ==== */
enum scux_errint_id
{
		ERRINT_FFD_UNDERFLOW
	,	ERRINT_FFD_OVERFLOW
	,	ERRINT_FFD_OVERLAP
	,	ERRINT_FFD_INIT_UNDERFLOW
	,	ERRINT_FFU_UNDERFLOW
	,	ERRINT_FFU_OVERFLOW
	,	ERRINT_FFU_OVERLAP
	,	ERRINT_SRC_UNDERFLOW
	,	ERRINT_SRC_OVERFLOW
	,	NUM_SCUX_ERRINT_ID
};

/******************************************************************************
Typedef definitions
******************************************************************************/

/******************************************************************************
Exported global variables
******************************************************************************/
extern int32_t SCUX_Setup (void);
extern int32_t SCUX_Play (void);
extern int32_t SCUX_Stop (void);
extern uint32_t SCUX_GetErrIntCount (const uint32_t scux_ch, const uint32_t err_id);
extern int32_t SCUX_DmaFixedToScuxSetQueue (uint8_t *buffaddr, uint32_t buffsize);
extern int32_t SCUX_DmaFixedToScuxContinue (void);

/******************************************************************************
Exported global functions (to be accessed by other files)
******************************************************************************/

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* SAMPLE_SCUX_H */

/* End of File */
