RISCV_GPIO USER GUIDE
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.0 | 04/18/2023 | |
| 1.1 | 03/31/2025 |
1. OVERVIEW¶
General Purpose Input / Output is abbreviated as GPIO.
Under RISC-V, the sstar gpio driver provides a unified operation interface. Users can perform input, output, pull up, pull down, set interrupts, etc. on the required GPIO.
The related driver path:
sc/driver/sysdriver/gpio/drv/src/gpio_test.c sc/driver/sysdriver/gpio/drv/src/mdrv_gpio.c sc/driver/sysdriver/gpio/drv/src/mdrv_gpio_io.c sc/driver/sysdriver/gpio/drv/src/mdrv_sw_iic.c sc/driver/sysdriver/gpio/drv/src/ms_gpioi2c.c sc/driver/sysdriver/gpio/drv/pub/drv_gpio.h sc/driver/sysdriver/gpio/drv/pub/mdrv_gpio.h sc/driver/sysdriver/gpio/drv/pub/mdrv_gpio_io.h sc/driver/sysdriver/gpio/drv/pub/mdrv_sw_iic.h sc/driver/sysdriver/gpio/hal/pcupid/src/irq-gpi.c sc/driver/sysdriver/gpio/hal/pcupid/src/irq-pmsleep.c sc/driver/sysdriver/gpio/hal/pcupid/src/mhal_gpio.c sc/driver/sysdriver/gpio/hal/pcupid/src/mhal_pinmux.c sc/driver/sysdriver/gpio/hal/pcupid/pub/gpio.h sc/driver/sysdriver/gpio/hal/pcupid/pub/padmux.h sc/driver/sysdriver/gpio/hal/pcupid/inc/gpi-irqs.h sc/driver/sysdriver/gpio/hal/pcupid/inc/mhal_gpio.h sc/driver/sysdriver/gpio/hal/pcupid/inc/mhal_pinmux.h sc/driver/sysdriver/gpio/hal/pcupid/inc/pmsleep-irqs.h sc/driver/sysdriver/gpio/hal/pcupid/pub/gpio.h sc/driver/sysdriver/gpio/hal/pcupid/pub/padmux.h
The test code can refer to the file:
sc/driver/sysdriver/gpio/drv/src/gpio_test.c
2. KEYWORD DESCRIPTION¶
2.1. GPIO Index¶
The corresponding GPIO Index of the GPIO pad name on the schematic diagram can be found in Table 1-1. The GPIO Index is used as the input parameter when the software operates GPIO related functions.
For example: The GPIO to be operated is PAD_KEY1, and the corresponding GPIO Index is 12 according to the content in Table 1-1.
Table 1-1: GPIO Index and PAD correspondence table
| Pad Name | GPIO Index | Pad Name | GPIO Index | Pad Name | GPIO Index |
|---|---|---|---|---|---|
| PAD_UART0_TX | 0 | PAD_PWM_OUT00 | 1 | PAD_PWM_OUT01 | 2 |
| PAD_SPI_CK | 3 | PAD_SPI_HLD | 4 | PAD_SPI_CZ | 5 |
| PAD_SPI_WPZ | 6 | PAD_SPI_DI | 7 | PAD_SPI_DO | 8 |
| PAD_GPIOE_00 | 9 | PAD_GPIOE_01 | 10 | PAD_GPIOE_02 | 11 |
| PAD_GPIOE_03 | 12 | PAD_GPIOE_04 | 13 | PAD_GPIOE_05 | 14 |
| PAD_GPIOE_06 | 15 | PAD_GPIOE_07 | 16 | PAD_GPIOE_08 | 17 |
| PAD_GPIOE_09 | 18 | PAD_GPIOE_10 | 19 | PAD_GPIOE_11 | 20 |
| PAD_GPIOE_12 | 21 | PAD_GPIOE_13 | 22 | PAD_GPIOE_14 | 23 |
| PAD_GPIOE_15 | 24 | PAD_GPIOE_16 | 25 | PAD_GPIOE_17 | 26 |
| PAD_GPIOE_18 | 27 | PAD_GPIOE_19 | 28 | PAD_GPIOE_20 | 29 |
| PAD_GPIOE_21 | 30 | PAD_GPIOE_22 | 31 | PAD_GPIOE_23 | 32 |
| PAD_GPIOE_24 | 33 | PAD_GPIOE_25 | 34 | PAD_GPIOE_26 | 35 |
| PAD_GPIOE_27 | 36 | PAD_GPIOE_28 | 37 | PAD_GPIOA_00 | 38 |
| PAD_GPIOA_01 | 39 | PAD_GPIOA_02 | 40 | PAD_GPIOA_03 | 41 |
| PAD_GPIOA_04 | 42 | PAD_GPIOA_05 | 43 | PAD_GPIOA_06 | 44 |
| PAD_GPIOA_07 | 45 | PAD_GPIOA_08 | 46 | PAD_GPIOA_09 | 47 |
| PAD_GPIOA_10 | 48 | PAD_GPIOA_11 | 49 | PAD_EMMC_RST | 50 |
| PAD_EMMC_CLK | 51 | PAD_EMMC_CMD | 52 | PAD_EMMC_DS | 53 |
| PAD_EMMC_D3 | 54 | PAD_EMMC_D4 | 55 | PAD_EMMC_D0 | 56 |
| PAD_EMMC_D5 | 57 | PAD_EMMC_D1 | 58 | PAD_EMMC_D6 | 59 |
| PAD_EMMC_D2 | 60 | PAD_EMMC_D7 | 61 | PAD_GPIOA_12 | 62 |
| PAD_GPIOA_13 | 63 | PAD_GPIOA_14 | 64 | PAD_GPIOA_15 | 65 |
| PAD_GPIOA_16 | 66 | PAD_GPIOA_17 | 67 | PAD_GPIOA_18 | 68 |
| PAD_GPIOA_19 | 69 | PAD_GPIOB_00 | 70 | PAD_GPIOB_01 | 71 |
| PAD_GPIOB_02 | 72 | PAD_GPIOB_03 | 73 | PAD_GPIOB_04 | 74 |
| PAD_GPIOB_05 | 75 | PAD_GPIOB_06 | 76 | PAD_GPIOB_07 | 77 |
| PAD_GPIOB_08 | 78 | PAD_OUTP_RX0_CH0 | 79 | PAD_OUTN_RX0_CH0 | 80 |
| PAD_OUTP_RX0_CH1 | 81 | PAD_OUTN_RX0_CH1 | 82 | PAD_OUTP_RX0_CH2 | 83 |
| PAD_OUTN_RX0_CH2 | 84 | PAD_OUTP_RX0_CH3 | 85 | PAD_OUTN_RX0_CH3 | 86 |
| PAD_GPIOC_00 | 87 | PAD_GPIOC_01 | 88 | PAD_GPIOC_02 | 89 |
| PAD_GPIOC_03 | 90 | PAD_GPIOC_04 | 91 | PAD_GPIOC_05 | 92 |
| PAD_GPIOC_06 | 93 | PAD_GPIOC_07 | 94 | PAD_GPIOC_08 | 95 |
| PAD_OUTP_CH0 | 96 | PAD_OUTN_CH0 | 97 | PAD_OUTP_CH1 | 98 |
| PAD_OUTN_CH1 | 99 | PAD_OUTP_CH2 | 100 | PAD_OUTN_CH2 | 101 |
| PAD_OUTP_CH3 | 102 | PAD_OUTN_CH3 | 103 | PAD_OUTP_CH4 | 104 |
| PAD_OUTN_CH4 | 105 | PAD_SAR_ADC0_00 | 106 | PAD_SAR_ADC0_01 | 107 |
| PAD_SAR_ADC0_02 | 108 | PAD_SAR_ADC0_03 | 109 | PAD_SAR_ADC0_04 | 110 |
| PAD_SAR_ADC0_05 | 111 | PAD_SAR_ADC0_06 | 112 | PAD_SAR_ADC0_07 | 113 |
| PAD_SAR_ADC0_08 | 114 | PAD_SAR_ADC0_09 | 115 | PAD_SAR_ADC0_10 | 116 |
| PAD_SAR_ADC0_11 | 117 | PAD_SAR_ADC0_12 | 118 | PAD_SAR_ADC0_13 | 119 |
| PAD_SAR_ADC0_14 | 120 | PAD_PWM_ADC01 | 121 | PAD_PWM_ADC00 | 122 |
| PAD_GPIOD_01 | 123 | PAD_GPIOD_02 | 124 | PAD_GPIOD_03 | 125 |
| PAD_GPIOD_00 | 126 | PAD_UART0_RX | 127 | PAD_PM_GPIO4 | 128 |
| PAD_PM_GPIO5 | 129 | PAD_PM_PWM1_OUT | 130 | PAD_PM_I2C_SDA | 131 |
| PAD_PM_PWM0_OUT | 132 | PAD_PM_I2C_SCL | 133 | PAD_PM_GPIO1 | 134 |
| PAD_PM_GPIO3 | 135 | PAD_PM_UART1_TX | 136 | PAD_PM_GPIO2 | 137 |
| PAD_PM_GPIO7 | 138 | PAD_PM_GPIO6 | 139 | PAD_PM_UART1_RX | 140 |
| PAD_PM_ADC00_IN | 141 | PAD_PM_GPIO0 | 142 | PAD_PM_SAR_GPIO0 | 143 |
| PAD_PM_SAR_GPIO1 | 144 | PAD_PM_SAR_GPIO2 | 145 | PAD_PM_SAR_GPIO3 | 146 |
| PAD_PM_SAR_GPIO4 | 147 |
3. Function Description¶
- There are 148 GPIO pins with numbers 0-147, all of which can be configured as GPIO Mode
- Support configuring the up and down states of gpio pins
- Support configuring the driver capability of gpio pins
4. Hardware Connection¶
Connect the corresponding gpio pin to the hardware.
5. USAGE INTRODUCTION¶
GPIO mode has a higher priority than padmux, which means that If the GPIO mode which set on a pin that is being functional multiplexed is operated, the communication of the original multiplexed function will be affected.
5.1. Config¶
Sigmastar Drivers-->
[*] SigmaStar GPIO
[*] SigmaStar padmux
5.2. PADMUX SETTING¶
Using gpio, you can configure gpio padmux through sysdecs. Configure MIPI padmux and configure PAD_GPIOA_01 to gpio mode as follows:
sc\driver\sysdriver\sysdesc\hal\pcupid\pub\pcupid-default.sys:
<padmux>
[schematic_u32_u32_u32]
PAD_OUTP_CH0 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_P_CH0,
PAD_OUTN_CH0 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_N_CH0,
PAD_OUTP_CH1 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_P_CH1,
PAD_OUTN_CH1 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_N_CH1,
PAD_OUTP_CH2 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_P_CH2,
PAD_OUTN_CH2 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_N_CH2,
PAD_OUTP_CH3 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_P_CH3,
PAD_OUTN_CH3 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_N_CH3,
PAD_OUTP_CH4 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_P_CH4,
PAD_OUTN_CH4 PINMUX_FOR_MIPI_TX_MODE_1 MDRV_PUSE_TX_MIPI_N_CH4,
PAD_SAR_ADC0_08 PINMUX_FOR_I2C4_MODE_2 MDRV_PUSE_I2C4_SCL,
PAD_SAR_ADC0_09 PINMUX_FOR_I2C4_MODE_2 MDRV_PUSE_I2C4_SDA,
PAD_GPIOA_01 PINMUX_FOR_GPIO_MODE MDRV_PUSE_NA;
[status_u8] 1;
5.3. Sample Code¶
#include <drv_gpio.h>
int main()
{
u8 index = 0;
drv_gpio_pad_set(index);
drv_gpio_pad_oen(index);
//do your operation
drv_gpio_set_high(index);
drv_gpio_set_low(index);
//......
}
6. API Reference¶
When users want to call the gpio API for operation, they only need to refer to the API provided in drv_gpio.h.
| API名称 | Function |
|---|---|
| drv_gpio_init | Disable ALL_PAD_IN setting of gpio. |
| drv_gpio_pad_set | Set a GPIO pin to GPIO mode. |
| drv_gpio_padgroupmode_set | Set pad mode. |
| drv_gpio_pad_val_set | Set pad mode. |
| drv_pad_val_get | Find the pad mode currently set for the corresponding gpio. |
| drv_gpio_pad_val_check | Check whether the gpio pin matches pad_mode. |
| drv_gpio_pad_oen | Set the pin gpio mode output |
| drv_gpio_pad_odn | Set the pin gpio mode input |
| drv_gpio_pad_in_out | Get the input and output status of the specified pin. |
| drv_gpio_pad_read | Get the level of the specified gpio. |
| drv_gpio_pull_high | Set the specified pin to output high level |
| drv_gpio_pull_low | Set the specified pin to output low level |
| drv_gpio_set_high | Set the pin to output high level |
| drv_gpio_set_low | Set the pin to output low level |
| drv_gpio_pull_up | Set pin internal pull-up. |
| drv_gpio_pull_down | Set pin internal pull-down. |
| drv_gpio_pull_off | Cancel pin pull-up and pull-down. |
| drv_gpio_pull_status | Get the status of pin pull-up and pull-down. |
| drv_gpio_drv_set | Get the status of pin pull-up and pull-down. |
| drv_gpio_drv_get | Set pin drive capability. |
| drv_gpio_to_irq | Get the GPIO interrupt number |
| drv_gpio_pad_clr | clear gpio_mode specified goio index |
| drv_gpio_vol_val_set | not support |
| drv_gpio_get_check_count | get gpio check count |
| drv_gpio_get_check_info | get gpio check info |
| drv_gpio_name_to_num | get gpio index from pin name |
| drv_gpio_num_to_name | get pin name form gpio index |
| drv_gpio_padmode_to_val | get padmode value form padmode name |
| drv_gpio_padmode_to_padindex | get padindex by padmode |
| drv_gpio_get_reg_cfg | get register configure information |
6.1 drv_gpio_init¶
-
static inline void drv_gpio_init(void)
Function: Disable ALL_PAD_IN setting of gpio.
Parameter:
Parameter Description void - Return value:
Return value Description void -
6.2 drv_gpio_pad_set¶
-
static inline void drv_gpio_pad_set(U8 gpio_index)
Function: Set a GPIO pin to GPIO mode.
Parameter:
Parameter Description gpio_index GPIO pin number, please refer to gpio.h for pin number Return value:
Return value Description void -
6.3 drv_gpio_padgroupmode_set¶
-
static inline U8 drv_gpio_padgroupmode_set(U32 pad_mode)
Function: Set pad mode. After successful setting, the corresponding gpio mode of all pins will be automatically cleared.
Parameter:
Parameter Description pad_mode The pad mode to be set, please refer to padmux.h for pad mode definition Return value:
Return value Description U8 0: Setting successfully 1: Setting failed
6.4 drv_gpio_pad_val_set¶
-
static inline U8 drv_gpio_pad_val_set(U8 gpio_index, U32 pad_mode)
Function: Set pad mode, but after setting successfully, only clear gpio mode of gpio_index.
Parameter:
Parameter Description gpio_index GPIO pin number, please refer to gpio.h for pin number pad_mode The pad mode to be set, please refer to padmux.h for pad mode definition Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, first check whether gpio_index and pad_mode do not match
6.5 drv_gpio_pad_val_get¶
-
static inline U8 drv_pad_val_get(U8 gpio_index, U32* pad_mode)
Function: Find the pad mode currently set for the corresponding gpio.
Parameter:
Parameter Description gpio_index GPIO pin number, please refer to gpio.h for pin number pad_mode Pointer type, used to store the pad mode currently set for gpio Return value:
Return value Description U8 0: Search successfully, pad mode exists in the parameter pad_mode 1: Search failed, pin error
6.6 drv_gpio_pad_val_check¶
-
static inline U8 drv_gpio_pad_val_check(U8 gpio_index, U32 pad_mode)
Function: Check whether the gpio pin matches pad_mode.
Parameter:
Parameter Description gpio_index The gpio pin number to be found, please refer to gpio.h for pin number pad_mode The pad mode to be found. For the pad mode definition, please refer to padmux.h Return value:
Return value Description U8 0: Match 1: Do not match
6.7 drv_gpio_pad_oen¶
-
static inline U8 drv_gpio_pad_oen(U8 gpio_index)
Function: Set the pin gpio mode output, but will not automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Success 1: The pin is out of range, or the pin is not set to gpio mode
6.8 drv_gpio_pad_odn¶
-
static inline U8 drv_gpio_pad_odn(U8 gpio_index)
Function: Set the pin gpio mode input, but will not automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Success 1: The pin is out of range, or the pin is not set to gpio mode
6.9 drv_gpio_pad_in_out¶
-
static inline U8 drv_gpio_pad_in_out(U8 gpio_index, U8* pad_in_out)
Function: Get the input and output status of the specified pin.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number pad_in_out Pointer type, 0: output; 1: input Return value:
Return value Description U8 0: Success 1: The pin is out of range
6.10 drv_gpio_pad_read¶
-
static inline U8 drv_gpio_pad_read(U8 gpio_index, U8* pad_level)
Function: Get the level of the specified gpio.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number pad_level Pointer type, 0: low level; 1: high level Return value:
Return value Description U8 0: Success 1: The pin is out of range
6.11 drv_gpio_pull_high¶
-
static inline U8 drv_gpio_pull_high(U8 gpio_index)
Function: Set the specified pin to output high level, will not automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed
6.12 drv_gpio_pull_low¶
-
static inline U8 drv_gpio_pull_low(U8 gpio_index)
Function: Set the specified pin to output low level, will not automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed
6.13 drv_gpio_set_high¶
-
static inline U8 drv_gpio_set_high(U8 gpio_index)
Function: Set the pin to output high level, will automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.14 drv_gpio_set_low¶
-
static inline U8 drv_gpio_set_low(U8 gpio_index)
Function: Set the pin to output low level, will automatically set gpio mode enable.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.15 drv_gpio_pull_up¶
-
static inline U8 drv_gpio_pull_up(U8 gpio_index)
Function: Set pin internal pull-up.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.16 drv_gpio_pull_down¶
-
static inline U8 drv_gpio_pull_down(U8 gpio_index)
Function: Set pin internal pull-down.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.17 drv_gpio_pull_off¶
-
static inline U8 drv_gpio_pull_off(U8 gpio_index)
Function: Cancel pin pull-up and pull-down.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.18 drv_gpio_pull_status¶
-
static inline U8 drv_gpio_pull_status(U8 gpio_index, U8* pull_status)
Function: Get the status of pin pull-up and pull-down.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number pull_status Pointer type, store pull-up and pull-down status; 0: pull-down; 1: pull-up Return value:
Return value Description U8 0: Get successfully 1: Get failed, the pin is out of range
6.19 drv_gpio_drv_set¶
-
static inline U8 drv_gpio_drv_set(U8 gpio_index, U8 level)
Function: Set pin drive capability.
Parameter:
Parameter Description gpio_index GPIO pin number to be set, please refer to gpio.h for pin number level Set drive capability level, see HW Checklist for details Return value:
Return value Description U8 0: Setting successfully 1: Setting failed, the pin is out of range
6.20 drv_gpio_drv_get¶
-
static inline U8 drv_gpio_drv_get(U8 gpio_index, U8* level)
Function: Get the current drive capability of the pin.
Parameter:
Parameter Description gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number level The drive capability level of the current pin Return value:
Return value Description U8 0: Get successfully 1: Get failed, the pin is out of range
6.21 drv_gpio_to_irq¶
-
static inline int drv_gpio_to_irq(U8 gpio_index)
Function: Get the GPIO interrupt number
Parameter:
Parameter Description gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number Return value:
Return value Description U8 -1: Setting failed >=0: The interrupt number corresponding to the pin
6.22. drv_gpio_pad_clr¶
-
static inline void drv_gpio_pad_clr(U8 gpio_index)
Function: clear gpio_mode specified goio index
Parameter:
Parameter Description gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number Return value:
Return value Description void -
6.23. drv_gpio_vol_val_set¶
Not supported
6.24. drv_gpio_get_check_count¶
-
static inline u8 drv_gpio_get_check_count(void)
Function: get gpio check count
Parameter:
Parameter Description void - Return value:
Return value Description void -
6.25. drv_gpio_get_check_info¶
-
static inline void* drv_gpio_get_check_info(u8 index)
Function: get gpio check info
Parameter:
Parameter Description index GPIO pin number to be obtained, please refer to gpio.h for pin number Return value:
Return value Description void* check info
6.26. drv_gpio_name_to_num¶
-
static inline u8 drv_gpio_name_to_num(u8* p_name, u8* gpio_index)
Function: get gpio index from pin name
Parameter:
Parameter Description p_name GPIO pin number to be obtained, please refer to gpio.h for pin number gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number Return value:
Return value Description u8 0: Get successfully 1: Get failed, the pin is out of range
6.27. drv_gpio_num_to_name¶
-
static inline u8 drv_gpio_num_to_name(u8 gpio_index, const u8** p_name)
Function: get pin name form gpio index
Parameter:
Parameter Description gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number p_name storage pin name Return value:
Return value Description u8 0: Get successfully 1: Get failed, the pin is out of range
6.28. drv_gpio_padmode_to_val¶
-
static inline u8 drv_gpio_padmode_to_val(u8* p_mode, u32* mode_to_val)
Function: get padmode value form padmode name
Parameter:
Parameter Description p_mdoe GPIO padmux number to be obtained, please refer to padmux.h for pin number mode_to_val GPIO pin number to be obtained, please refer to gpio.h for pin number Return value:
Return value Description void 0: Get successfully 1: Get failed, the pin is out of range
6.29. drv_gpio_padmode_to_padindex¶
-
static inline u32* drv_gpio_padmode_to_padindex(u32 mode)
Function: get padindex by padmode
Parameter:
Parameter Description mode GPIO padmux number to be obtained, please refer to padmux.h for pin number Return value:
Return value Description u32* all padindex for this padmode
6.30. drv_gpio_get_reg_cfg¶
-
static inline u8 drv_gpio_get_reg_cfg(u8 gpio_index, void* reg_cfg)
Function: Get register configure information
Parameter:
Parameter Description gpio_index GPIO pin number to be obtained, please refer to gpio.h for pin number reg_cfg storage reg_cfg info Return value:
Return value Description u8 0: Get successfully 1: Get failed, the pin is out of range
7. FAQ¶
Please refer to GPIO FAQ