General-Purpose Input-Output#
Introduction#
The GPIO (General Purpose Input/Output) driver provides a comprehensive set of functions to configure and control the GPIO pins. The GPIO pins can be used for various purposes such as reading digital signals, controlling external devices, generating interrupts, etc. The GPIO driver simplifies the process of interacting with GPIO pins, making it easier to integrate GPIO functionality into the application.
Configuration#
To configure the GPIO driver, identify the GPIO instance and pins you want to configure. Set the direction of each pin as either input or output. Then, if needed, set the drive strength for the pins to ensure they can handle the required current. Set the GPIO mux and pad selection if needed. Configure any interrupt settings, such as trigger type (level or edge) and interrupt polarity (high or low). If interrupts are used, register the appropriate callback functions to handle them.
Additionally, make sure to enable the GPIO clock for the selected instance to ensure the GPIO peripheral operates correctly.
These steps are necessary for the GPIO pins to function correctly and trigger interrupts as required by the application. The respective APIs for the same functionality will change depending on the GPIO in use i.e. Ultra Ultra Low Power (UULP), Ultra Low Power (ULP), or High Power (HP).
Usage#
For UULP GPIOs, common functions include:
To set the pin MUX mode, sl_si91x_gpio_driver_set_uulp_npss_pin_mux can be used. For enabling or disabling the input buffer, use sl_si91x_gpio_driver_select_uulp_npss_receiver. Additionally, set pin direction with sl_si91x_gpio_driver_set_uulp_npss_direction. Also, use sl_si91x_gpio_driver_set_uulp_npss_pin_value to set the pin value.
For ULP GPIOs, common functions include:
With sl_si91x_gpio_driver_select_ulp_pad_slew_rate, set the slew rate for ULP GPIO pins. With sl_si91x_gpio_driver_select_ulp_pad_driver_strength choose the drive strength. To manage the receiver, sl_si91x_gpio_driver_enable_ulp_pad_receiver and for disabling and enabling the receiver sl_si91x_gpio_driver_enable_ulp_pad_receiver can be used, respectively. For configuring interrupts, sl_si91x_gpio_driver_configure_ulp_pin_interrupt can be used to set up pin interrupts with defined trigger types (level/edge).
For HP GPIOs, common functions include:
To configure a GPIO pin, first, use sl_si91x_gpio_driver_set_pin_direction to set its direction. To enable the receiver for reading the pin status, use sl_si91x_gpio_driver_enable_pad_receiver. For selecting the pad, use sl_si91x_gpio_driver_enable_pad_selection. To configure group interrupts for the MCU HP instance, use sl_si91x_gpio_driver_configure_group_interrupt. Make sure to enable the clock for HP or ULP instances, using sl_si91x_gpio_driver_enable_clock.
Other APIs can be referred to in the API Documentation.
Modules#
Typedefs#
GPIO interrupt callback function pointer.
Functions#
Clear one or more pending GPIO interrupts.
Configure the GPIO pin interrupt.
Set the pin mode for a GPIO pin.
Get the pin mode (alternate function) of a GPIO for either HP instance (or) ULP instance as per the port number.
Unregister GPIO driver.
Set a single pin in GPIO configuration register to 1.
Clear a single pin in the GPIO configuration register to 0.
Toggle a single pin in GPIO port register.
Read the pin value for a single pin in a GPIO port.
Set bits GPIO data out register to 1.
Set bits in configuration register for a port to 0.
Get the current setting for a GPIO configuration register.
Get the current setting for a pin in a GPIO configuration register.
Set the GPIO port configuration register.
Read the port value for GPIO.
Get the pending GPIO interrupts.
Get the enabled GPIO interrupts.
Get the enabled and pending GPIO interrupt flags.
Set the direction for a GPIO pin.
Get the direction of a selected GPIO pin.
Enable the receiver enable bit in the PAD configuration register for reading the GPIO pin status.
Disable the receiver enable bit in the PAD configuration register.
Enable the pad selection bit in the PAD selection register.
Select the drive strength for an HP instance GPIO pin.
Select the Driver disabled state control for an HP instance GPIO pin.
Select AND/OR type of the group interrupt.
Clear the selected group interrupt status value.
Get the current status of the selected group interrupt.
Configure the group interrupt as a wake up source across sleep wakeups.
Configure the MCU HP instance group interrupts with trigger type (level/edge), polarity (high/low), interrupt type (and/or) and register the callback function for interrupts.
Get the configured polarity of group interrupt.
Configure the polarity to a selected group interrupt which decides the active value of the pin to be considered for group interrupt generation.
Get the configured level/edge event for the selected group interrupt.
Set the level/edge event for the selected group interrupt.
Unmask the selected group interrupt to enable interrupt clearing upon generation.
Mask the selected group interrupt.
Disable the clock for either the HP or ULP instance of the GPIO Peripheral.
Enable the clock for either the HP or ULP instance of the GPIO peripheral.
Enable the selected group interrupts for either the HP or ULP instance of the GPIO peripheral.
Disable the selected group interrupts for either the HP or ULP instance of the GPIO peripheral.
Select the slew rate for the ULP instance of the GPIO peripheral.
Select the drive strength for the ULP instance of the GPIO peripheral.
Select the driver-disabled state control for the ULP instance of the GPIO peripheral.
Disable the receiver enable bit for the ULP instance of the GPIO peripheral.
Enable the receiver enable bit for the ULP instance of the GPIO peripheral.
Configure the MCU ULP instance pin interrupts with the trigger type (level/edge) and register the callback function for interrupts.
Set the NPSS GPIO pin MUX (mode) to the selected mode.
Enable/disable the NPSS GPIO Input Buffer.
Set the direction for the selected NPSS GPIO.
Get the direction of the selected NPSS GPIO.
Control(set or clear) the NPSS GPIO pin value.
Read the status of the selected NPSS GPIO pin value.
Select the NPSS GPIO polarity for generating the interrupt.
Set the NPSS GPIO interrupt as a wake up source across sleep wakeups.
Clear the UULP NPSS GPIO Interrupt as a wake up source.
Mask the selected NPSS GPIO interrupt.
Unmask the selected NPSS GPIO interrupt.
Clear the selected NPSS GPIO interrupt.
Get the current status of all the NPSS GPIO interrupt status.
Get the selected ULP instance GPIO pin interrupt status.
Clear the selected ULP instance GPIO pin interrupts.
Clear the selected ULP instance group interrupt.
Configure the UULP GPIO pin interrupt with interrupt type level or edge and registers callback function for interrupts.
Configure the MCU ULP instance group interrupts with trigger type (level/edge), polarity (high/low), interrupt type (and/or) and register the callback function for interrupts.
Toggle the selected UULP pin status.
Configure the UULP GPIO pin mode, receiver enable, direction and polarity settings.
Get the release, SQA, and development version numbers of the GPIO peripheral.
Macros#
Typedef Documentation#
sl_gpio_irq_callback_t#
typedef void(* sl_gpio_irq_callback_t) (uint32_t flag) )(uint32_t flag)
GPIO interrupt callback function pointer.
80
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
Function Documentation#
sl_gpio_driver_clear_interrupts#
STATIC __INLINE sl_status_t sl_gpio_driver_clear_interrupts (uint32_t flags)
Clear one or more pending GPIO interrupts.
[in] | flags | - Bitwise logic OR of GPIO interrupt sources to clear. |
Pre-conditions:
Returns
returns status 0
SL_STATUS_OK (0X000) - Success
100
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_configure_interrupt#
sl_status_t sl_gpio_driver_configure_interrupt (sl_gpio_t * gpio, uint32_t int_no, sl_gpio_interrupt_flag_t flags, sl_gpio_irq_callback_t gpio_callback, uint32_t * avl_intr_no)
Configure the GPIO pin interrupt.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
[in] | int_no | - Specifies the interrupt number to trigger (0 to 7). |
[in] | flags | - Interrupt configuration flags sl_gpio_interrupt_flag_t |
[in] | gpio_callback | - IRQ callback function pointer sl_gpio_irq_callback_t |
[out] | avl_intr_no | - Pointer to the available interrupt number. SL_GPIO_INTERRUPT_UNAVAILABLE (0xFF) no available interrupt |
Pre-conditions:
Returns
The following values are returned:
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
SL_STATUS_BUSY (0x0004) - Interrupt is busy and cannot carry out the requested operation
126
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_pin_mode#
sl_status_t sl_gpio_driver_set_pin_mode (sl_gpio_t * gpio, sl_gpio_mode_t mode, uint32_t output_value)
Set the pin mode for a GPIO pin.
[in] | gpio | - Pointer to the structure of type sl_gpio_t. |
[in] | mode | - The desired pin mode. |
[in] | output_value | - A value to set for the pin in the GPIO register. The GPIO setting is important for some input mode configurations. |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for corresponding GPIO instance.
Returns
The following values are returned:
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
149
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_pin_mode#
sl_status_t sl_gpio_driver_get_pin_mode (sl_gpio_t * gpio, sl_gpio_mode_t * mode)
Get the pin mode (alternate function) of a GPIO for either HP instance (or) ULP instance as per the port number.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
[out] | mode | - The desired pin mode. |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance. sl_gpio_driver_set_pin_mode();
Returns
The following values are returned:
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS_OK (0X000) - Success
168
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_init#
sl_status_t sl_gpio_driver_init (void )
N/A |
177
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_deinit#
sl_status_t sl_gpio_driver_deinit (void )
N/A |
186
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_unregister#
sl_status_t sl_gpio_driver_unregister (sl_si91x_gpio_instances_t gpio_instance, sl_si91x_gpio_intr_t gpio_intr, uint8_t flag)
Unregister GPIO driver.
[in] | gpio_instance | - Instances of type sl_si91x_gpio_instances_t |
[in] | gpio_intr | - GPIO interrupts of type sl_si91x_gpio_intr_t |
[in] | flag | - GPIO interrupt flag Max range is 8. |
Returns
The following values are returned:
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_OK (0X000) - Success
198
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_pin#
STATIC __INLINE sl_status_t sl_gpio_driver_set_pin (sl_gpio_t * gpio)
Set a single pin in GPIO configuration register to 1.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for corresponding GPIO instance.
Returns
The following values are returned:
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
220
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_clear_pin#
STATIC __INLINE sl_status_t sl_gpio_driver_clear_pin (sl_gpio_t * gpio)
Clear a single pin in the GPIO configuration register to 0.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(); for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
272
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_toggle_pin#
STATIC __INLINE sl_status_t sl_gpio_driver_toggle_pin (sl_gpio_t * gpio)
Toggle a single pin in GPIO port register.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
324
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_pin#
STATIC __INLINE sl_status_t sl_gpio_driver_get_pin (sl_gpio_t * gpio, uint8_t * pin_value)
Read the pin value for a single pin in a GPIO port.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
[out] | pin_value | - Gets the gpio pin value |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS_OK (0X000) - Success
377
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_port#
STATIC __INLINE sl_status_t sl_gpio_driver_set_port (sl_gpio_port_t port, uint32_t pins)
Set bits GPIO data out register to 1.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pins | - The GPIO pins in a Port that are set to 1 (1 to 65535). |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_OK (0X000) - Success
431
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_clear_port#
STATIC __INLINE sl_status_t sl_gpio_driver_clear_port (sl_gpio_port_t port, uint32_t pins)
Set bits in configuration register for a port to 0.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pins | - The GPIO pins in a Port that are set to 0 (1 to 65535). |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_OK (0X000) - Success
463
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_port_output#
STATIC __INLINE sl_status_t sl_gpio_driver_get_port_output (sl_gpio_port_t port, uint32_t * port_value)
Get the current setting for a GPIO configuration register.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[out] | port_value | - Gets the gpio port value |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_OK (0X000) - Success
495
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_pin_output#
STATIC __INLINE uint8_t sl_gpio_driver_get_pin_output (sl_gpio_t * gpio)
Get the current setting for a pin in a GPIO configuration register.
[in] | gpio | - Pointer to the structure of type sl_gpio_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
The GPIO pin value '0' - Low '1' - High
522
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_port_output_value#
STATIC __INLINE sl_status_t sl_gpio_driver_set_port_output_value (sl_gpio_port_t port, uint32_t val, uint32_t mask)
Set the GPIO port configuration register.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | val | - Value to write to the port configuration register. |
[in] | mask | - Mask indicating which bits to modify. |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance
Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_OK (0X000) - Success
579
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_slew_rate#
STATIC __INLINE sl_status_t sl_gpio_driver_set_slew_rate (sl_gpio_port_t port, uint32_t slewrate, uint32_t slewrate_alt)
N/A | port | |
N/A | slewrate | |
N/A | slewrate_alt |
606
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_port_input#
STATIC __INLINE uint32_t sl_gpio_driver_get_port_input (sl_gpio_port_t port)
Read the port value for GPIO.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance
Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
The GPIO pin value '0' - Low '1' - High
636
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_toggle_port_output#
STATIC __INLINE sl_status_t sl_gpio_driver_toggle_port_output (sl_gpio_port_t port, uint32_t pins)
N/A | port | |
N/A | pins |
669
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_enable_interrupts#
STATIC __INLINE sl_status_t sl_gpio_driver_enable_interrupts (uint32_t flags)
N/A | flags |
694
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_disable_interrupts#
STATIC __INLINE sl_status_t sl_gpio_driver_disable_interrupts (uint32_t flags)
N/A | flags |
714
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_set_interrupts#
STATIC __INLINE sl_status_t sl_gpio_driver_set_interrupts (uint32_t flags)
N/A | flags |
734
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_pending_interrupts#
STATIC __INLINE uint32_t sl_gpio_driver_get_pending_interrupts (void )
Get the pending GPIO interrupts.
N/A |
Pre-conditions:
Returns
Pending GPIO Pin interrupt numbers.
752
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_enabled_interrupts#
STATIC __INLINE uint32_t sl_gpio_driver_get_enabled_interrupts (void )
Get the enabled GPIO interrupts.
N/A |
Pre-conditions:
Returns
Enabled GPIO pin interrupt numbers.
771
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_gpio_driver_get_enabled_pending_interrupts#
STATIC __INLINE uint32_t sl_gpio_driver_get_enabled_pending_interrupts (void )
Get the enabled and pending GPIO interrupt flags.
N/A |
Pre-conditions:
Returns
Enabled GPIO pending interrupts.
789
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
sl_si91x_gpio_driver_set_pin_direction#
sl_status_t sl_si91x_gpio_driver_set_pin_direction (uint8_t port, uint8_t pin, sl_si91x_gpio_direction_t direction)
Set the direction for a GPIO pin.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
[in] | direction | - pin direction of type sl_si91x_gpio_direction_t
|
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
76
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_pin_direction#
uint8_t sl_si91x_gpio_driver_get_pin_direction (uint8_t port, uint8_t pin)
Get the direction of a selected GPIO pin.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
Pre-conditions:
sl_si91x_gpio_driver_enable_pad_selection(), for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
Returns
Returns the direction of the pin.
'0' - Output
'1' - Input
101
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_enable_pad_receiver#
sl_status_t sl_si91x_gpio_driver_enable_pad_receiver (uint8_t gpio_num)
Enable the receiver enable bit in the PAD configuration register for reading the GPIO pin status.
[in] | gpio_num | - GPIO pin number to be use. |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
116
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_disable_pad_receiver#
sl_status_t sl_si91x_gpio_driver_disable_pad_receiver (uint8_t gpio_num)
Disable the receiver enable bit in the PAD configuration register.
[in] | gpio_num | - GPIO pin number to be use. |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
131
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_enable_pad_selection#
sl_status_t sl_si91x_gpio_driver_enable_pad_selection (uint8_t gpio_padnum)
Enable the pad selection bit in the PAD selection register.
[in] | gpio_padnum | - PAD number to be use |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
144
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_pad_driver_strength#
sl_status_t sl_si91x_gpio_driver_select_pad_driver_strength (uint8_t gpio_num, sl_si91x_gpio_driver_strength_select_t strength)
Select the drive strength for an HP instance GPIO pin.
[in] | gpio_num | - GPIO pin number to be use |
[in] | strength | - Drive strength selector(E1,E2) of type sl_si91x_gpio_driver_strength_select_t possible values are
|
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
167
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_pad_driver_disable_state#
sl_status_t sl_si91x_gpio_driver_select_pad_driver_disable_state (uint8_t gpio_num, sl_si91x_gpio_driver_disable_state_t disable_state)
Select the Driver disabled state control for an HP instance GPIO pin.
[in] | gpio_num | - GPIO pin number to be use |
[in] | disable_state | - driver disable state of type sl_si91x_gpio_driver_disable_state_t possible values are |
Pre-conditions:
0, for HiZ (P1=0,P2=0)
1, for Pull-up (P1=0,P2=1)
2, for Pull-down (P1=1,P2=0)
3, for Repeater (P1=1,P2=1)
Returns
returns status 0 if successful, else error code as follow. SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument SL_STATUS _OK (0X000) - Success
192
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_group_interrupt_and_or#
sl_status_t sl_si91x_gpio_driver_select_group_interrupt_and_or (uint8_t port, sl_si91x_group_interrupt_t group_interrupt, sl_si91x_gpio_and_or_t and_or)
Select AND/OR type of the group interrupt.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | group_interrupt | - Group interrupt number of type sl_si91x_group_interrupt_t |
[in] | and_or | - AND/OR of GPIO group interrupts of type sl_si91x_gpio_and_or_t
|
If multiple interrupts on same port (or) different are to be generated, then use this API. Example: Consider port 0: pin 2,3 and port 3: pin 1,2 for interrupt generation. Choose OR, any of the selected pin condition triggers the group interrupt generation Choose AND, all the selected pin conditions should match to trigger group interrupt generation
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use corresponding group interrupt configuration API for corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
229
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_clear_group_interrupt#
sl_status_t sl_si91x_gpio_driver_clear_group_interrupt (sl_si91x_group_interrupt_t group_interrupt)
Clear the selected group interrupt status value.
[in] | group_interrupt | - Group interrupt number of type sl_si91x_group_interrupt_t |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument
SL_STATUS _OK (0X000) - Success
250
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_group_interrupt_status#
uint32_t sl_si91x_gpio_driver_get_group_interrupt_status (uint8_t port, sl_si91x_group_interrupt_t group_interrupt)
Get the current status of the selected group interrupt.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | group_interrupt | - Group interrupt number of type (0 to 1) sl_si91x_group_interrupt_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns the group interrupt status register
1, when interrupt is enabled
0, when interrupt is disabled
275
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_group_interrupt_wakeup#
sl_status_t sl_si91x_gpio_driver_select_group_interrupt_wakeup (uint8_t port, sl_si91x_group_interrupt_t group_interrupt, sl_si91x_gpio_wakeup_t flags)
Configure the group interrupt as a wake up source across sleep wakeups.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | group_interrupt | - Group interrupt number of type sl_si91x_group_interrupt_t |
[in] | flags | - GPIO group interrupt wake up flag of type sl_si91x_gpio_wakeup_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
295
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_configure_group_interrupt#
sl_status_t sl_si91x_gpio_driver_configure_group_interrupt (sl_si91x_gpio_group_interrupt_config_t * configuration, sl_gpio_irq_callback_t gpio_callback)
Configure the MCU HP instance group interrupts with trigger type (level/edge), polarity (high/low), interrupt type (and/or) and register the callback function for interrupts.
[in] | configuration | - configuration pointer to sl_si91x_gpio_group_interrupt_config_t structure |
[in] | gpio_callback | - IRQ function pointer |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS _OK (0X000) - Success
317
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_group_interrupt_polarity#
uint8_t sl_si91x_gpio_driver_get_group_interrupt_polarity (sl_si91x_group_interrupt_t group_interrupt, uint8_t port, uint8_t pin)
Get the configured polarity of group interrupt.
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns group interrupt polarity
1, when GPIO pin status is HIGH
0, when GPIO pin status is LOW
347
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_group_interrupt_polarity#
sl_status_t sl_si91x_gpio_driver_set_group_interrupt_polarity (sl_si91x_group_interrupt_t group_interrupt, uint8_t port, uint8_t pin, sl_si91x_gpio_polarity_t polarity)
Configure the polarity to a selected group interrupt which decides the active value of the pin to be considered for group interrupt generation.
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
[in] | polarity | - polarity of GPIO group interrupt of type sl_si91x_gpio_polarity_t
|
'0' – group interrupt gets generated when gpio input pin status is LOW '1' – group interrupt gets generated when gpio input pin status is HIGH
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
387
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_group_interrupt_level_edge#
uint8_t sl_si91x_gpio_driver_get_group_interrupt_level_edge (uint8_t port, sl_si91x_group_interrupt_t group_interrupt)
Get the configured level/edge event for the selected group interrupt.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns group interrupt level_edge
1, for Edge
0, for Level
415
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_group_interrupt_level_edge#
sl_status_t sl_si91x_gpio_driver_set_group_interrupt_level_edge (uint8_t port, sl_si91x_group_interrupt_t group_interrupt, sl_si91x_gpio_level_edge_t level_edge)
Set the level/edge event for the selected group interrupt.
[in] | port | - The port to associate with the pin.
|
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
[in] | level_edge | - GPIO level edge group interrupt of type sl_si91x_gpio_level_edge_t
|
'1' Triggers interrupt generation when configured edge is detected on pin '0' Triggers interrupt generation when configured level is detected on pin
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
448
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_unmask_group_interrupt#
sl_status_t sl_si91x_gpio_driver_unmask_group_interrupt (uint8_t port, sl_si91x_group_interrupt_t group_interrupt)
Unmask the selected group interrupt to enable interrupt clearing upon generation.
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use corresponding pad receiver API for corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
476
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_mask_group_interrupt#
sl_status_t sl_si91x_gpio_driver_mask_group_interrupt (uint8_t port, sl_si91x_group_interrupt_t group_interrupt)
Mask the selected group interrupt.
[in] | port | - The port to associate with the pin.
|
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
499
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_disable_clock#
sl_status_t sl_si91x_gpio_driver_disable_clock (sl_si91x_gpio_select_clock_t clock)
Disable the clock for either the HP or ULP instance of the GPIO Peripheral.
[in] | clock | - Selects M4 clock or ULP clock of type sl_si91x_gpio_select_clock_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
514
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_enable_clock#
sl_status_t sl_si91x_gpio_driver_enable_clock (sl_si91x_gpio_select_clock_t clock)
Enable the clock for either the HP or ULP instance of the GPIO peripheral.
[in] | clock | - Selects M4 clock or ULP clock of type sl_si91x_gpio_select_clock_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
529
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_enable_group_interrupt#
sl_status_t sl_si91x_gpio_driver_enable_group_interrupt (sl_si91x_group_interrupt_t group_interrupt, uint8_t port, uint8_t pin)
Enable the selected group interrupts for either the HP or ULP instance of the GPIO peripheral.
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
[in] | port | - The port to associate with the pin.
|
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
559
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_disable_group_interrupt#
sl_status_t sl_si91x_gpio_driver_disable_group_interrupt (sl_si91x_group_interrupt_t group_interrupt, uint8_t port, uint8_t pin)
Disable the selected group interrupts for either the HP or ULP instance of the GPIO peripheral.
[in] | group_interrupt | - GPIO group interrupt number of type sl_si91x_group_interrupt_t |
[in] | port | - The port to associate with the pin. HP instance - PORT 0,1,2,3 ULP instance - PORT 4 |
[in] | pin | - The pin number on the port. HP instance has total 57 GPIO pins. Port 0, 1, 2 has 16 pins each. Port 3 has 9 pins. ULP instance has total 12 pins. |
Pre-conditions:
sl_si91x_gpio_driver_enable_clock, for HP instance
sl_si91x_gpio_driver_enable_pad_receiver(), for HP instance
sl_si91x_gpio_driver_enable_ulp_pad_receiver(), for ULP instance Use the corresponding pad receiver API for the corresponding GPIO instance.
sl_si91x_gpio_driver_configure_ulp_group_interrupt(), for HP instance
sl_si91x_gpio_driver_configure_ulp_group_interrupt, for ULP instance Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
593
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_ulp_pad_slew_rate#
sl_status_t sl_si91x_gpio_driver_select_ulp_pad_slew_rate (uint8_t gpio_num, sl_si91x_gpio_slew_rate_t slew_rate)
Select the slew rate for the ULP instance of the GPIO peripheral.
[in] | gpio_num | - GPIO pin number to be use |
[in] | slew_rate | - slew rate of type sl_si91x_gpio_slew_rate_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
614
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_ulp_pad_driver_strength#
sl_status_t sl_si91x_gpio_driver_select_ulp_pad_driver_strength (uint8_t gpio_num, sl_si91x_gpio_driver_strength_select_t strength)
Select the drive strength for the ULP instance of the GPIO peripheral.
[in] | gpio_num | - GPIO pin number to be use |
[in] | strength | - Drive strength selector(E1,E2) of type sl_si91x_gpio_driver_strength_select_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
636
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_ulp_pad_driver_disable_state#
sl_status_t sl_si91x_gpio_driver_select_ulp_pad_driver_disable_state (uint8_t gpio_num, sl_si91x_gpio_driver_disable_state_t disable_state)
Select the driver-disabled state control for the ULP instance of the GPIO peripheral.
[in] | gpio_num | - GPIO pin number to be use |
[in] | disable_state | - driver disable state of type sl_si91x_gpio_driver_disable_state_t
|
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
659
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_disable_ulp_pad_receiver#
sl_status_t sl_si91x_gpio_driver_disable_ulp_pad_receiver (uint8_t gpio_num)
Disable the receiver enable bit for the ULP instance of the GPIO peripheral.
[in] | gpio_num | - GPIO pin number to be used |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
674
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_enable_ulp_pad_receiver#
sl_status_t sl_si91x_gpio_driver_enable_ulp_pad_receiver (uint8_t gpio_num)
Enable the receiver enable bit for the ULP instance of the GPIO peripheral.
[in] | gpio_num | - GPIO pin number to be used |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
687
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_configure_ulp_pin_interrupt#
sl_status_t sl_si91x_gpio_driver_configure_ulp_pin_interrupt (uint8_t int_no, sl_si91x_gpio_interrupt_config_flag_t flags, sl_si91x_gpio_pin_ulp_t pin, sl_gpio_irq_callback_t gpio_callback)
Configure the MCU ULP instance pin interrupts with the trigger type (level/edge) and register the callback function for interrupts.
[in] | int_no | - The interrupt number to trigger. |
[in] | flags | - Interrupt configuration flags of type sl_si91x_gpio_interrupt_config_flag_t |
[in] | pin | - GPIO pin number (0 to 11) |
[in] | gpio_callback | - IRQ function pointer |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS _OK (0X000) - Success
709
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_uulp_npss_pin_mux#
sl_status_t sl_si91x_gpio_driver_set_uulp_npss_pin_mux (uint8_t pin, sl_si91x_uulp_npss_mode_t mode)
Set the NPSS GPIO pin MUX (mode) to the selected mode.
[in] | pin | - NPSS GPIO pin number(0...4) of type sl_si91x_uulp_npss_mode_t |
[in] | mode | - NPSS GPIO MUX value (0 to 10) |
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
729
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_uulp_npss_receiver#
sl_status_t sl_si91x_gpio_driver_select_uulp_npss_receiver (uint8_t pin, sl_si91x_gpio_receiver_t receiver)
Enable/disable the NPSS GPIO Input Buffer.
[in] | pin | - is NPSS GPIO pin number (0...4) |
[in] | receiver | - is enable/disable NPSS GPIO receiver of type sl_si91x_gpio_receiver_t
|
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
747
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_uulp_npss_direction#
sl_status_t sl_si91x_gpio_driver_set_uulp_npss_direction (uint8_t pin, sl_si91x_gpio_direction_t direction)
Set the direction for the selected NPSS GPIO.
[in] | pin | - is NPSS GPIO pin number (0...4) |
[in] | direction | - is direction value (Input / Output) of type sl_si91x_gpio_direction_t
|
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
767
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_uulp_npss_direction#
uint8_t sl_si91x_gpio_driver_get_uulp_npss_direction (uint8_t pin)
Get the direction of the selected NPSS GPIO.
[in] | pin | - is NPSS GPIO pin number(0...4) |
Pre-conditions:
Returns
returns the GPIO pin direction
1, Input Direction
0, Output Direction
782
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_uulp_npss_pin_value#
sl_status_t sl_si91x_gpio_driver_set_uulp_npss_pin_value (uint8_t pin, sl_si91x_gpio_pin_value_t pin_value)
Control(set or clear) the NPSS GPIO pin value.
[in] | pin | - is NPSS GPIO pin number (0...4) of type sl_si91x_gpio_pin_value_t |
[in] | pin_value | - is NPSS GPIO pin value
|
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
803
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_uulp_npss_pin#
uint8_t sl_si91x_gpio_driver_get_uulp_npss_pin (uint8_t pin)
Read the status of the selected NPSS GPIO pin value.
[in] | pin | - is NPSS GPIO pin number (0...4) |
Pre-conditions:
Returns
returns the pin logical state of pin
'0' - Output
'1' - Input
819
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_select_uulp_npss_polarity#
sl_status_t sl_si91x_gpio_driver_select_uulp_npss_polarity (uint8_t pin, sl_si91x_gpio_polarity_t polarity)
Select the NPSS GPIO polarity for generating the interrupt.
[in] | pin | - is NPSS GPIO pin number (0...4) |
[in] | polarity | - GPIO polarity sl_si91x_gpio_polarity_t
|
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
837
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_uulp_npss_wakeup_interrupt#
sl_status_t sl_si91x_gpio_driver_set_uulp_npss_wakeup_interrupt (uint8_t npssgpio_interrupt)
Set the NPSS GPIO interrupt as a wake up source across sleep wakeups.
[in] | npssgpio_interrupt | - OR'ed values of the NPSS GPIO interrupts |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
850
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_clear_uulp_npss_wakeup_interrupt#
sl_status_t sl_si91x_gpio_driver_clear_uulp_npss_wakeup_interrupt (uint8_t npssgpio_interrupt)
Clear the UULP NPSS GPIO Interrupt as a wake up source.
[in] | npssgpio_interrupt | - OR'ed values of the NPSS GPIO interrupts |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
863
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_mask_uulp_npss_interrupt#
sl_status_t sl_si91x_gpio_driver_mask_uulp_npss_interrupt (uint8_t npssgpio_interrupt)
Mask the selected NPSS GPIO interrupt.
[in] | npssgpio_interrupt | - OR'ed values of the NPSS GPIO interrupts |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
880
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_unmask_uulp_npss_interrupt#
sl_status_t sl_si91x_gpio_driver_unmask_uulp_npss_interrupt (uint8_t npssgpio_interrupt)
Unmask the selected NPSS GPIO interrupt.
[in] | npssgpio_interrupt | - OR'ed values of the NPSS GPIO interrupts |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
897
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_clear_uulp_interrupt#
sl_status_t sl_si91x_gpio_driver_clear_uulp_interrupt (uint8_t npssgpio_interrupt)
Clear the selected NPSS GPIO interrupt.
[in] | npssgpio_interrupt | - OR'ed values of the NPSS GPIO interrupts |
Pre-conditions:
sl_si91x_gpio_set_uulp_pad_configuration()
sl_si91x_gpio_configure_uulp_interrupt()
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
915
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_uulp_interrupt_status#
uint8_t sl_si91x_gpio_driver_get_uulp_interrupt_status (void )
Get the current status of all the NPSS GPIO interrupt status.
N/A |
Pre-conditions:
sl_si91x_gpio_set_uulp_pad_configuration()
sl_si91x_gpio_configure_uulp_interrupt()
Returns
returns the UULP INTR status.
1, interrupt has been raised
0, interrupt is masked or not raised
933
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_ulp_interrupt_status#
uint32_t sl_si91x_gpio_driver_get_ulp_interrupt_status (uint32_t flags)
Get the selected ULP instance GPIO pin interrupt status.
[in] | flags | : ULP GPIO interrupt sources status. |
Pre-conditions:
sl_si91x_gpio_configure_ulp_pin_interrupt()
Returns
returns the ULP INTR status. 1, interrupt has been raised 0, interrupt is masked or not raised
948
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_clear_ulp_interrupt#
sl_status_t sl_si91x_gpio_driver_clear_ulp_interrupt (uint32_t flags)
Clear the selected ULP instance GPIO pin interrupts.
[in] | flags | : ULP GPIO interrupt sources to clear. |
Pre-conditions:
sl_si91x_gpio_configure_ulp_pin_interrupt()
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
965
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_clear_ulp_group_interrupt#
sl_status_t sl_si91x_gpio_driver_clear_ulp_group_interrupt (sl_si91x_group_interrupt_t group_interrupt)
Clear the selected ULP instance group interrupt.
[in] | group_interrupt | - Group interrupt number of type sl_si91x_group_interrupt_t |
Pre-conditions:
sl_si91x_gpio_driver_configure_ulp_group_interrupt()
Use the corresponding group interrupt configuration API for the corresponding GPIO instance.
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
985
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_configure_uulp_interrupt#
sl_status_t sl_si91x_gpio_driver_configure_uulp_interrupt (sl_si91x_gpio_interrupt_config_flag_t flags, uint8_t npssgpio_interrupt, sl_gpio_irq_callback_t gpio_callback)
Configure the UULP GPIO pin interrupt with interrupt type level or edge and registers callback function for interrupts.
[in] | flags | - Interrupt configuration flags of type sl_si91x_gpio_interrupt_config_flag_t |
[in] | npssgpio_interrupt | - NPSS GPIO input number (0 to 4) |
[in] | gpio_callback | - IRQ function pointer |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer
SL_STATUS _OK (0X000) - Success
1006
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_configure_ulp_group_interrupt#
sl_status_t sl_si91x_gpio_driver_configure_ulp_group_interrupt (sl_si91x_gpio_group_interrupt_config_t * configuration, sl_gpio_irq_callback_t gpio_callback)
Configure the MCU ULP instance group interrupts with trigger type (level/edge), polarity (high/low), interrupt type (and/or) and register the callback function for interrupts.
[in] | configuration | - configuration pointer to sl_si91x_gpio_group_interrupt_config_t structure |
[in] | gpio_callback | - IRQ function pointer |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS _OK (0X000) - Success
1027
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_toggle_uulp_npss_pin#
sl_status_t sl_si91x_gpio_driver_toggle_uulp_npss_pin (uint8_t pin)
Toggle the selected UULP pin status.
[in] | pin | - UULP pin number to toggle |
Pre-conditions:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is an invalid argument
SL_STATUS _OK (0X000) - Success
1044
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_set_uulp_pad_configuration#
sl_status_t sl_si91x_gpio_driver_set_uulp_pad_configuration (uulp_pad_config_t * pad_config)
Configure the UULP GPIO pin mode, receiver enable, direction and polarity settings.
[in] | pad_config | : PAD configuration pointer to uulp_pad_config_t structure |
Pre-condition:
Returns
returns status 0 if successful, else error code as follow.
SL_STATUS_NULL_POINTER (0x0022) - The parameter is a null pointer
SL_STATUS _OK (0X000) - Success
1057
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
sl_si91x_gpio_driver_get_version#
sl_si91x_gpio_version_t sl_si91x_gpio_driver_get_version (void )
Get the release, SQA, and development version numbers of the GPIO peripheral.
N/A |
Returns
returns structure of type sl_si91x_gpio_version_t
1064
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_si91x_driver_gpio.h
Macro Definition Documentation#
GPIO_MAX_OUTPUT_VALUE#
#define GPIO_MAX_OUTPUT_VALUEValue:
1
50
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
MAX_GROUP_INT#
#define MAX_GROUP_INTValue:
2
51
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
GPIO_PORT_MAX_VALUE#
#define GPIO_PORT_MAX_VALUEValue:
5
52
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
MAX_UULP_INT#
#define MAX_UULP_INTValue:
5
53
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
ULP_MAX_MODE#
#define ULP_MAX_MODEValue:
10
54
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
GPIO_MAX_INTR_VALUE#
#define GPIO_MAX_INTR_VALUEValue:
8
56
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
PORTD_PIN_MAX_VALUE#
#define PORTD_PIN_MAX_VALUEValue:
8
57
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
PORTE_PIN_MAX_VALUE#
#define PORTE_PIN_MAX_VALUEValue:
11
58
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
PORTF_PIN_MAX_VALUE#
#define PORTF_PIN_MAX_VALUEValue:
5
59
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
MAX_ULP_INTR#
#define MAX_ULP_INTRValue:
8
60
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
MAX_MODE#
#define MAX_MODEValue:
15
61
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
PORT_PIN_MAX_VALUE#
#define PORT_PIN_MAX_VALUEValue:
15
62
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
GPIO_FLAGS_MAX_VALUE#
#define GPIO_FLAGS_MAX_VALUEValue:
0x0F
63
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h
PORTF#
#define PORTFValue:
5
65
of file components/device/silabs/si91x/mcu/drivers/unified_api/inc/sl_driver_gpio.h