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

Stub HAL port for host-side unit testing. More...

#include "spp/hal/hal.h"
#include "spp/core/returnTypes.h"
#include "spp/core/types.h"
#include <stdint.h>
#include <sys/time.h>
Include dependency graph for halStub.c:

Go to the source code of this file.

Functions

static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiBusInit (void)
static void * SPP_PORTS_HAL_STUB_spiGetHandle (spp_uint8_t deviceIdx)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceInit (void *p_handle)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiTransmit (void *p_handle, spp_uint8_t *p_data, spp_uint8_t len)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceSetSpeed (void *p_handle, spp_uint32_t speedHz)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioConfigInterrupt (spp_uint32_t pin, spp_uint32_t t, spp_uint32_t pull)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioRegisterIsr (spp_uint32_t pin, void *p_ctx)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_storageInit (void)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_storageWrite (const void *p_buffer, spp_uint32_t first_block, spp_uint16_t count)
static spp_uint32_t SPP_PORTS_HAL_STUB_getTimeMs (void)
static void SPP_PORTS_HAL_STUB_delayMs (spp_uint32_t ms)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartPortInit (void)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartTransmit (const void *p_data, spp_uint32_t len)
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartRead (void *p_data, spp_uint32_t len, spp_uint32_t *p_readBytes)

Variables

const SPP_HalPort_t g_stubHalPort

Detailed Description

Stub HAL port for host-side unit testing.

All SPI, GPIO, UART, and storage functions return K_SPP_OK without doing any real hardware access. This allows the full SPP service layer to be exercised on a development machine without an attached MCU.

Definition in file halStub.c.

Function Documentation

◆ SPP_PORTS_HAL_STUB_spiBusInit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_spiBusInit ( void )
static

Definition at line 21 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_spiBusInit().

Referenced by SPP_PORTS_HAL_STUB_spiBusInit().

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

◆ SPP_PORTS_HAL_STUB_spiGetHandle()

void * SPP_PORTS_HAL_STUB_spiGetHandle ( spp_uint8_t deviceIdx)
static

Definition at line 22 of file halStub.c.

References SPP_PORTS_HAL_STUB_spiGetHandle().

Referenced by SPP_PORTS_HAL_STUB_spiGetHandle().

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

◆ SPP_PORTS_HAL_STUB_spiDeviceInit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceInit ( void * p_handle)
static

Definition at line 23 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_spiDeviceInit().

Referenced by SPP_PORTS_HAL_STUB_spiDeviceInit().

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

◆ SPP_PORTS_HAL_STUB_spiTransmit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_spiTransmit ( void * p_handle,
spp_uint8_t * p_data,
spp_uint8_t len )
static

Definition at line 24 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_spiTransmit().

Referenced by SPP_PORTS_HAL_STUB_spiTransmit().

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

◆ SPP_PORTS_HAL_STUB_spiDeviceSetSpeed()

SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceSetSpeed ( void * p_handle,
spp_uint32_t speedHz )
static

Definition at line 29 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_spiDeviceSetSpeed().

Referenced by SPP_PORTS_HAL_STUB_spiDeviceSetSpeed().

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

◆ SPP_PORTS_HAL_STUB_gpioConfigInterrupt()

SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioConfigInterrupt ( spp_uint32_t pin,
spp_uint32_t t,
spp_uint32_t pull )
static

Definition at line 35 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_gpioConfigInterrupt().

Referenced by SPP_PORTS_HAL_STUB_gpioConfigInterrupt().

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

◆ SPP_PORTS_HAL_STUB_gpioRegisterIsr()

SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioRegisterIsr ( spp_uint32_t pin,
void * p_ctx )
static

Definition at line 40 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_gpioRegisterIsr().

Referenced by SPP_PORTS_HAL_STUB_gpioRegisterIsr().

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

◆ SPP_PORTS_HAL_STUB_storageInit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_storageInit ( void )
static

Definition at line 42 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_storageInit().

Referenced by SPP_PORTS_HAL_STUB_storageInit().

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

◆ SPP_PORTS_HAL_STUB_storageWrite()

