/**
 * *************************************************************************************************************
 * @file IntPin.h
 * @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>
 */
/* Define to prevent recursive inclusion -------------------------------------------------------------------*/
#ifndef _INT_PIN_H_
#define _INT_PIN_H_

/* Includes ------------------------------------------------------------------------------------------------*/
#include <stdint.h>
#include "BH66F2455.h"

/* Exported types ----------------------------------------------------------------------------------------*/
/**
 * @brief Interrupt Edge Control Selection enum
 *
 */
typedef enum {
    DISABLE        = (0x00 << 0),    //!< No debounce
    RISING         = (0x01 << 0),    //!< (7~8)/f SYS
    FALLING        = (0x02 << 0),    //!< (15~16)/f SYS
    RISING_FALLING = (0x03 << 0),    //!< (31~32)×1/f SYS
} Int_PinEdge_e;

/* Exported functions --------------------------------------------------------------------------------------*/
// clang-format off
void IntPin0_Cfg(uint8_t Edge);
#define IntPin0_Isr_Enable()    {_int0e = true;}
#define IntPin0_Isr_Disable()   {_int0e = false;}
#define IntPin0_Trigger_Flag    _int0f

void IntPin1_Cfg(uint8_t Edge);
#define IntPin1_Isr_Enable()    {_int1e = true;}
#define IntPin1_Isr_Disable()   {_int1e = false;}
#define IntPin1_Trigger_Flag    _int1f

void IntPin2_Cfg(uint8_t Edge);
#define IntPin2_Isr_Enable()    {_int2e = true;}
#define IntPin2_Isr_Disable()   {_int2e = false;}
#define IntPin2_Trigger_Flag    _int2f

void IntPin3_Cfg(uint8_t Edge);
#define IntPin3_Isr_Enable()    {_int3e = true;}
#define IntPin3_Isr_Disable()   {_int3e = false;}
#define IntPin3_Trigger_Flag    _int3f

// clang-format on

#endif