The GPIO module provides control for up to 32 GPIO pins. Each pin has the following capabilities:

  • Can be configured as an input or an output.
  • GPIO pins can be enabled/disabled.
  • Input values are readable (typically high=1, low=0).
  • In input mode, can generate interrupts on high level, low level, rising edge, falling edge, or both edges.
  • In output mode, can generate 0V or 3.2V on each pin.
  • Output values are writable/readable.
  • On each pin pull-up can be enabled or disabled.
  • GPIO pins can be set as digital input/output signal ports of peripheral functions.

 

RSI_EGPIO_SetPinMux:

Prototype STATIC INLINE void  RSI_EGPIO_SetPinMux(EGPIO_Type *pEGPIO ,uint8_t port , uint8_t pin , uint8_t mux)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

port    : GPIO port number

pin     : GPIO pin number

mux    : pin function value

          possible values for this parameter are the following

          EGPIO_PIN_MUX_MODE0   : Select pin mode 0

          EGPIO_PIN_MUX_MODE1   : Select pin mode 1

          EGPIO_PIN_MUX_MODE2   : Select pin mode 2

          EGPIO_PIN_MUX_MODE3   : Select pin mode 3

          EGPIO_PIN_MUX_MODE4   : Select pin mode 4

          EGPIO_PIN_MUX_MODE5   : Select pin mode 5

          EGPIO_PIN_MUX_MODE6   : Select pin mode 6

          EGPIO_PIN_MUX_MODE7   : Select pin mode 7

          EGPIO_PIN_MUX_MODE8   : Select pin mode 8

          EGPIO_PIN_MUX_MODE9   : Select pin mode 9

          EGPIO_PIN_MUX_MODE10  : Select pin mode 10

          EGPIO_PIN_MUX_MODE11  : Select pin mode 11

          EGPIO_PIN_MUX_MODE12  : Select pin mode 12

          EGPIO_PIN_MUX_MODE13  : Select pin mode 13

          EGPIO_PIN_MUX_MODE14  : Select pin mode 14

          EGPIO_PIN_MUX_MODE15  : Select pin mode 15

Return Value None
Description

This API is used to used to set pin multiplexing

Example Usage

RSI_EGPIO_SetPinMux(EGPIO,0,28,0);   

 

RSI_EGPIO_SetDir:

Prototype

STATIC INLINE void  RSI_EGPIO_SetDir(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin, boolean_t dir)

Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

port    : GPIO port number

pin     : GPIO pin number

dir     : boolean type pin direction

            '0' : Output

            '1' : Input

Return Value None
Description

This API is used to set the EGPIO direction(Direction of the GPIO pin. '1' for INPUT, '0' for OUTPUT)

Example Usage

RSI_EGPIO_SetDir(EGPIO, 0, 28, 0);

RSI_EGPIO_SetDir(EGPIO1, 0, 9, 0);

 

RSI_EGPIO_SetPin:

Prototype STATIC INLINE void  RSI_EGPIO_SetPin(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin , uint8_t val)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

port    : GPIO port number

pin     : GPIO pin number

val     : value to be set for the pin

             '0' : Logic on Pin

             '1' : Logic on Pin

Return Value None
Description

This API is used to set the GPIO pin value

Example Usage

RSI_EGPIO_SetPin(EGPIO, 0, 28, 1);

RSI_EGPIO_SetPin(EGPIO1, 0, 9, 0); for ulp subsystem pins

 

RSI_EGPIO_GetPin:

Prototype STATIC INLINE boolean_t RSI_EGPIO_GetPin(EGPIO_Type *pEGPIO ,uint8_t port,uint8_t pin)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

port    : GPIO port number

pin     : GPIO pin number

Return Value returns Pin status
Description

This API is used get the GPIO pin status.

