//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+
//+   Copyright (c) CML Microsystems Plc 2015
//+
//+   This firmware was designed by CML Microcircuits (UK) Ltd, based on
//+   UK originated technology and is only intended for use on CML’s  Evaluation kits.
//+
//+   The supply and use of this Firmware is subject to CML's
//+   Licence Agreement, a copy of which can be obtained from CML on request.
//+
//+   Contact details:
//+   Technical:  techsupport@cmlmicro.com
//+   Sales:  sales@cmlmicro.com
//+
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#ifndef __PROGTOOLS_H_
#define __PROGTOOLS_H_


//-------------------------------------------------------------------
//
//		MENU
//
//-------------------------------------------------------------------

/**
 * @brief Selection menu
 * @param defOpt - Default option. If different than 0, executes the number given
 * @return TRUE if success, false if fails
 */
uint8_t Menu_DefaultSelection(uint8_t defOpt);



//-------------------------------------------------------------------
//
//		CONFIGURE OPERATIONS
//
//-------------------------------------------------------------------


/**
 * @brief The purpose of this function is to configure the PE0601-7261/CMX7261 for G279A encoding.
 * @param nSamples - Number of samples
 * @return TRUE if success, FALSE if fails
 */
uint8_t G711_Encoder_Op(uint32_t nSamples);

/**
 * @brief The purpose of this function is to configure the PE0601-7261/CMX7261 for G729A decoding.
 * @param nSamples - Number of samples
 * @return TRUE if success, FALSE if fails
 */
uint8_t G711_Decoder_Op(uint32_t nSamples);

/**
 * @brief Decode G279A samples. But in this case the samples to decode are stored into a buffer and
 * 		 	pass to the fifo in an infinite loop. Uses static Buffers that are hold in the internal
 * 		 	RAM memory of the PE0003 (memory size limited)
 * @param nSamples - Number of samples
 * @return	TRUE of success, FALSE if fails
 */
uint8_t G711_Decoder_Op_Loop(uint32_t nSamples);

/**
 * @brief The purpose of this funtion is to configure the PE0601-7261/CMX7261 for G279A encoding.
 * @param nSamples - Number of samples
 * @return TRUE if success, FALSE if fails
 */
uint8_t G723_Encoder_Op(uint32_t nSamples);

/**
 * @brief The purpose of this function is to configure the PE0601-7261/CMX7261 for G723 decoding.
 * @param nSamples - Number of samples
 * @return TRUE if success, FALSE if fails
 */
uint8_t G723_Decoder_Op(uint32_t nSamples);

/**
 * @brief Decode G279A samples. But in this case the samples to decode are stored into a buffer and
 * 		 	pass to the fifo in an infinite loop. Uses static Buffers that are hold in the internal
 * 		 	RAM memory of the PE0003 (memory size limited)
 * @param nSamples - Number of samples
 * @return	TRUE of success, FALSE if fails
 */
uint8_t G723_Decoder_Op_Loop(uint32_t nSamples);



/**
 * @brief Encoder/Decoder mode
 * @return TRUE if success, FALSE if fails
 */
uint8_t G711_EncoderDecoder_Op();



/**
 * G723A Full Duplex operation
 * @param nSamples - samples to process
 * @return
 */
uint8_t G723_Encoder_Decoder_FullDuplex_Op(uint32_t nSamples);


#endif		/*__PROGTOOLS_H_*/