SPP_RetVal_t SPP_PORTS_HAL_STUB_storageWrite ( const void * p_buffer,
spp_uint32_t first_block,
spp_uint16_t count )
static

Definition at line 43 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_storageWrite().

Referenced by SPP_PORTS_HAL_STUB_storageWrite().

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

◆ SPP_PORTS_HAL_STUB_getTimeMs()

spp_uint32_t SPP_PORTS_HAL_STUB_getTimeMs ( void )
static

Definition at line 49 of file halStub.c.

References SPP_PORTS_HAL_STUB_getTimeMs().

Referenced by SPP_PORTS_HAL_STUB_getTimeMs().

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

◆ SPP_PORTS_HAL_STUB_delayMs()

void SPP_PORTS_HAL_STUB_delayMs ( spp_uint32_t ms)
static

Definition at line 56 of file halStub.c.

References SPP_PORTS_HAL_STUB_delayMs().

Referenced by SPP_PORTS_HAL_STUB_delayMs().

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

◆ SPP_PORTS_HAL_STUB_uartPortInit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_uartPortInit ( void )
static

Definition at line 58 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_uartPortInit().

Referenced by SPP_PORTS_HAL_STUB_uartPortInit().

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

◆ SPP_PORTS_HAL_STUB_uartTransmit()

SPP_RetVal_t SPP_PORTS_HAL_STUB_uartTransmit ( const void * p_data,
spp_uint32_t len )
static

Definition at line 59 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_uartTransmit().

Referenced by SPP_PORTS_HAL_STUB_uartTransmit().

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

◆ SPP_PORTS_HAL_STUB_uartRead()

SPP_RetVal_t SPP_PORTS_HAL_STUB_uartRead ( void * p_data,
spp_uint32_t len,
spp_uint32_t * p_readBytes )
static

Definition at line 60 of file halStub.c.

References K_SPP_OK, and SPP_PORTS_HAL_STUB_uartRead().

Referenced by SPP_PORTS_HAL_STUB_uartRead().

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

Variable Documentation

◆ g_stubHalPort

const SPP_HalPort_t g_stubHalPort
Initial value:
= {
.spi = {
},
.gpio = {
},
.storage = {
},
.time = {
},
.uart = {
},
}
static void * SPP_PORTS_HAL_STUB_spiGetHandle(spp_uint8_t deviceIdx)
Definition halStub.c:22
static SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioConfigInterrupt(spp_uint32_t pin, spp_uint32_t t, spp_uint32_t pull)
Definition halStub.c:35
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceInit(void *p_handle)
Definition halStub.c:23
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiTransmit(void *p_handle, spp_uint8_t *p_data, spp_uint8_t len)
Definition halStub.c:24
static SPP_RetVal_t SPP_PORTS_HAL_STUB_storageInit(void)
Definition halStub.c:42
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiDeviceSetSpeed(void *p_handle, spp_uint32_t speedHz)
Definition halStub.c:29
static SPP_RetVal_t SPP_PORTS_HAL_STUB_storageWrite(const void *p_buffer, spp_uint32_t first_block, spp_uint16_t count)
Definition halStub.c:43
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartTransmit(const void *p_data, spp_uint32_t len)
Definition halStub.c:59
static SPP_RetVal_t SPP_PORTS_HAL_STUB_spiBusInit(void)
Definition halStub.c:21
static spp_uint32_t SPP_PORTS_HAL_STUB_getTimeMs(void)
Definition halStub.c:49
static void SPP_PORTS_HAL_STUB_delayMs(spp_uint32_t ms)
Definition halStub.c:56
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartRead(void *p_data, spp_uint32_t len, spp_uint32_t *p_readBytes)
Definition halStub.c:60
static SPP_RetVal_t SPP_PORTS_HAL_STUB_uartPortInit(void)
Definition halStub.c:58
static SPP_RetVal_t SPP_PORTS_HAL_STUB_gpioRegisterIsr(spp_uint32_t pin, void *p_ctx)
Definition halStub.c:40

Definition at line 74 of file halStub.c.