GR533X Platform Power Manager Module API. More...
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "system_gr533x.h"
Go to the source code of this file.
Classes | |
struct | pwr_mgmt_var_box_t |
power manager setting parameter. Use pwr_mgmt_var_set to transfer the parameters in the structure to PMU, and then the pwr_mgmt_mode_set function will use the new parameters for power management. Note that this is an advanced API, the wrong setting of parameters may lead to abnormal power management, so please use it carefully. More... | |
struct | pwr_table_t |
parameter configuration table. More... | |
Macros | |
#define | PMR_MGMT_SUCCESS 0x0 |
PMU error code. More... | |
#define | PMR_MGMT_FAIL 0xFF |
#define | PWR_MGMT_BB_CHECK_FAIL 0xFE |
#define | PWR_MGMT_MODE_CHECK_FAIL 0xFD |
Typedefs | |
typedef void(* | trace_func_t) (uint8_t) |
Trace function type. More... | |
typedef void(* | periph_func_t) (void) |
Peripheral function type. More... | |
typedef void(* | pwr_before_sleep_func_t) (void) |
Before sleep function type. More... | |
typedef pwr_mgmt_dev_state_t(* | pwr_dev_check_func_t) (void) |
Device check function type. More... | |
typedef void(* | mem_check_proc_t) (void) |
mem check process type. More... | |
typedef uint8_t(* | srpg_before_func_t) (void) |
SRPG before function type. More... | |
Functions | |
pwr_mgmt_mode_t | pwr_mgmt_shutdown (void) |
This function allows ARM to enter deep sleep mode, but users should not use this function directly. Note that this function is only available in environments where non-RTOS is used, and that users can only execute it while in main.c. More... | |
boot_mode_t | pwr_mgmt_get_wakeup_flag (void) |
Get the current boot mode. More... | |
void | pwr_mgmt_set_wakeup_flag (boot_mode_t boot_mode) |
Mark the mode of next boot, cold boot or warm boot. More... | |
void | pwr_mgmt_mode_set (pwr_mgmt_mode_t pm_mode) |
Set the specified sleep mode. When the setting is completed, the system will automatically enter the specified sleep mode through the strategy. More... | |
pwr_mgmt_mode_t | pwr_mgmt_mode_get (void) |
Get the specified sleep mode. More... | |
pwr_mgmt_mode_t | pwr_mgmt_baseband_state_get (void) |
Get the power state of baseband. More... | |
void | pwr_mgmt_schedule (void) |
Sleep Policy Scheduling Function. Note that this function is only available in environments where non-RTOS is used, and that users can only execute it while in main.c. More... | |
void | pwr_mgmt_ble_wakeup (void) |
Wake the BLE core via an external request. More... | |
void | pwr_mgmt_check_ble_event (void) |
Check whether there are ble events in the queue, and if so, handle them immediately. More... | |
void | pwr_mgmt_wfe_sleep (void) |
Execution of this function allows ARM to enter the WFE state and exit the WFE state when an event or interrupt occurs. More... | |
void | pwr_mgmt_ultra_sleep (uint32_t time_ms) |
Execution of this function allows ARM to enter the ultra sleep state and wakeup the chip when an event occurs. More... | |
void | pwr_mgmt_init (pwr_table_t *p_pwr_table, mcu_clock_type_t sys_clk) |
PMU Initialization Function. More... | |
void | pwr_mgmt_dev_init (periph_func_t p_periph_init) |
Peripheral Controller Initialization Register interface. More... | |
void | pwr_mgmt_dev_resume (void) |
Device config resume interface. More... | |
pwr_mgmt_dev_state_t | pwr_mgmt_dev_suspend (void) |
Device config suspend interface. More... | |
void | pwr_mgmt_mem_ctl_set (uint32_t mem_sleep_state, uint32_t mem_work_state) |
Mem state control under deep sleep & work state. More... | |
void | pwr_mgmt_set_callback (pwr_dev_check_func_t dev_check_fun, pwr_before_sleep_func_t before_sleep_fun) |
Set PMU callback function. More... | |
void | pwr_mgmt_save_context (void) |
Save context function. More... | |
void | pwr_mgmt_load_context (void) |
Load context function. More... | |
uint8_t | pwr_mgmt_sleep (void) |
shutdown power in rtos mode More... | |
void | pwr_mgmt_register_trace_func (trace_func_t status_trace_func, trace_func_t sched_trace_func) |
Trace function register. More... | |
Variables | |
pwr_table_t | pwr_table [] |
pwr table. More... | |
GR533X Platform Power Manager Module API.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file gr533x_pwr.h.