• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef _DUET_BOOT_H_
17 #define _DUET_BOOT_H_
18 
19 #define AON_RST_CHECK_REG                   (ALWAYS_ON_REGFILE + 0x10)
20 #define AON_RST_CHECK_FLAG                  0x00000002
21 #define RET_RAM_SOFT_RST_FLAG               0xAA55A501
22 #define RET_RAM_DS_RST_FLAG                 0xAA55A502
23 
24 #define BOOT_TYPE_MAGIC_ID      0x55AA5A00
25 #define PWR_ON_RST              (BOOT_TYPE_MAGIC_ID + 0x00)
26 #define HARDWARE_PIN_RST        (BOOT_TYPE_MAGIC_ID + 0x01)
27 #define SOFTWARE_RST            (BOOT_TYPE_MAGIC_ID + 0x02) // including NVIC_SystemReset and WDG RST
28 #define DEEP_SLEEP_RST          (BOOT_TYPE_MAGIC_ID + 0x03)
29 #define UNKNOWN_RST             (BOOT_TYPE_MAGIC_ID + 0xFF)
30 
31 void duet_cfg_boot_type(void);
32 void duet_set_ds_boot_type(void);
33 uint32_t duet_get_boot_type(void);
34 #endif // _DUET_BOOT_H_