/* add user code begin Header */
/**
  **************************************************************************
  * @file     wk_crc.c
  * @brief    work bench config program
  **************************************************************************
  * Copyright (c) 2025, Artery Technology, All rights reserved.
  *
  * The software Board Support Package (BSP) that is made available to
  * download from Artery official website is the copyrighted work of Artery.
  * Artery authorizes customers to use, copy, and distribute the BSP
  * software and its related documentation for the purpose of design and
  * development in conjunction with Artery microcontrollers. Use of the
  * software is governed by this copyright notice and the following disclaimer.
  *
  * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  *
  **************************************************************************
  */
/* add user code end Header */

/* Includes ------------------------------------------------------------------*/
#include "wk_crc.h"

/* add user code begin 0 */

/* add user code end 0 */

/**
  * @brief  init crc function.
  * @param  none
  * @retval none
  */
void wk_crc_init(void)
{
  /* add user code begin crc_init 0 */

  /* add user code end crc_init 0 */

  /* config poly size 16-bit */
  crc_poly_size_set(CRC_POLY_SIZE_16B);
  
  /* config initial data */
  crc_init_data_set(0xFFFF);

  /* config poly default value 0x8005 */
  crc_poly_value_set(0x8005);

  /* config output data reverse mode */
  crc_reverse_output_data_set(CRC_REVERSE_OUTPUT_DATA);

  /* config input data reverse mode */
  crc_reverse_input_data_set(CRC_REVERSE_INPUT_BY_BYTE);
  
  /* reset CRC_DT */
  crc_data_reset();
  /* add user code begin crc_init 1 */

  /* add user code end crc_init 1 */
}

/* add user code begin 1 */

/* add user code end 1 */
