gr55xx_hal_pwr_mgmt.h File Reference

This file contains all the functions prototypes for the HAL module driver. More...

#include "gr55xx_hal_def.h"
#include <stdio.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define ALL_DEVICES_SLEEP   (0xFFFFFFFFU)
 
#define ALL_DEVICES_BACKUP   (0x00000000U)
 

Typedefs

typedef hal_status_t(* p_device_suspend_func) (void *p_dev_handle)
 Peripheral suspend callback definition. More...
 
typedef hal_status_t(* p_device_resume_func) (void *p_dev_handle)
 Peripheral resume callback definition. More...
 

Enumerations

enum  periph_device_number_t {
  PERIPH_DEVICE_NUM_DMA0 = 0,
  PERIPH_DEVICE_NUM_DMA1,
  PERIPH_DEVICE_NUM_UNUSED0,
  PERIPH_DEVICE_NUM_PKC,
  PERIPH_DEVICE_NUM_QSPI0,
  PERIPH_DEVICE_NUM_QSPI1,
  PERIPH_DEVICE_NUM_QSPI2,
  PERIPH_DEVICE_NUM_SPIM,
  PERIPH_DEVICE_NUM_SPIS,
  PERIPH_DEVICE_NUM_DSPI,
  PERIPH_DEVICE_NUM_I2C0,
  PERIPH_DEVICE_NUM_I2C1,
  PERIPH_DEVICE_NUM_I2C2,
  PERIPH_DEVICE_NUM_I2C3,
  PERIPH_DEVICE_NUM_UNUSED1,
  PERIPH_DEVICE_NUM_UNUSED2,
  PERIPH_DEVICE_NUM_UART0,
  PERIPH_DEVICE_NUM_UART1,
  PERIPH_DEVICE_NUM_UART2,
  PERIPH_DEVICE_NUM_UART3,
  PERIPH_DEVICE_NUM_UNUSED3,
  PERIPH_DEVICE_NUM_UNUSED4,
  PERIPH_DEVICE_NUM_I2S_M,
  PERIPH_DEVICE_NUM_I2S_S,
  PERIPH_DEVICE_NUM_PDM,
  PERIPH_DEVICE_NUM_HMAC,
  PERIPH_DEVICE_NUM_RNG,
  PERIPH_DEVICE_NUM_AES,
  PERIPH_DEVICE_NUM_PWM0,
  PERIPH_DEVICE_NUM_PWM1,
  PERIPH_DEVICE_NUM_SNSADC,
  PERIPH_DEVICE_NUM_UNUSED5,
  MAX_PERIPH_DEVICE_NUM
}
 Peripheral Device ID definition NOTE:The order of enumeration is the order of recovery. More...
 
enum  extra_device_number_t {
  EXTRA_DEVICE_NUM_CLK_CALIB = 0,
  EXTRA_DEVICE_NUM_UNUSED0,
  EXTRA_DEVICE_NUM_UNUSED1,
  EXTRA_DEVICE_NUM_UNUSED2,
  MAX_EXTRA_DEVICE_NUM
}
 Extra Device ID definition. More...
 
enum  periph_state_t {
  IDLE = 0,
  ACTIVE
}
 Peripheral Device State definition. More...
 

Functions

void hal_pwr_mgmt_device_suspend_register (periph_device_number_t dev_num, p_device_suspend_func my_device_suspend_function)
 Set peripheral suspend function. More...
 
void hal_pwr_mgmt_device_suspend_release (periph_device_number_t dev_num)
 Release peripheral suspend function. More...
 
void hal_pwr_mgmt_device_resume_register (periph_device_number_t dev_num, p_device_resume_func my_device_resume_function)
 Set peripheral resume function. More...
 
void hal_pwr_mgmt_device_resume_release (periph_device_number_t dev_num)
 Release peripheral resume function. More...
 
void hal_pwr_mgmt_save_device_handle (periph_device_number_t dev_num, void *p_dev)
 Store the specified peripheral handle. More...
 
void hal_pwr_mgmt_clear_device_handle (periph_device_number_t dev_num)
 Clear the specified peripheral handle. More...
 
void hal_pwr_mgmt_set_device_state (periph_device_number_t dev_num, periph_state_t state)
 Store the specified peripheral state. More...
 
void hal_pwr_mgmt_set_device_renew_flag (periph_device_number_t dev_num)
 Store the specified peripheral backup flag. More...
 
void hal_pwr_mgmt_clear_device_sleep_flag (periph_device_number_t dev_num)
 Store the specified peripheral sleep flag. More...
 
void hal_pwr_mgmt_extra_device_suspend_register (extra_device_number_t dev_num, p_device_suspend_func my_device_suspend_function, void *p_dev_handle)
 Set extra device suspend function. More...
 
void hal_pwr_mgmt_extra_device_resume_register (extra_device_number_t dev_num, p_device_resume_func my_device_resume_function, void *p_dev_handle)
 Set extra resume function. More...
 
void hal_pwr_mgmt_set_extra_device_state (extra_device_number_t dev_num, periph_state_t state)
 set the specified extra device state More...
 
void hal_pwr_mgmt_set_extra_device_renew_flag (extra_device_number_t dev_num)
 set the specified extra device updata flag More...
 

Variables

volatile uint32_t g_devices_state
 
volatile uint32_t g_devices_renew
 
volatile uint32_t g_devices_sleep
 
p_device_suspend_func devices_suspend_cb [MAX_PERIPH_DEVICE_NUM]
 
p_device_resume_func devices_resume_cb [MAX_PERIPH_DEVICE_NUM]
 
void * devices_handle [MAX_PERIPH_DEVICE_NUM]
 
volatile uint32_t g_extra_devices_state
 
volatile uint32_t g_extra_devices_renew
 
p_device_suspend_func extra_devices_suspend_cb [MAX_EXTRA_DEVICE_NUM]
 
p_device_resume_func extra_devices_resume_cb [MAX_EXTRA_DEVICE_NUM]
 
void * extra_devices_handle [MAX_EXTRA_DEVICE_NUM]
 

Detailed Description

This file contains all the functions prototypes for the HAL module driver.

Author
BLE Driver Team
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_hal_pwr_mgmt.h.