/*$$$LICENCE_NORDIC_STANDARD<2016>$$$*/

/**
 * @defgroup DRV_AUDIO Audio driver
 * @{
 * @ingroup MOD_AUDIO
 * @brief Audio top-level driver.
 */
#ifndef __DRV_AUDIO_H__
#define __DRV_AUDIO_H__

#include <stdbool.h>
#include <stdint.h>

#include "nrf_balloc.h"
#include "nrf_cli.h"

/**@brief Audio buffer handler. */
typedef void (*drv_audio_buffer_handler_t)(int16_t *p_buffer);

/**@brief CLI subcommands of the codec */
extern const nrf_cli_cmd_entry_t drv_audio_subcmds;

/**@brief Enable audio source.
 *
 * @retval NRF_SUCCESS
 * @retval NRF_ERROR_INTERNAL
 */
ret_code_t drv_audio_enable(void);

/**@brief Disable audio source.
 *
 * @retval NRF_SUCCESS
 * @retval NRF_ERROR_INTERNAL
 */
ret_code_t drv_audio_disable(void);

/**@brief Initialization.
 *
 * @param[in] p_buffer_pool     Pointer to memory poll from which buffers will be allocated.
 * @param[in] buffer_handler    Handler which will be called when buffer with RAW audio is ready.
 * @retval NRF_SUCCESS
 * @retval NRF_ERROR_INVALID_PARAM
 * @retval NRF_ERROR_INTERNAL
 */
ret_code_t drv_audio_init(nrf_balloc_t const * p_buffer_pool,
                          drv_audio_buffer_handler_t buffer_handler);

#endif /* __DRV_AUDIO_H__ */
/** @} */
