Classes | Macros | Typedefs | Enumerations | Functions | Variables
gr55xx_pwr.h File Reference

GR55XX Platform Power Manager Module API. More...

`#include <stdint.h>`
`#include <stdbool.h>`
`#include <stdio.h>`
`#include "system_gr55xx.h"`
Include dependency graph for gr55xx_pwr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | pwr_mgmt_var_box_t
| power manager setting parameter. 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...

## Enumerations
enum | boot_mode_t { COLD_BOOT = 0, WARM_BOOT }
| power manager boot type. More...
enum | pwr_mgmt_mode_t { PMR_MGMT_ACTIVE_MODE = 0x0, PMR_MGMT_IDLE_MODE, PMR_MGMT_SLEEP_MODE }
| power manager model. More...
enum | pwr_mgmt_dev_state_t { DEVICE_BUSY = 0x0, DEVICE_IDLE }
| power manager device work state. More...
enum | notify_timer_event_t { EVENT_APP_TIMER_START = 0, EVENT_APP_TIMER_STOP }
| power manager app timer work state. More...
enum | { BLE_GATT_COMMON_EVT_MTU_EXCHANGE = BLE_GATT_COMMON_EVT_BASE, BLE_GATT_COMMON_EVT_PRF_REGISTER, BLE_GATT_COMMON_EVT_MAX, ISO_GPIO_MASK_0 = 0x1, ISO_GPIO_MASK_1 = 0x2, ISO_GPIO_MASK_2 = 0x4, ISO_GPIO_MASK_3 = 0x8, ISO_GPIO_MASK_4 = 0x10, ISO_GPIO_MASK_5 = 0x20, ISO_GPIO_MASK_6 = 0x40, ISO_GPIO_MASK_7 = 0x80, AMS_PLAYER_ATTR_ID_NAME, AMS_PLAYER_ATTR_ID_PLAYBACK_INFO, AMS_PLAYER_ATTR_ID_VOLUME, IAS_ALERT_NONE, IAS_ALERT_MILD, IAS_ALERT_HIGH, TRC_PWR_WFE_MODE = 0, TRC_PWR_DSLEEP_MODE, TRC_PWR_ACTIVE_MODE, TRC_PWR_BLE_RET_DSLEEP, TRC_PWR_APP_TIMER_REFUSE, TRC_PWR_APP_TIMER_PASS, TRC_PWR_BLE_TIMER_REFUSE, TRC_PWR_BLE_TIMER_PASS, TRC_PWR_RTC_TIMER_REFUSE, TRC_PWR_RTC_TIMER_PASS, TRC_PWR_RTC1_TIMER_REFUSE, TRC_PWR_RTC1_TIMER_PASS, TRC_PWR_WDT_TIMER_REFUSE, TRC_PWR_WDT_TIMER_PASS }
| PMU Tracking. 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. 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. 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...
pwr_mgmt_mode_t | pwr_mgmt_check_ext_timer (void)
| Get the state of extenal timer. More...
void | pwr_mgmt_schedule (void)
| Sleep Policy Scheduling Function. 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_notify_timer_event (notify_timer_event_t timer_event)
| This function is used to push startup information in app timer. 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...
void | pwr_mgmt_disable_nvic_irq (void)
| Disable nvic irq. More...
void | pwr_mgmt_enable_nvic_irq (void)
| Enable nvic irq. More...
bool | pwr_mgmt_check_pend_irq (void)
| Check nvic irq. 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...
void | pwr_mgmt_register_srpg_before_func (srpg_before_func_t srpg_before_fun)
| Register callback function before srpg sleep. More...

## Variables
pwr_table_t | pwr_table []
| pwr table. More...

## Detailed Description

GR55XX Platform Power Manager Module API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

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 gr55xx_pwr.h.