Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Function

This section provides Fixed APIs(defined as Common Interface) to fully control the MediaTek EINT HW. More...

Overview

This section provides Fixed APIs(defined as Common Interface) to fully control the MediaTek EINT HW.

Functions

int mtk_mhal_eint_enable_debounce (eint_number eint_num, void __iomem *eint_base)
 This function is used to enable EINT debounce. More...
 
int mtk_mhal_eint_disable_debounce (eint_number eint_num, void __iomem *eint_base)
 This function is used to disable EINT debounce. More...
 
int mtk_mhal_eint_set_polarity (eint_number eint_num, u32 pol, void __iomem *eint_base)
 This function is used to set EINT polarity. More...
 
int mtk_mhal_eint_set_dual (eint_number eint_num, u32 dual, void __iomem *eint_base)
 This function is used to set EINT dual-edge. More...
 
int mtk_mhal_eint_set_debounce (eint_number eint_num, u32 debounce_time, void __iomem *eint_base)
 This function is used to set EINT debounce time. More...
 

Function Documentation

int mtk_mhal_eint_enable_debounce ( eint_number  eint_num,
void __iomem *  eint_base 
)

This function is used to enable EINT debounce.

Usage: OS-HAL driver should call it in EINT register function to enable debounce.

Parameters
[in]eint_num: eint_num is the EINT number, the value is HAL_EINT_NUMBER_0 ~ HAL_EINT_NUMBER_MAX-1.
[in]eint_base: EINT base address used to operate hardware register.
Returns
Return "0" if enable debounce success.
Return -#EFAULT if eint_base is NULL.
Return -EINVAL if eint_num is invalid argument.
int mtk_mhal_eint_disable_debounce ( eint_number  eint_num,
void __iomem *  eint_base 
)

This function is used to disable EINT debounce.

Usage: OS-HAL driver should call it in EINT unregister function to disable debounce.

Parameters
[in]eint_num: eint_num is the EINT number, the value is HAL_EINT_NUMBER_0 ~ HAL_EINT_NUMBER_MAX-1.
[in]eint_base: EINT base address used to operate hardware register.
Returns
Return "0" if disable debounce success.
Return -#EFAULT if eint_base is NULL.
Return -EINVAL if eint_num is invalid argument.
int mtk_mhal_eint_set_polarity ( eint_number  eint_num,
u32  pol,
void __iomem *  eint_base 
)

This function is used to set EINT polarity.

Usage: OS-HAL driver should call it in EINT register or set trigger type function

Parameters
[in]eint_num: eint_num is the EINT number, the value is HAL_EINT_NUMBER_0 ~ HAL_EINT_NUMBER_MAX-1.
[in]eint_base: EINT base address used to operate hardware register.
[in]pol: Polarity type
Returns
Return "0" if set polarity success.
Return -#EFAULT if eint_base is NULL.
Return -EINVAL if eint_num or pol is invalid argument.
int mtk_mhal_eint_set_dual ( eint_number  eint_num,
u32  dual,
void __iomem *  eint_base 
)

This function is used to set EINT dual-edge.

Usage: OS-HAL driver should call it in EINT register function to set EINT dual-edge.

Parameters
[in]eint_num: eint_num is the EINT number, the value is HAL_EINT_NUMBER_0 ~ HAL_EINT_NUMBER_MAX-1.
[in]eint_base: EINT base address used to operate hardware register.
[in]dual: Dual =1 :dual-edge detect function enable. Dual =0 :dual-edge detect function disable.
Returns
Return "0" if set dual success.
Return -#EFAULT if eint_base is NULL.
Return -EINVAL if eint_num or dual is invalid argument.
int mtk_mhal_eint_set_debounce ( eint_number  eint_num,
u32  debounce_time,
void __iomem *  eint_base 
)

This function is used to set EINT debounce time.

Usage: OS-HAL driver should call it in EINT register function to set EINT debounce time

Parameters
[in]eint_num: eint_num is the EINT number, the value is HAL_EINT_NUMBER_0 ~ HAL_EINT_NUMBER_MAX-1.
[in]eint_base: EINT base address used to operate hardware register.
[in]debounce_time: EINT trigger's debounce time(unit: ms). Value range is 1, 2, 4, 8, 16, 32, 64, 128.
Returns
Return "0" if set debounce success.
Return -#EFAULT if eint_base is NULL.
Return -EINVAL if eint_num is invalid argument.