Solaris Software
Loading...
Searching...
No Matches
gpio.c
Go to the documentation of this file.
1/**
2 * @file spi.c
3 * @brief HAL SPI functions implementation. Calls the function pointer and returns the result.
4 */
5
6
7/* ----------------------------------------------------------------
8 * INCLUDES
9 * ---------------------------------------------------------------- */
11#include "spp/hal/hal.h"
12#include "spp/hal/gpio/gpio.h"
13
14
15/* ----------------------------------------------------------------
16 * PUBLIC FUNCTIONS
17 * ---------------------------------------------------------------- */
18
20 spp_uint32_t pull)
21{
23 const SPP_HalPort_t *p_port = SPP_HAL_getPort();
24 if ((p_port == NULL) || (p_port->gpio.gpioConfigInterrupt == NULL))
25 {
27 }
28 else
29 {
30 ret = p_port->gpio.gpioConfigInterrupt(pin, intrType, pull);
31 if (ret != K_SPP_OK)
32 {
33 ret = K_SPP_ERROR;
34 }
35 }
36 return ret;
37}
38
40{
42 const SPP_HalPort_t *p_port = SPP_HAL_getPort();
43 if ((p_port == NULL) || (p_port->gpio.gpioRegisterIsr == NULL))
44 {
46 }
47 else
48 {
49 ret = p_port->gpio.gpioRegisterIsr(pin, p_isrCtx);
50 if (ret != K_SPP_OK)
51 {
52 ret = K_SPP_ERROR;
53 }
54 }
55
56 return ret;
57}
SPP_RetVal_t SPP_HAL_GPIO_registerIsr(spp_uint32_t pin, void *p_isrCtx)
Register an ISR handler for a GPIO pin.
Definition gpio.c:39
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.
Definition gpio.c:19
SPP GPIO HAL API — dispatches through the registered HAL port.
const SPP_HalPort_t * SPP_HAL_getPort(void)
This function is used to get the pointers to the functions that are used by the SPP library....
Definition hal.c:52
This file contains the structs that contain all the pointers to the functions that are used by the SP...
Standard return-value type used across all SPP modules.
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition returnTypes.h:24
@ K_SPP_OK
Definition returnTypes.h:25
@ K_SPP_ERROR
Definition returnTypes.h:26
@ K_SPP_ERROR_NULL_POINTER
Definition returnTypes.h:30
SPP_RetVal_t(*) gpioConfigInterrupt(spp_uint32_t pin, spp_uint32_t intrType, spp_uint32_t pull)
Configure a GPIO pin as an interrupt input.
Definition hal.h:133
SPP_RetVal_t(*) gpioRegisterIsr(spp_uint32_t pin, void *p_isrCtx)
Register an ISR handler for a GPIO pin.
Definition hal.h:143
Ports struct that contains all the pointers to the Ports functions.
Definition hal.h:215
SPP_HALGpio_t gpio
Definition hal.h:217
uint32_t spp_uint32_t
Definition types.h:31