/**
 * @file  hv_drv_TypecInterrupts.h
 * @brief   UPD Interrupt file
 *       This header file contains register defines and function for UPD350 interrupt
 *      handling.
 * @details This file provides the following functions: \n
 *          (1) \n
 *          (2) \n
 *          (3) \n
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2022-08-25
 * @copyright Copyright(c),2022-8, Hiview Software. All rights reserved.
 * @par History:
 * <table>
 * <tr><th>Author                         <th>Date         <th>Change Description
 * <tr><td>Hiview SoC Software Team       <td>2022-08-25   <td>init
 * </table>
*/


#ifndef _HV_DRV_TYPECINTERRUPTS_H_
#define _HV_DRV_TYPECINTERRUPTS_H_

// *****************************************************************************
// *****************************************************************************
// Section: Constants
// *****************************************************************************
// *****************************************************************************

#define UPDINTR_INT_STS             UPD_SYSTEM_CSR_BASE_ADDR + 0x10
#define UPDINTR_INT_EN              UPD_SYSTEM_CSR_BASE_ADDR + 0x14

/* Bit definition of UPDINTR_INT_STS register */

#define UPDINTR_GP_TIMER_INT            BIT (14)
#define UPDINTR_RDY_INT                 BIT (12)
#define UPDINTR_EXT_INT                 BIT (11)
#define UPDINTR_PWR_INT                 BIT (10)
#define UPDINTR_VBUS_INT                BIT (9)
#define UPDINTR_HPD_INT                 BIT (8)
#define UPDINTR_PSW_INT                 BIT (7)
#define UPDINTR_WDT_INT                 BIT (6)
#define UPDINTR_PPC_INT                 BIT (5)
#define UPDINTR_MAC_INT                 BIT (4)
#define UPDINTR_OCS_CMP_INT             BIT (3)
#define UPDINTR_PIO_OVERRIDE_INT        BIT (2)
#define UPDINTR_PIO_INT                 BIT (1)
#define UPDINTR_CC_INT                  BIT (0)

/*Bit definitions for HPD_INT_STS register*/
#define UPDINTR_IRQ_HPD                       BIT(0)
#define UPDINTR_HPD_LOW                       BIT(1)
#define UPDINTR_HPD_HIGH                      BIT(2)
#define UPDINTR_HPD_QUEUE_NOT_EMPTY           BIT(3)
// *****************************************************************************
// *****************************************************************************
// Section: Interface Routines
// *****************************************************************************
// *****************************************************************************
/****************************************************************************************************
    Function:
        void UPDIntr_AlertHandler (UINT8 u8PortNum)
 
    Summary:
        UPD Interrupt Handler API
    
    Devices Supported:
        UPD350 REV A

    Description:
        This API handles the any UPD350 that has occurred through UPD350 IRQ Pin.
        
    Precondition:
        None.

    Parameters:
        u8PortNum - Port number of the device. Value passed will be less than CONFIG_PD_PORT_COUNT.

    Return:
        None.

    Remarks:
        None.
 **************************************************************************************************/
void UPDIntr_AlertHandler (UINT8 u8PortNum);

void UPDIntr_PollingHandler(UINT8 u8PortNum);



#endif /*_UPD_INTERRUPTS_H_*/
