Azure Sphere MT3620 M4 API Reference Manual
|
This section provides Fixed APIs(defined as Common Interface) to fully control the MediaTek GPIO HW. More...
This section provides Fixed APIs(defined as Common Interface) to fully control the MediaTek GPIO HW.
Functions | |
int | mtk_mhal_gpio_get_input (struct mtk_pinctrl_controller *pctl, u32 pin, mhal_gpio_data *pvalue) |
This function is used to get input data of the target GPIO. More... | |
int | mtk_mhal_gpio_set_output (struct mtk_pinctrl_controller *pctl, u32 pin, u32 out_val) |
This function is used to set output data of the target GPIO. More... | |
int | mtk_mhal_gpio_get_output (struct mtk_pinctrl_controller *pctl, u32 pin, mhal_gpio_data *pvalue) |
This function is used to get output data of the target GPIO. More... | |
int | mtk_mhal_gpio_set_direction (struct mtk_pinctrl_controller *pctl, u32 pin, u32 dir) |
This function is used to set the direction of the target GPIO. More... | |
int | mtk_mhal_gpio_get_direction (struct mtk_pinctrl_controller *pctl, u32 pin, mhal_gpio_direction *pvalue) |
This function is used to get the direction of the target GPIO. More... | |
int | mtk_mhal_gpio_set_pullen_pullsel (struct mtk_pinctrl_controller *pctl, u32 pin, bool enable, bool isup) |
This function is used to set the target GPIO to pull-up/pull-down state. More... | |
int | mtk_mhal_gpio_pmx_set_mode (struct mtk_pinctrl_controller *pctl, u32 pin, u32 mode) |
This function is used to configure pinmux of the target GPIO. More... | |
int | mtk_mhal_gpio_pmx_get_mode (struct mtk_pinctrl_controller *pctl, u32 pin, u32 *pvalue) |
This function is used to get the configuration pinmux of the target GPIO. More... | |
int mtk_mhal_gpio_get_input | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
mhal_gpio_data * | pvalue | ||
) |
This function is used to get input data of the target GPIO.
Usage: OS-HAL driver should call it in GPIO get-input value function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to operate.(0~93) |
[out] | *pvalue | : 0 means input low, 1 means input high. |
int mtk_mhal_gpio_set_output | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
u32 | out_val | ||
) |
This function is used to set output data of the target GPIO.
Usage: OS-HAL driver should call it in GPIO set-output value function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to operate.(0~93) |
[in] | out_val | : Represents output data of the target GPIO. 0, output low. 1, output high. |
int mtk_mhal_gpio_get_output | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
mhal_gpio_data * | pvalue | ||
) |
This function is used to get output data of the target GPIO.
Usage: OS-HAL driver should call it in GPIO get-output value function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to operate.(0~93) |
[out] | *pvalue | : 0 means output low, 1 means output high. |
int mtk_mhal_gpio_set_direction | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
u32 | dir | ||
) |
This function is used to set the direction of the target GPIO.
Usage: OS-HAL driver should call it in GPIO set-direction function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to set.(0~93) |
[in] | dir | : Specified the direction of target GPIO, 0, input. 1, output. |
int mtk_mhal_gpio_get_direction | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
mhal_gpio_direction * | pvalue | ||
) |
This function is used to get the direction of the target GPIO.
Usage: OS-HAL driver should call it in GPIO get-direction function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to operate.(0~93) |
[out] | *pvalue | : 0 means input, 1 means output. |
int mtk_mhal_gpio_set_pullen_pullsel | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
bool | enable, | ||
bool | isup | ||
) |
This function is used to set the target GPIO to pull-up/pull-down state.
Usage: OS-HAL driver should call it when setting GPIO pull-up/pull-down state.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to set.(0~93) |
[in] | enable | : Specifies the pin pullen enable or disable. True means pullen enable; false means pullen disable. |
[in] | isup | : Specifies the pin pullsel up or down. True means pullsel up; false means pullsel down. |
int mtk_mhal_gpio_pmx_set_mode | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
u32 | mode | ||
) |
This function is used to configure pinmux of the target GPIO.
Usage: OS-HAL driver should call it in GPIO pinmux function to set multifunction mode. Pinmux represents Pin Multiplexor which connects the pin and the onboard peripherals, so the pin will operate in a specific mode once this pin is programmed to a peripheral's function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies the pin number to configure.(0~93) |
[in] | mode | : Specifies the function for the pin.(0~7) |
int mtk_mhal_gpio_pmx_get_mode | ( | struct mtk_pinctrl_controller * | pctl, |
u32 | pin, | ||
u32 * | pvalue | ||
) |
This function is used to get the configuration pinmux of the target GPIO.
Usage: OS-HAL driver should call it in GPIO pinmux function to get multifunction mode. Pinmux represents Pin Multiplexor which connects the pin and the onboard peripherals, so the pin will operate in a specific mode once this pin is programmed to a peripheral's function.
[in] | pctl | : GPIO Pinctrl controller used with the device. |
[in] | pin | : Specifies pin number to configure.(0~93) |
[out] | *pvalue | : Specifies multifunction value.(0~7) |