/*
 * @file exo_io_al_stm32f7xx_crc.h
 *
 * @brief This file contains structures,enumerations
 * and function declaration for I2C interface
 *
 * @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 IO_AL_STM32F7xx_CRC_H
#define IO_AL_STM32F7xx_CRC_H

#include "exo_types.h"
#include "stdio.h"
#include "exo_hal_common.h"
#include "exo_io_al_common.h"
#include "exo_io_al_crc_common.h"
#include "exo_io_al_stm32f7xx_common.h"

#define INPUT_DATA_SIZE_MAX           (3*(1024*1024))
#define CRC_POLYNOMIAL_FACTOR         0x04C11DB7

/*
 * @brief This API is use to Initialization hardware CRC.
 *
 * Hardware CRC configuration info
 * @param[in]32 bit crc
 * @param[in]Polynomial            - 0x04C11DB7
 * @param[in]Initial CRC           = 0xFFFFFFFF
 * @param[in]Input data inversion  - none
 * @param[in]Output data inversion - none
 * @param[in]ioal_hcrc             - CRC handler
 */
hal_ret_sts io_hal_stm32f7xx_crc_init(ioal_crc_hdle *ioal_hcrc);
/*
 *  @brief This API is use to determine the input data format for CRC.
 *
 * @param[in]ioal_hcrc              - CRC handler
 * @param[in]input_data_buffer      - input buffer
 * @param[in]input_data_buffer_size - input buffer size
 * @param[out]crc_output_value      - crc value
 */
hal_ret_sts io_hal_stm32f7xx_crc_calculation (ioal_crc_hdle *ioal_hcrc, uint8_t *input_data_buffer, uint32_t input_data_buffer_size, uint32_t *crc_output_value);



/* API Mapping */
#define io_hal_common_crc_init 			    io_hal_stm32f7xx_crc_init
#define io_hal_common_crc_cal     			io_hal_stm32f7xx_crc_calculation

#endif /* IO_AL_STM32F7xx_CRC_H */
