• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
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  * Description:   HAL Reboot functionality header file
15  *
16  * Create:  2018-10-15
17  */
18 
19 #ifndef HAL_REBOOT_H
20 #define HAL_REBOOT_H
21 
22 #include "stdint.h"
23 #include "stdbool.h"
24 
25 /** @defgroup connectivity_drivers_hal_reboot REBOOT
26   * @ingroup  connectivity_drivers_hal
27   * @{
28   */
29 
30 /**
31  * @brief  Check whether the hard watchdog is restarted during the last restart
32  * @param  cause The reset cause
33  * @return true is yes; false is no
34  */
35 bool hal_reboot_hard_wdg_timeout(uint16_t cause);
36 
37 /** De-initialise the reboot subsystem */
38 void hal_reboot_deinit(void);
39 
40 /** Perform a software reboot (for chip). */
41 void hal_reboot_chip(void);
42 
43 /** Clear reboot history. */
44 void hal_reboot_clear_history(void);
45 
46 /**
47  * @brief  Return reset code showing why this core was rebooted
48  *  @return the reset cause bitfield
49  */
50 uint16_t hal_reboot_get_reset_reason(void);
51 
52 /**
53  * @brief  Set a universal register of the ULP region to a fix value
54  */
55 void hal_reboot_set_ulp_aon_no_poweroff_flag(void);
56 
57 /**
58  * @brief  Get the universal power-on/off flag register of the ULP region
59  *  @return true no poweroff, false is re-poweron
60  */
61 bool hal_reboot_get_ulp_aon_no_poweroff_flag(void);
62 
63 /**
64   * @}
65   */
66 #endif
67