Solaris Software
Loading...
Searching...
No Matches
gpio.c File Reference

HAL GPIO functions implementation. Dispatches calls through the registered HAL port. More...

#include "spp/core/returnTypes.h"
#include "spp/hal/hal.h"
#include "spp/hal/gpio/gpio.h"
Include dependency graph for gpio.c:

Go to the source code of this file.

Functions

SPP_RetVal_t SPP_HAL_GPIO_configInterrupt (spp_uint32_t pin, spp_uint32_t intrType, spp_uint32_t pull)
 Configure a GPIO pin as an interrupt input.
SPP_RetVal_t SPP_HAL_GPIO_registerIsr (spp_uint32_t pin, void *p_isrCtx)
 Register an ISR handler for a GPIO pin.
spp_uint16_t SPP_HAL_GPIO_read (spp_uint32_t pin)
 Reads the logic level of a GPIO pin.
SPP_RetVal_t SPP_HAL_GPIO_write (spp_uint32_t pin, spp_uint8_t level)
 Configures a GPIO as output and sets its logic level.

Detailed Description

HAL GPIO functions implementation. Dispatches calls through the registered HAL port.

Definition in file gpio.c.

Function Documentation

◆ SPP_HAL_GPIO_configInterrupt()

SPP_RetVal_t SPP_HAL_GPIO_configInterrupt ( spp_uint32_t pin,
spp_uint32_t intrType,
spp_uint32_t pull )

Configure a GPIO pin as an interrupt input.

Parameters
[in]pinGPIO pin number.
[in]intrTypePlatform-specific interrupt trigger type value.
[in]pullPull resistor: 0 = none, 1 = pull-up, 2 = pull-down.
Returns
K_SPP_OK on success.

Definition at line 18 of file gpio.c.

References SPP_HalPort_t::gpio, SPP_HALGpio_t::gpioConfigInterrupt, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, SPP_HAL_getPort(), and SPP_HAL_GPIO_configInterrupt().

Referenced by SPP_HAL_GPIO_configInterrupt(), SPP_SERVICES_BMP390_init(), SPP_SERVICES_ICM20948_initGpio(), SPP_SERVICES_SX1262_init(), and SX1262_InitInterrupts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_HAL_GPIO_registerIsr()

SPP_RetVal_t SPP_HAL_GPIO_registerIsr ( spp_uint32_t pin,
void * p_isrCtx )

Register an ISR handler for a GPIO pin.

The ISR sets *p_isrCtx->p_flag to SPP_TRUE whenever the configured interrupt fires.

Parameters
[in]pinGPIO pin number.
[in]p_isrCtxPointer to a SPP_GpioIsrCtx_t for this pin.
Returns
K_SPP_OK on success.

Definition at line 37 of file gpio.c.

References SPP_HalPort_t::gpio, SPP_HALGpio_t::gpioRegisterIsr, K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, SPP_HAL_getPort(), and SPP_HAL_GPIO_registerIsr().

Referenced by SPP_HAL_GPIO_registerIsr(), SPP_SERVICES_BMP390_init(), SPP_SERVICES_ICM20948_initGpio(), and SX1262_InitInterrupts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_HAL_GPIO_read()

spp_uint16_t SPP_HAL_GPIO_read ( spp_uint32_t pin)

Reads the logic level of a GPIO pin.

Parameters
pinGPIO pin number.
Returns
Current logic level (0 or 1).

Definition at line 57 of file gpio.c.

References SPP_HalPort_t::gpio, SPP_HALGpio_t::gpioRead, SPP_HAL_getPort(), and SPP_HAL_GPIO_read().

Referenced by SPP_HAL_GPIO_read(), SPP_SERVICES_SX1262_consumeData(), and SX1262_WaitBusy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPP_HAL_GPIO_write()

SPP_RetVal_t SPP_HAL_GPIO_write ( spp_uint32_t pin,
spp_uint8_t level )

Configures a GPIO as output and sets its logic level.

Parameters
pinGPIO pin number.
levelLogic level to set.
Returns
K_SPP_OK on success, K_SPP_ERROR on failure.

Definition at line 64 of file gpio.c.

References SPP_HalPort_t::gpio, SPP_HALGpio_t::gpioWrite, K_SPP_ERROR, K_SPP_OK, SPP_HAL_getPort(), and SPP_HAL_GPIO_write().

Referenced by SPP_HAL_GPIO_write(), and SPP_SERVICES_SX1262_init().

Here is the call graph for this function:
Here is the caller graph for this function: