#ifndef DRIVERS_EXO_HAL_DRIVER_FW_EXO_HAL_FW_COMMON_COMMON_INC_EXO_HAL_IO_AL_INTR_H_
#define DRIVERS_EXO_HAL_DRIVER_FW_EXO_HAL_FW_COMMON_COMMON_INC_EXO_HAL_IO_AL_INTR_H_


#include "exo_types.h"
#include "exo_hal_common.h"

typedef enum
{
	I2C_MST_TX_CPLT_CB=0b1,
	I2C_MST_RX_CPLT_CB=0b10,
	I2C_ABORT_CPLT_CB=0b100,
	I2C_LISTEN_CPLT_CB=0b1000,
	I2C_ERROR_CB=0b10000,
	I2C_CB_ID_MAX=0b10001

}i2c_cb_id;

typedef enum
{
	SPI_TX_CPLT_CB=0b1,
	SPI_RX_CPLT_CB=0b10,
	SPI_TX_RX_CPLT_CB=0b100,
	SPI_ABORT_CPLT_CB=0b1000,
	SPI_ERROR_CB=0b10000,
	SPI_CB_ID_MAX=0b10001
}spi_cb_id;

typedef enum
{
	UART_TX_CPLT_CB=0b1,
	UART_RX_CPLT_CB=0b10,
	UART_ABORT_CPLT_CB=0b100,
	UART_TX_ABORT_CPLT_CB=0b1000,
	UART_RX_ABORT_CPLT_CB=0b10000,
	UART_ERROR_CB=0b100000,
	UART_CB_ID_MAX=0b100001
}uart_cb_id;

/**
 * @brief Application hardware information structure definition
 */
typedef struct _i2c_intr_cb
{
	void (*i2c_mst_tx_cplt_cb)(void* args); 	///< Hold Fn address for I2C Master Tx Transfer completed callback ID
	void (*i2c_mst_rx_cplt_cb)(void* args); 	///< Hold Fn address for I2C Master Rx Transfer completed callback ID
	void (*i2c_abort_cplt_cb)(void* args); 	    ///< Hold Fn address for Abort complete event
	void (*i2c_listen_cplt_cb)(void* args); 	///< Hold Fn address for Listen complete event
	void (*i2c_error_cb)(void* args);			///< Hold Fn address for error event

}i2c_cb_lst;

/**
 * @brief Application hardware information structure definition
 */
typedef struct _spi_intr_cb
{
	void (*spi_tx_cplt_cb)(void* args);    /*!< Hold Fn address for Transmit complete event					*/
	void (*spi_rx_cplt_cb)(void* args);    /*!< Hold Fn address for Receive complete event						*/
	void (*spi_tx_rx_cplt_cb)(void* args); /*!< Hold Fn address for Transmit and Receive complete event		*/
	void (*spi_abort_cplt_cb)(void* args); /*!< Hold Fn address for Abort complete event						*/
	void (*spi_error_cb)(void* args);      /*!< Hold Fn address for error event								*/
}spi_cb_lst;

/**
 * @brief Application hardware information structure definition
 */
typedef struct _uart_intr_cb
{
	void (*uart_tx_cplt_cb)(void* args);			/*!< Fn address of TX complete event callback   		*/
	void (*uart_rx_cplt_cb)(void* args);			/*!< Fn address of RX complete event callback   		*/
	void (*uart_abort_cplt_cb)(void* args);		/*!< Fn address of abort complete event callback   		*/
	void (*uart_abort_tx_cplt_cb)(void* args);	/*!< Fn address of abort TX complete event callback   	*/
	void (*uart_abort_rx_cplt_cb)(void* args);	/*!< Fn address of abort RX complete event callback   	*/
	void (*uart_error_cb)(void* args);			/*!< Fn address of error event callback   				*/

}uart_cb_lst;

/**
 * @brief Application hardware information structure definition
 */
typedef struct _can_intr_cb
{
	void (*can_tx_mb0_cplt_cb)(void* args);    /*!< Hold Fn address for Tx complete for mailbox0 event					*/
	void (*can_tx_mb1_cplt_cb)(void* args);    /*!< Hold Fn address for Tx complete for mailbox1 event					*/
	void (*can_tx_mb2_cplt_cb)(void* args);    /*!< Hold Fn address for Tx complete for mailbox2 event					*/
	void (*can_mb0_abort_cb)(void* args);     	/*!< Hold Fn address for mailbox0 abort event							*/
	void (*can_mb1_abort_cb)(void* args);     	/*!< Hold Fn address for mailbox1 abort event							*/
	void (*can_mb2_abort_cb)(void* args);    	/*!< Hold Fn address for mailbox2 abort event							*/
	void (*can_fifo0_msg_pend_cb)(void* args); /*!< Hold Fn address for message pending indication for fifo0 event		*/
	void (*can_fifo0_full_cb)(void* args);     /*!< Hold Fn address for fifo0 full event								*/
	void (*can_fifo1_msg_pend_cb)(void* args); /*!< Hold Fn address for message pending indication for fifo1 event		*/
	void (*can_fifo1_full_cb)(void* args);     /*!< Hold Fn address for fifo1 full event								*/
	void (*can_sleep_cb)(void* args);   		/*!< Hold Fn address for sleep event									*/
	void (*can_wakeup_cb)(void* args);   		/*!< Hold Fn address for wakeup event									*/
	void (*can_error_cb)(void* args);     		/*!< Hold Fn address for error event                                    */

}can_cb_lst;

/**
 * @brief Application hardware information structure definition
 */
typedef union _io_cb_list
{
	can_cb_lst can_callbacks;
	spi_cb_lst spi_callbacks;
	i2c_cb_lst i2c_callbacks;
	uart_cb_lst uart_callbacks;
}io_cb_list;

/**
 * @brief AHW type enumeration
 */
typedef enum
{
	LISR,
	HISR,
	ISR_CONTEXT_MAX
}isr_context;

typedef struct
{
io_cb_list io_cb_list;
uint16 cb_context;
}io_al_intr_info;


hal_ret_sts io_ahw_hal_intr_init();

#endif /* DRIVERS_EXO_HAL_DRIVER_FW_EXO_HAL_FW_COMMON_COMMON_INC_EXO_HAL_IO_AL_INTR_H_ */
