Edit online

接口设计

3 Mar 2025
Read time: 1 minute(s)

WRI 相关的内部接口

1. aic_hw_type_get

函数原型

enum aic_warm_reset_type aic_hw_type_get(void __iomem *regs)

功能说明

读取上一次 reboot 硬件原因

参数定义

regs - 指向 WRI 寄存器的指针

返回值

暖复位原因类型

注意事项

-

2. aic_judge_reboot_reason

函数原型

enum aic_reboot_reason aic_judge_reboot_reason(enum aic_warm_reset_type hw, enum aic_reboot_reason sw)

功能说明

分析判断 reboot 原因

参数定义

  • hw- 硬件监测的 reboot 原因
  • sw - 软件监测的 reboot 原因

返回值

reboot 原因类型

注意事项

判断依据是 WRI 模块、RTC 模块 SYS_BAK 寄存器中的两处 reboot 信息

3. aic_set_reboot_reason

函数原型

void aic_set_reboot_reason(enum aic_reboot_reason reason)

功能说明

设置 Reboot reason 到 RTC 模块的 SYS_BAK 寄存器

参数定义

reason - aic_reboot_reason 类型的启动原因

返回值

-

注意事项

-