/*
 * exo_ahw_vdp_uart_conv_max14830.h
 *
 *  Created on: May 16, 2023
 *      Author: Invcuser_63
 */

#ifndef DRIVERS_EXO_HAL_DRIVER_FW_EXO_AHW_AL_DRIVER_API_EXO_AHW_AL_WRAPPER_UART_CONV_MAX14830_INC_EXO_AHW_VDP_UART_CONV_MAX14830_H_
#define DRIVERS_EXO_HAL_DRIVER_FW_EXO_AHW_AL_DRIVER_API_EXO_AHW_AL_WRAPPER_UART_CONV_MAX14830_INC_EXO_AHW_VDP_UART_CONV_MAX14830_H_

#include "exo_hal_common.h"
#include "exo_ahw_al_spi_to_uart_common.h"
//#include "exo_io_al_i2c_common.h"

/**
 * @brief This function initialize the control block memory and do basic configurations
 * @param[in]  huart_conv - AHAL instance pointer of MAX14830
 * @retval hal_ret_sts - returns the success or error code
 */
hal_ret_sts ahw_vdp_uart_conv_init(s_ahw_max14830_hdle *huart_conv);

/**
 * @brief This function initialize the port configuration
 * @param[in]  huart_conv - AHAL instance pointer of MAX14830
 * @param[in]  init_cfg - structure handle of port configuration
 * @retval hal_ret_sts - returns the success or error code
 */
hal_ret_sts ahw_vdp_uart_conv_init_intf(s_ahw_max14830_hdle *huart_conv,s_ahw_max14830_init_cfg *init_cfg);

/**
 * @brief This function transmit the data
 * @param[in]  huart_conv - AHAL instance pointer of MAX14830
 * @param[in]  port - channel id
 * @param[in]  tx_buff - pointer to a buffer
 * @param[in]  tx_len - length of the data
 * @retval hal_ret_sts - returns the success or error code
 */
hal_ret_sts ahw_vdp_uart_conv_transmit(s_ahw_max14830_hdle *huart_conv,uint8_t port,uint8_t *tx_buff,uint16_t tx_len);

/**
 * @brief This function receive the data
 * @param[in]  huart_conv - AHAL instance pointer of MAX14830
 * @param[in]  port - channel id
 * @param[in]  rx_len - length of the data
 * @param[in]  callback_func - callback function
 * @retval hal_ret_sts - returns the success or error code
 */
hal_ret_sts ahw_vdp_uart_conv_receive(s_ahw_max14830_hdle *huart_conv,uint8_t port,uint16_t rx_len,max14830_callback_fptr_t callback_func);

/*
 *@brief This function use to self test the SPI to UART convertor
 * @param[in] huart_conv - AHAL instance pointer of MAX14830
 */
hal_ret_sts ahw_vdp_uart_conv_self_test(s_ahw_max14830_hdle *huart_conv);


#endif /* DRIVERS_EXO_HAL_DRIVER_FW_EXO_AHW_AL_DRIVER_API_EXO_AHW_AL_WRAPPER_UART_CONV_MAX14830_INC_EXO_AHW_VDP_UART_CONV_MAX14830_H_ */
