/**
 * @file exo_io_al_crc_common.h
 *
 * @brief This file contains type defines of return status
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
#ifndef CRC_H
#define CRC_H

#include "exo_io_al_common.h"
#include "exo_hal_common.h"
#include "exo_osal_common.h"

#define  CRC_INTF_ENB


typedef enum
{
	EXO_HARDWARE_CRC_MODE,
	EXO_SOFTWARE_CRC_MODE
} exo_io_crc_mode;

typedef struct _ioal_crc_hdle
{
    ioal_intf_gen_info intf_gen_info; 						/*!< Hold general information of interface */
    os_sem_handle_ptr semaphore_hdle;
}ioal_crc_hdle;

/*
 *  @brief This API is use to Initialization hardware CRC.
 *  @param[in]ioal_hcrc - CRC handler
 *  @param[in]inst_id   - instance ID
 */
hal_ret_sts io_hal_crc_init(ioal_crc_hdle *ioal_hcrc, io_inst_id inst_id);
/*
 *  @brief This API is use to call the hardware CRC.
 *
 *  It supports both hardware CRC and software CRC
 *
 *  @param[in]crc_mode               - use to select hardware CRC (EXO_HARDWARE_CRC_MODE) or software CRC (EXO_SOFTWARE_CRC_MODE)
 *  @param[in]input_data_buffer      - input buffer
 *  @param[in]input_data_buffer_size - input buffer size
 */
uint32_t exo_io_hal_crc_calculate(exo_io_crc_mode crc_mode, uint8_t *input_data_buffer, uint32_t input_data_buffer_size);

#endif /*CRC_H*/
