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

HAL port. All the necessary functions needed to setup the HAL ports and to get the pointers to the functions that are used by the SPP library. More...

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

Go to the source code of this file.

Functions

SPP_RetVal_t SPP_HAL_init (void *p_halPorts)
 This functions initializes the ports struct and initializes all the peripherals.
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. The structs are used to abstract the hardware and to make the code more portable. It also contains the public functions needed to initialize all these structs.

Variables

static const SPP_HalPort_t * s_p_halPort = {NULL}

Detailed Description

HAL port. All the necessary functions needed to setup the HAL ports and to get the pointers to the functions that are used by the SPP library.

Definition in file hal.c.

Function Documentation

◆ SPP_HAL_init()

SPP_RetVal_t SPP_HAL_init ( void * p_halPorts)

This functions initializes the ports struct and initializes all the peripherals.

Definition at line 26 of file hal.c.

References K_SPP_ERROR, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, s_p_halPort, SPP_HAL_init(), SPP_HAL_SPI_busInit(), and SPP_HAL_UART_portInit().

Referenced by app_main(), and SPP_HAL_init().

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

◆ 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. The structs are used to abstract the hardware and to make the code more portable. It also contains the public functions needed to initialize all these structs.

Parameters
[in]p_portsPointer to the ports struct that will be initialized.
Returns
NULL if the pointer to the ports struct is NULL.
Pointer to the ports struct, if it has beeen initialized.

Definition at line 52 of file hal.c.

References s_p_halPort, and SPP_HAL_getPort().

Referenced by SPP_HAL_getPort(), SPP_HAL_GPIO_configInterrupt(), SPP_HAL_GPIO_registerIsr(), SPP_HAL_SPI_busInit(), SPP_HAL_SPI_deviceInit(), SPP_HAL_SPI_deviceSetSpeed(), SPP_HAL_SPI_getHandle(), SPP_HAL_SPI_transmit(), SPP_HAL_STORAGE_init(), SPP_HAL_STORAGE_write(), SPP_HAL_TIME_delayMs(), SPP_HAL_TIME_getTimeMs(), SPP_HAL_TIME_getTimeUs(), SPP_HAL_UART_portInit(), SPP_HAL_UART_read(), and SPP_HAL_UART_transmit().

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

Variable Documentation

◆ s_p_halPort

const SPP_HalPort_t* s_p_halPort = {NULL}
static

Pointer to the HAL ports struct.

Definition at line 20 of file hal.c.

Referenced by SPP_HAL_getPort(), and SPP_HAL_init().