126 lines
4.7 KiB
C
126 lines
4.7 KiB
C
/*================================================================
|
||
Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
|
||
Quectel Wireless Solutions Proprietary and Confidential.
|
||
=================================================================*/
|
||
/**
|
||
******************************************************************************
|
||
* @file ql_gpio.h
|
||
* @author Juson.zhang
|
||
* @version V1.0.0
|
||
* @date 2019/12/17
|
||
* @brief This file contains the lcd functions's declaration
|
||
******************************************************************************
|
||
*/
|
||
#ifndef _QUEC_GPIO_H_
|
||
#define _QUEC_GPIO_H_
|
||
|
||
#include "quec_gpio.h"
|
||
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
|
||
int ql_gpio_init(GPIO_PIN_NUMBER_E gpio_num, PIN_DIRECTION_E pin_dir, PIN_PULL_E pin_pull, PIN_LEVEL_E pin_level);
|
||
int ql_gpio_deinit(GPIO_PIN_NUMBER_E gpio_num);
|
||
int ql_gpio_set_level(GPIO_PIN_NUMBER_E gpio_num, PIN_LEVEL_E pin_level);
|
||
int ql_gpio_get_level(GPIO_PIN_NUMBER_E gpio_num, PIN_LEVEL_E *p_pin_level);
|
||
int ql_gpio_set_drv_level(GPIO_PIN_NUMBER_E gpio_num, QL_PIN_DRIVE_LEVEL_E drive_level);
|
||
int ql_gpio_get_drv_level(GPIO_PIN_NUMBER_E gpio_num, QL_PIN_DRIVE_LEVEL_E *drive_level);
|
||
int ql_gpio_set_direction(GPIO_PIN_NUMBER_E gpio_num, PIN_DIRECTION_E pin_dir);
|
||
int ql_gpio_get_direction(GPIO_PIN_NUMBER_E gpio_num, PIN_DIRECTION_E *p_pin_dir);
|
||
int ql_gpio_set_pull(GPIO_PIN_NUMBER_E gpio_num, PIN_PULL_E pin_pull);
|
||
int ql_gpio_get_pull(GPIO_PIN_NUMBER_E gpio_num, PIN_PULL_E *p_pin_pull);
|
||
|
||
int ql_eint_register(GPIO_PIN_NUMBER_E gpio_num, PIN_EDGE_E pin_edge, PIN_PULL_E pin_pull, void *eint_cb, void *wakeup_eint_cb);
|
||
int ql_eint_unregister(GPIO_PIN_NUMBER_E gpio_num);
|
||
int ql_eint_enable(GPIO_PIN_NUMBER_E gpio_num, PIN_EDGE_E pin_edge);
|
||
int ql_eint_disable(GPIO_PIN_NUMBER_E gpio_num);
|
||
int ql_eint_enable_wakeup(GPIO_PIN_NUMBER_E gpio_num, PIN_EDGE_E pin_edge);;
|
||
int ql_eint_disable_wakeup(GPIO_PIN_NUMBER_E gpio_num);
|
||
int ql_pin_set_func(GPIO_PIN_NUMBER_E gpio_num, unsigned char func_sel);
|
||
|
||
int ql_set_pmic_gpio_level(QL_PIMC_GPIO_E PINx,unsigned char level);
|
||
void ql_active_gpio_hisr(unsigned int gpio_num);
|
||
|
||
/*****************************************************************
|
||
* Function: ql_sfp_eint_register
|
||
*
|
||
* Description: Notice:注册特殊功能引脚唤醒中断
|
||
*
|
||
* Parameters:
|
||
* gpio_num : gpio号
|
||
* wakeup_eint_cb : 唤醒中断回调函数
|
||
|
||
* Return:
|
||
* 0 , the function execution succeed.
|
||
* -1, the parameter error.
|
||
*****************************************************************/
|
||
int ql_sfp_eint_register(GPIO_PIN_NUMBER_E gpio_num, void *wakeup_eint_cb);
|
||
/*****************************************************************
|
||
* Function: ql_sfp_eint_unregister
|
||
*
|
||
* Description: Notice:注销特殊功能引脚唤醒中断
|
||
*
|
||
* Parameters: gpio_num : gpio号
|
||
*
|
||
* Return:
|
||
* 0 , the function execution succeed.
|
||
* -1, the parameter error.
|
||
*****************************************************************/
|
||
int ql_sfp_eint_unregister(GPIO_PIN_NUMBER_E gpio_num);
|
||
|
||
|
||
/*****************************************************************
|
||
* Function: ql_gpio_map_clock
|
||
*
|
||
* Description: Notice
|
||
* Configure GPIO_122 to output 32K clock(32787Hz).
|
||
*
|
||
* Parameters:
|
||
* only: gpio_num = GPIO_PIN_NO_122
|
||
* Return:
|
||
* 0 , the function execution succeed.
|
||
* -1, the parameter error.
|
||
*****************************************************************/
|
||
|
||
int ql_gpio_map_clock(GPIO_PIN_NUMBER_E gpio_num);
|
||
/***********************************************************************
|
||
*
|
||
* Name: ql_set_usim2_io_vol
|
||
*
|
||
* Description: 设置usim相关引脚电压域(GPIO45~47,此接口仅适用于1606平台项目)
|
||
*
|
||
* Parameters: onoff: 开启或关闭电压域:0:关闭;1:开启
|
||
vol: 要设置的电压域,参考枚举QL_USIM2_IO_E
|
||
*
|
||
* Returns: 0 sucess
|
||
-1 fail
|
||
* Notes:
|
||
*
|
||
***********************************************************************/
|
||
|
||
int ql_set_usim2_io_vol(char onoff, QL_USIM2_IO_E vol);
|
||
|
||
/*****************************************************************
|
||
* Function: ql_peripherals_pin_not_config
|
||
*
|
||
* Description: Notice:设置gpio脚不配置复用功能
|
||
*
|
||
* Parameters:
|
||
* gpio_num : gpio号
|
||
|
||
* Return:
|
||
* 0 , the function execution succeed.
|
||
* -1, the parameter error.
|
||
*****************************************************************/
|
||
int ql_peripherals_pin_not_config(GPIO_PIN_NUMBER_E gpio_num);
|
||
|
||
#ifdef __cplusplus
|
||
} /*"C" */
|
||
#endif
|
||
|
||
#endif /* _QUEC_GPIO_H_ */
|
||
|