Example Usage
val = RSI_EGPIO_GetPin((EGPIO, 0, 9);

 

RSI_EGPIO_HostPadsGpioModeEnable:

Prototype STATIC INLINE void  RSI_EGPIO_HostPadsGpioModeEnable(uint8_t u8GpioNum)
Input Arguments u8GpioNum  :  PAD number to be use
Return Value None
Description

This API is used to select the host pad gpios(26 to 30)

Example Usage
RSI_EGPIO_HostPadsGpioModeEnable(28);

 

RSI_NPSSGPIO_SetPinMux:

Prototype STATIC INLINE void RSI_NPSSGPIO_SetPinMux(uint8_t pin, uint8_t mux)
Input Arguments

pin: is NPSS GPIO pin number (0...4)

MUX: is NPSS GPIO  MUX value

Return Value None
Description

This API is used to set the NPSS GPIO pin MUX (mode)

Example Usage
RSI_NPSSGPIO_SetPinMux(NPSS_GPIO_3 , NPSSGPIO_PIN_MUX_MODE0);

 

RSI_NPSSGPIO_SetDir:

Prototype STATIC INLINE void RSI_NPSSGPIO_SetDir(uint8_t pin, boolean_t dir)
Input Arguments

pin: is NPSS GPIO pin number (0...4)

 dir: is direction value (Input / Output

         1- Input Direction

         0- Output Direction

Return Value None
Description

This API is used to set the direction of the NPSS GPIO

Example Usage
RSI_NPSSGPIO_SetDir(NPSS_GPIO_3 ,NPSS_GPIO_DIR_OUTPUT);

 

RSI_NPSSGPIO_SetPin:

Prototype STATIC INLINE void RSI_NPSSGPIO_SetPin(uint8_t pin, boolean_t val)
Input Arguments

pin: is NPSS GPIO pin number (0...4)

val: is NPSS GPIO pin value 0 or 1

Return Value None
Description

This API is used to set the NPSS GPIO pin value

Example Usage
RSI_NPSSGPIO_SetPin(NPSS_GPIO_3, 1);

 

RSI_NPSSGPIO_ClrIntr:

Prototype STATIC INLINE void RSI_NPSSGPIO_ClrIntr(uint8_t npssGpioPinIntr)
Input Arguments npssGpioPinIntr: OR'ed values of the NPSS GPIO interrupts
Return Value None
Description

This API is used to clear NPSS GPIO interrupt

Example Usage
RSI_NPSSGPIO_ClrIntr(NPSS_GPIO_2_INTR);

 

RSI_NPSSGPIO_GetIntrStatus:

Prototype STATIC INLINE uint8_t RSI_NPSSGPIO_GetIntrStatus(void)
Input Arguments None
Return Value returns the GPIO status
Description

This API is used to get the NPSS GPIO interrupt status

Example Usage
intrStatus = RSI_NPSSGPIO_GetIntrStatus();

 

RSI_EGPIO_IntMask:

Prototype STATIC INLINE void  RSI_EGPIO_IntMask(EGPIO_Type *pEGPIO ,uint8_t intCh)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

 intCh   : GPIO pin interrupt channel number (0 to 7)

Return Value None
Description

This API is used to set the pin interrupt mode configuration

Example Usage
RSI_EGPIO_IntMask(EGPIO ,1)

 

RSI_EGPIO_SetIntLowLevelDisable:

Prototype STATIC INLINE void  RSI_EGPIO_SetIntLowLevelDisable(EGPIO_Type *pEGPIO ,uint8_t intCh)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

intCh   : GPIO pin interrupt channel number (0 to 7)

Return Value None
Description

This API is used to set the pin interrupt mode configuration

Example Usage
RSI_EGPIO_SetIntLowLevelDisable(EGPIO,1)

 

RSI_EGPIO_GetIntStat:

Prototype STATIC INLINE uint8_t RSI_EGPIO_GetIntStat(EGPIO_Type *pEGPIO ,uint8_t intCh)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

intCh   : GPIO pin interrupt channel number (0 to 7)

Return Value None
Description

This API is used to get the pin interrupt status register

Example Usage
intrstatus=RSI_EGPIO_GetIntStat(EGPIO,1)

 

RSI_EGPIO_IntClr:

Prototype STATIC INLINE void  RSI_EGPIO_IntClr(EGPIO_Type *pEGPIO ,uint8_t intCh , uint8_t flags)
Input Arguments

pEGPIO  : Pointer to the EGPIO register instance

intCh   : GPIO pin interrupt channel number (0 to 7)

flags   : GPIO pin interrupt channel number (0 to 7)

             EGPIO_PIN_INT_CLR_FALLING

             1-  EGPIO_PIN_INT_CLR_RISING

              0- \ref INTERRUPT_STATUS_CLR

Return Value None
Description

This API is used to get the pin interrupt status register

Example Usage
RSI_EGPIO_IntClr(EGPIO,1,0)