Files
99_7018_lmx/include_lib/driver/cpu/br28/asm/debug.h

88 lines
3.0 KiB
C
Raw Normal View History

2025-10-29 13:10:02 +08:00
#ifndef __DEBUG_H__
#define __DEBUG_H__
/* ---------------------------------------------------------------------------- */
/**
* @brief
*/
/* ---------------------------------------------------------------------------- */
void debug_init();
/* ---------------------------------------------------------------------------- */
/**
* @brief
*/
/* ---------------------------------------------------------------------------- */
void exception_analyze();
/* ---------------------------------------------------------------------------- */
/**
* @brief ID
*
* @param name: , :"DBG_SPI0"
*
* @return: ID
*/
/* ---------------------------------------------------------------------------- */
u32 get_dev_id(char *name);
/* ---------------------------------------------------------------------------- */
/**
* @brief Memory权限保护设置
*
* @param idx: , : 0 ~ 7, 使03, 1, 2, 4, 5, 6, 7
* @param begin: Memory开始地址
* @param end: Memory结束地址
* @param inv: 0: , 1:
* @param format: "Cxwr0rw1rw2rw3rw", CPU:0:1:2:3,
* @param ...: ID号索引, : DBG_EQ, debug.h
* @example1: 1, 0x200 ~ 0x400 - 1, FFT和EQ设备访问:
mpu_set(1, 0x200, 0x400 - 1, 0, "0rw1rw", get_dev_id("DBG_FFT"), get_dev_id("DBG_EQ"));
* @example2: 2, 0x200 ~ 0x400 - 1, cpu读写和EQ设备访问:
mpu_set(2, 0x200, 0x400 - 1, 0, "Crw0rw", get_dev_id("DBG_EQ"));
*/
/* ---------------------------------------------------------------------------- */
void mpu_set(int idx, u32 begin, u32 end, u32 inv, const char *format, ...);
/* ---------------------------------------------------------------------------- */
/**
* @brief mpu保护
*
* @param idx:
*/
/* ---------------------------------------------------------------------------- */
void mpu_disable_by_index(u8 idx);
/* ---------------------------------------------------------------------------- */
/**
* @brief :mpu保护
*/
/* ---------------------------------------------------------------------------- */
void mpu_diasble(void);
/* ---------------------------------------------------------------------------- */
/**
* @brief flash PC范围设置为Flash外区域, flash里的函数将触发异常
*/
/* ---------------------------------------------------------------------------- */
void flash_pc_limit_disable();
/* ---------------------------------------------------------------------------- */
/**
* @brief flash PC范围限制恢复为flash代码区域, flash里的函数
*/
/* ---------------------------------------------------------------------------- */
void flash_pc_limit_enable();
#endif /* #ifndef __DEBUG_H__ */