This commit is contained in:
huxi
2025-12-03 11:12:34 +08:00
parent c23ae4f24c
commit bc195654bf
8163 changed files with 3799544 additions and 92 deletions
@@ -0,0 +1,8 @@
#ifndef _DUBUG_H_
#define _DUBUG_H_
void exception_analyze(u32 *p_sp);
void debug_init(void);
void debug_test();
#endif /* #ifndef _DUBUG_H_ */
+111
View File
@@ -0,0 +1,111 @@
#ifndef __ASS_Q32S_HWI__
#define __ASS_Q32S_HWI__
//*********************************************************************************//
// Module name : hwi.h //
// Description : q32DSP interrupt head file //
// By Designer : zequan_liu //
// Dat changed : //
//*********************************************************************************//
#define IRQ_EXCEPTION_IDX 0
#define IRQ_SOFT0_IDX 1
#define IRQ_M2P_IDX 2
#define IRQ_P33_IDX 3
#define IRQ_WDT_IDX 4
//#define IRQ_SPI_IDX 5
#define IRQ_UART0_IDX 6
//#define IRQ_UART1_IDX 7
#define IRQ_IIC_IDX 8
#define IRQ_LP_TMR0_IDX 9
#define IRQ_LP_TMR1_IDX 10
#define IRQ_P33_LPTMR0_IDX 11
#define IRQ_P33_LPTMR1_IDX 12
#define IRQ_GP_TMR0_IDX 13
#define IRQ_GP_TMR1_IDX 14
#define IRQ_LP_CTM_IDX 15
//#define IRQ_LP_CTM1_IDX 16
//#define IRQ_LP_VAD_IDX 17
//#define IRQ_LP_NFC_IDX 18
#define IRQ_PINR_IDX 19
#define IRQ_GPCNT_IDX 20
//---------------------------------------------//
// interrupt install
//---------------------------------------------//
void reg_set_ip(unsigned char index, unsigned char dat);
void bit_set_ie(unsigned char index);
void bit_clr_ie(unsigned char index);
void bit_set_swi(unsigned char index);
void bit_clr_swi(unsigned char index);
void request_irq(u8 index, void (*handler)(void), u8 priority);
//---------------------------------------------//
// core_num
//---------------------------------------------//
static inline int core_num(void)
{
u32 num;
asm volatile("%0 = cnum" : "=r"(num) :);
return num;
}
//---------------------------------------------//
// interrupt enable
//---------------------------------------------//
#define ENABLE_INT enable_int
#define enable_int() local_irq_enable()
#define DISABLE_INT disable_int
#define disable_int() local_irq_disable()
#define ___interrupt __attribute__((interrupt("")))
void local_irq_disable();
void local_irq_enable();
void irq_disable_core();
void irq_enable_core();
#define P33_IE_ENABLE() \
bit_set_ie(IRQ_P33_IDX)
#define P33_IE_DISABLE() \
bit_clr_ie(IRQ_P33_IDX)
static inline int cpu_in_irq()
{
int flag;
__asm__ volatile("%0 = icfg" : "=r"(flag));
return flag & 0xff;
}
static inline int cpu_irq_disable()
{
#if 0
int flag;
int ret;
__asm__ volatile("%0 = icfg" : "=r"(flag));
ret = ((flag & 0x300) != 0x300);
return ret;
#else
extern int __cpu_irq_disabled();
return __cpu_irq_disabled();
#endif
}
//*********************************************************************************//
// //
// end of this module //
// //
//*********************************************************************************//
#endif
@@ -0,0 +1,28 @@
#ifndef __INCLUDES__
#define __INCLUDES__
#define PMU_SYSTEM 1
//utils
#include "typedef.h"
#include "typedef/assert.h"
#include "printf.h"
#include "string.h"
#include "delay.h"
//apps
#include "lib_config.h"
#include "sdk_config.h"
//driver
#include "power_interface.h"
#include "clock_interface.h"
#include "uart.h"
//system
#include "hwi.h"
#include "interrupt_hw.h"
#include "debug.h"
#endif
@@ -0,0 +1,32 @@
#ifndef __INTERRUPT_HW__
#define __INTERRUPT_HW__
/*
gpcnt需要打断低功耗采样,优先即最高且不可屏蔽
*/
#define IRQ_EXCEPTION_IP 0
#define IRQ_M2P_IP 2
#define IRQ_P33_IP 0
#define IRQ_PINR_IP 0
#define IRQ_SOFT0_IP 0
#define IRQ_WDT_IP 0
#define IRQ_SPI_IP 0
#define IRQ_UART0_IP 0
#define IRQ_UART1_IP 0
#define IRQ_IIC_IP 0
#define IRQ_LP_TMR0_IP 2
#define IRQ_LP_TMR1_IP 0
#define IRQ_LP_TMR2_IP 0
#define IRQ_LP_TMR3_IP 0
#define IRQ_GP_TMR0_IP 0
#define IRQ_GP_TMR1_IP 0
#define IRQ_LP_CTM_IP 1
#define IRQ_LP_VAD_IP 0
#define IRQ_GPCNT_IP 3
#endif