/**
 * *************************************************************************************************************
 * @file IntPin.c
 * @author BH_CodeGenerator
 * @version 0.1
 * @date 2022-04-01
 * @warning <!--auto generated by Tools, do not modify or add anything, otherwise, your change will be lost!!! -->
 * @brief all the functions prototypes for IntPin firmware library
 * MCU / CFG Ver. :BH66F2475/1.7
 * Version = 1.0.0

 * *************************************************************************************************************
 *  @attention
 *
 *  Firmware Disclaimer Information
 *
 *  1. The customer hereby acknowledges and agrees that the program technical documentation, including the
 *     code, which is supplied by BEST HEALTH ELECTRONIC Inc., (hereinafter referred to as BestHealth) is the
 *     proprietary and confidential intellectual property of BestHealth, and is protected by copyright law and
 *     other intellectual property laws.
 *
 *  2. The customer hereby acknowledges and agrees that the program technical documentation, including the
 *     code, is confidential information belonging to BestHealth, and must not be disclosed to any third parties
 *     other than BestHealth and the customer.
 *
 *  3. The program technical documentation, including the code, is provided and for customer reference
 *     only. After delivery by BestHealth, the customer shall use the program technical documentation, including
 *     the code, at their own risk. BestHealth disclaims any expressed, implied or statutory warranties, including
 *     the warranties of merchantability, satisfactory quality and fitness for a particular purpose.
 *
 *  <h2><center>Copyright (C) BEST HEALTH ELECTRONIC Inc. All rights reserved</center></h2>
 */
#include "IntPin.h"
#include "..\board\BoardCfg.h"
// clang-format off
#define SET_INTnPin_EDG(n, Edge) {_int##n##s1 = (0x01 & (Edge >> 1));_int##n##s0 = (0x01 & Edge);}

// clang-format on

/**
 * @brief config IntPin0
 *
 * @param Edge @see Int_PinEdge_e
 */
void IntPin0_Cfg(uint8_t Edge)
{
#if defined(PIN_INT0_PA4)
    PIN_PA4_INT0();
#endif
    SET_INTnPin_EDG(0, Edge);
}

/**
 * @brief config IntPin1
 *
 * @param Edge @see Int_PinEdge_e
 */
void IntPin1_Cfg(uint8_t Edge)
{
#if defined(PIN_INT1_PA5)
    PIN_PA5_INT1();
#endif
    SET_INTnPin_EDG(1, Edge);
}

/**
 * @brief config IntPin2
 *
 * @param Edge @see Int_PinEdge_e
 */
void IntPin2_Cfg(uint8_t Edge)
{
    SET_INTnPin_EDG(2, Edge);
}

/**
 * @brief config IntPin3
 *
 * @param Edge @see Int_PinEdge_e
 */
void IntPin3_Cfg(uint8_t Edge)
{
    SET_INTnPin_EDG(3, Edge);
}
