Solaris Software
Toggle main menu visibility
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
* ---------------------------------------------------------------- */
10
#include "
spp/core/returnTypes.h
"
11
#include "
spp/hal/hal.h
"
12
#include "
spp/hal/gpio/gpio.h
"
13
14
15
/* ----------------------------------------------------------------
16
* PUBLIC FUNCTIONS
17
* ---------------------------------------------------------------- */
18
19
SPP_RetVal_t
SPP_HAL_GPIO_configInterrupt
(
spp_uint32_t
pin,
spp_uint32_t
intrType,
20
spp_uint32_t
pull)
21
{
22
SPP_RetVal_t
ret =
K_SPP_ERROR
;
23
const
SPP_HalPort_t
*p_port =
SPP_HAL_getPort
();
24
if
((p_port == NULL) || (p_port->
gpio
.
gpioConfigInterrupt
== NULL))
25
{
26
ret =
K_SPP_ERROR_NULL_POINTER
;
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
39
SPP_RetVal_t
SPP_HAL_GPIO_registerIsr
(
spp_uint32_t
pin,
void
*p_isrCtx)
40
{
41
SPP_RetVal_t
ret =
K_SPP_ERROR
;
42
const
SPP_HalPort_t
*p_port =
SPP_HAL_getPort
();
43
if
((p_port == NULL) || (p_port->
gpio
.
gpioRegisterIsr
== NULL))
44
{
45
ret =
K_SPP_ERROR_NULL_POINTER
;
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_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.
Definition
gpio.c:39
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.
Definition
gpio.c:19
gpio.h
SPP GPIO HAL API — dispatches through the registered HAL port.
SPP_HAL_getPort
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
hal.h
This file contains the structs that contain all the pointers to the functions that are used by the SP...
returnTypes.h
Standard return-value type used across all SPP modules.
SPP_RetVal_t
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition
returnTypes.h:24
K_SPP_OK
@ K_SPP_OK
Definition
returnTypes.h:25
K_SPP_ERROR
@ K_SPP_ERROR
Definition
returnTypes.h:26
K_SPP_ERROR_NULL_POINTER
@ K_SPP_ERROR_NULL_POINTER
Definition
returnTypes.h:30
SPP_HALGpio_t::gpioConfigInterrupt
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_HALGpio_t::gpioRegisterIsr
SPP_RetVal_t(*) gpioRegisterIsr(spp_uint32_t pin, void *p_isrCtx)
Register an ISR handler for a GPIO pin.
Definition
hal.h:143
SPP_HalPort_t
Ports struct that contains all the pointers to the Ports functions.
Definition
hal.h:215
SPP_HalPort_t::gpio
SPP_HALGpio_t gpio
Definition
hal.h:217
spp_uint32_t
uint32_t spp_uint32_t
Definition
types.h:31
solaris-v2
spp
hal
gpio
gpio.c
Generated by
1.18.0