121 lines
2.9 KiB
C
121 lines
2.9 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
#ifndef _INTC_H
|
|
#define _INTC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
WAKEUP_WIC_DCORE2BT,
|
|
WAKEUP_WIC_AUD2BT,
|
|
WAKEUP_WIC_BT2DCORE,
|
|
WAKEUP_WIC_AUD2DCORE,
|
|
WAKEUP_WIC_BT2AUD,
|
|
WAKEUP_WIC_DCORE2AUD,
|
|
WAKEUP_RTC_TMR2_INT0,
|
|
WAKEUP_RTC_TMR1_INT0,
|
|
WAKEUP_WDG1_INT,
|
|
WAKEUP_DM_SLP_INT,
|
|
WAKEUP_PMM_GPIO_INT0,
|
|
WAKEUP_PMM_GPIO_INT1,
|
|
WAKEUP_PMM_WDG_DTOP_INT,
|
|
WAKEUP_DIG_GPIO,
|
|
WAKEUP_PMM_BOD_INT,
|
|
WAKEUP_PMM_GPIO_DEB_INT_ALL,
|
|
WAKEUP_CHARGER_ON_FLAG_INT,
|
|
WAKEUP_TK_INT,
|
|
WAKEUP_VBATT_RESUME_INT,
|
|
WAKEUP_MAILBOX0_INT2,
|
|
WAKEUP_MAILBOX0_INT1,
|
|
WAKEUP_MAILBOX0_INT0,
|
|
WAKEUP_VAD_TDVAD_INT,
|
|
WAKEUP_BT_PD_EARLY_BY_BT_TMR,
|
|
WAKEUP_WDG0_INT,
|
|
WAKEUP_FLAG_VBUS_PTRN2P5_CHG_INT,
|
|
WAKEUP_GPIO_DEB_INT_ALL,
|
|
WAKEUP_PMM_RTC_TIMER_INT1,
|
|
WAKEUP_PMM_RTC_TIMER_INT0,
|
|
WAKEUP_I2C0_INT,
|
|
WAKEUP_GPIO_WAKEUP,
|
|
WAKEUP_RTC_TMR0_INT0,
|
|
} intc_wakeup_src_e;
|
|
|
|
void intc_init(uint32_t cpu);
|
|
|
|
void intc_set_priority(uint32_t cpu, uint32_t vector, uint32_t priority);
|
|
|
|
void intc_mask(uint32_t cpu, uint32_t vector);
|
|
|
|
void intc_unmask(uint32_t cpu, uint32_t vector);
|
|
|
|
void intc_config(uint32_t cpu, uint32_t vector, uint32_t level, uint32_t up);
|
|
|
|
void intc_ack(uint32_t cpu, uint32_t vector);
|
|
|
|
void intc_handler(uint32_t cpu);
|
|
|
|
uint32_t intc_get_vector(uint32_t cpu);
|
|
|
|
#if RISCV
|
|
/*
|
|
* intc_force_mtip - Force MTIP which used in OS's Yield function
|
|
*/
|
|
void intc_force_mtip(uint32_t cpu);
|
|
|
|
/*
|
|
* intc_get_force_mtip - Get MTIP's force status
|
|
*/
|
|
int intc_get_force_mtip(uint32_t cpu);
|
|
|
|
|
|
/*
|
|
* intc_clear_force_mtip - Clear force MTIP's interrupt status
|
|
*/
|
|
void intc_clear_force_mtip(uint32_t cpu);
|
|
|
|
|
|
/*
|
|
* systick_clear - Clear systick interrupt status
|
|
*/
|
|
void systick_clear(uint32_t cpu);
|
|
|
|
/*
|
|
* systick_config - config OS's systick
|
|
*
|
|
*/
|
|
void systick_config(uint32_t cpu, uint32_t clock, uint32_t rate);
|
|
|
|
/*
|
|
* systick_enable -- enable OS's systick timer;
|
|
*
|
|
*/
|
|
void systick_enable(uint32_t cpu);
|
|
|
|
/*
|
|
* systick_update -- update OS's systick timer;
|
|
*
|
|
*/
|
|
void systick_update(uint32_t cpu, uint32_t clock);
|
|
#endif
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif //_INTC_H
|