/**
 * \file    drv_pd_isr.h
 * \brief   PD interrupt service request definition
 *
 * \par     Copyright (c) 2019 UWE Technologies Corp., Ltd. All Rights Reserved.
 * \author  James
 * \date    2019-08-01
 * \version 
 * 
 * \history 
 *  Date        Note
 *  2019-08-01  Original Creation
 * 
 */
 
#ifndef __DRV_PD_ISR_H_
#define __DRV_PD_ISR_H_


#include "types.h"


typedef enum DRV_PD_INTR_TYPE_e
{
    DRV_PD_INTR_TYPE_HW_TIMER1_OR_GPIO_CAP0,
    DRV_PD_INTR_TYPE_HW_TIMER2_OR_GPIO_CAP1,
    DRV_PD_INTR_TYPE_HW_TIMER3,
    DRV_PD_INTR_TYPE_PD,
    DRV_PD_INTR_TYPE_MAX
} DRV_PD_INTR_TYPE_t;


/**
 * \brief Get PD interrupt enable state function
 *
 * \return          Enabled(1) or disabled(0)
 *
 * \see
 */
bool_t drv_pd_intr_en_get(void);

/**
 * \brief Enable/disable PD interrupt
 *
 * \param flg       Enable(1) or disable(0)
 *
 * \see
 */
void drv_pd_intr_en_set(int flg);

/** \brief PD interrupt service request function
 *
 * \param arg 
 */
void drv_pd_isr(u32_t arg);

/** \brief PD interrupt handler initialization
 *
 */
void drv_pd_intr_handler_init(void);


/** \brief PD interrupt initialization
 *
 * \param en        Enable(1) or disable(0)
 */
void drv_pd_intr_init(bool_t en);


/** \brief Set PD interrupt handler
 *
 * \param type          PD interrupt type
 * \param intr_func     interrupt handler
 */
void drv_pd_intr_handler_set(DRV_PD_INTR_TYPE_t type, v_func_ptr_t intr_func);


#endif /* #ifndef __DRV_PD_ISR_H_ */

