/*$$$LICENCE_NORDIC_STANDARD<2017>$$$*/
#ifndef __M_AUDIO_TEST_H__
#define __M_AUDIO_TEST_H__

#include <stdint.h>
#include <stddef.h>

#include "nrf_cli.h"
#include "sdk_config.h"

/**@brief CLI handler function top level module command ("audio probe") */
void m_audio_probe_cmd(nrf_cli_t const * p_cli, size_t argc, char **argv);

/**@brief CLI subcommands of the module */
extern const nrf_cli_cmd_entry_t m_audio_probe_subcmds;

/**@brief Type representing probe points in Smart Remote audio chain.
 *
 * Points have to be kept in alphabetical order for console autocomplete.
 */
typedef enum
{
    M_AUDIO_PROBE_POINT_ANR_IN,      /**< Inject audio before ANR */
    M_AUDIO_PROBE_POINT_ANR_OUT,     /**< Tap audio after ANR */
    M_AUDIO_PROBE_POINT_CODEC_IN,    /**< Inject audio before codec */
    M_AUDIO_PROBE_POINT_EQ_IN,       /**< Inject audio before equalizer */
    M_AUDIO_PROBE_POINT_EQ_OUT,      /**< Tap audio after equalizer */
    M_AUDIO_PROBE_POINT_GAIN_IN,     /**< Inject audio before gain control */
    M_AUDIO_PROBE_POINT_GAIN_OUT,    /**< Tap audio after gain control */
    M_AUDIO_PROBE_INFO_SUBCOMMAND,   /**< Dummy entry to simplify autocompletion of audio probe commands in CLI. */
    M_AUDIO_PROBE_POINT_PDM_OUT,     /**< Tap audio after PDM microphone */
    M_AUDIO_PROBE_POINTS_NUM
} m_audio_probe_point_enum_t;

/**@brief Initialize audio instrumentation subsystem. */
void m_audio_probe_init(void);

/**@brief Insert a probe point into the audio chain. */
#if CONFIG_AUDIO_PROBE_ENABLED
void m_audio_probe_point(m_audio_probe_point_enum_t point, int16_t *buffer, size_t buffer_size);
#else
__STATIC_INLINE void m_audio_probe_point(m_audio_probe_point_enum_t point, int16_t *buffer, size_t buffer_size)
{
    // empty function
}
#endif /* CONFIG_AUDIO_PROBE_ENABLED */

#endif /* __M_AUDIO_TEST_H__ */
