XDK API  3.6.0
Documentation
Modules | Files | Data Structures | Macros | Typedefs | Enumerations | Functions

The Hardware Abstraction Layer Interface. More...

+ Collaboration diagram for HAL:

Modules

 BSP
 The board support package.
 
 MCU
 The MCU abstraction.
 

Files

file  BCDS_HAL.h
 

Data Structures

struct  HAL_DeviceHandle_S
 Device specific handle. More...
 

Macros

#define HAL_RETURN_CODE_RANGE   (UINT32_C(50))
 Defines the number of return codes that can be used by each HAL component. More...
 

Typedefs

typedef struct HAL_DeviceHandle_S HAL_DeviceHandle_T
 The data type for the Device specific handle. More...
 
typedef void * HWHandle_T
 A data type for a general purpose hardware handle. More...
 
typedef void * SWHandle_T
 A data type for a general purpose software handle. More...
 

Enumerations

enum  BCDS_HAL_CallMode_E
 Declares an enumeration for various possible API call modes. More...
 
enum  BCDS_HAL_HalRetcode_E
 Declares the return codes used by the HAL components. More...
 
enum  BCDS_HAL_InterfaceType_E
 Declares an enumeration for various possible communication interfaces. More...
 
enum  BCDS_HAL_TransferMode_E
 Declares an enumeration for various possible transfer modes of communication interfaces. More...
 

Functions

bool HAL_IsInISR (void)
 return the Status if we run in ISR Context or not More...
 

Detailed Description

This component defines several modules that provide interfaces to abstract certain hardware related aspects.


Data Structure Documentation

struct HAL_DeviceHandle_S

A call to BSP_<deviceX>_getHandle will return a reference to a structure of this type holding all necessary parameters to operate all instances of that specific device

+ Collaboration diagram for HAL_DeviceHandle_S:

Data Fields

HWHandle_T const BusHandle
 
SWHandle_T const DeviceConfig
 
int32_t const DeviceId
 
enum BCDS_HAL_InterfaceType_E const InterfaceType
 
struct HAL_DeviceHandle_S *const NextDevice
 
SWHandle_T volatile SWAttribute
 

Field Documentation

HWHandle_T const BusHandle

The Handle of the communication interface e.g. in I2C it would reference a variable of type struct MCU_SPI_Handle_T

SWHandle_T const DeviceConfig

An abstract type holding device specific configuration e.g in I2C this would hold the device address

int32_t const DeviceId

An Id given by the BSP to this particular device

enum BCDS_HAL_InterfaceType_E const InterfaceType

The type of the communication interface used to communicate to the device

struct HAL_DeviceHandle_S* const NextDevice

Pointer to the reference of the next device of the same type in the board

SWHandle_T volatile SWAttribute

An OS aware driver would here hold a reference to a struct holding attributes needed to safely operate this particular communication bus e.g locks or synchronizing signals

Macro Definition Documentation

#define HAL_RETURN_CODE_RANGE   (UINT32_C(50))

Defines the number of return codes that can be defined for each HAL component.

Typedef Documentation

typedef void* HWHandle_T
typedef void* SWHandle_T

Enumeration Type Documentation

Enumerator
BCDS_HAL_CALL_MODE_NON_BLOCKING 

Returns before operation completed and caller expects a callback upon completion

BCDS_HAL_CALL_MODE_BLOCKING 

Blocks function return until operation finished

For each component there is a defined range of return codes reserved. The maximum number of codes available for a component is defined by HAL_RETURN_CODE_RANGE.

Enumerator
RETCODE_HAL_GENERAL 
RETCODE_HAL_GENERAL_MAX 
RETCODE_UART_GENERAL 

Start of UART return codes

RETCODE_UART_INIT_FAIL 
RETCODE_UART_HAL_ERROR 
RETCODE_UART_HAL_BUSY 
RETCODE_UART_HAL_TIMEOUT 
RETCODE_UART_DMA_ERROR 
RETCODE_UART_MAX 

End of UART return codes

RETCODE_LEUART_GENERAL 

Start of LEUART return codes

RETCODE_LEUART_INIT_FAIL 
RETCODE_LEUART_HAL_ERROR 
RETCODE_LEUART_HAL_BUSY 
RETCODE_LEUART_HAL_TIMEOUT 
RETCODE_LEUART_DMA_ERROR 
RETCODE_LEUART_MAX 

End of LEUART return codes

RETCODE_IC2_GENERAL 

General I2C return code

RETCODE_IC2_MAX 

End of I2C return codes

RETCODE_SLEEP_GENERAL 

General Sleep return code

RETCODE_SLEEP_NOSLEEP 

No Sleep Possible

RETCODE_SLEEP_MAX 

End of SLEEP return codes

RETCODE_TIMER_GENERAL 

General Timer return code

RETCODE_TIMER_NOHWHANDLE 

No hardware handle was provided

RETCODE_TIMER_NOINIT 

Timer handle was not initialized

RETCODE_TIMER_ALREADY_INITIALIZED 
RETCODE_TIMER_IS_ACTIVE 
RETCODE_TIMER_IS_NOT_ACTIVE 
RETCODE_TIMER_INIT_FAIL 
RETCODE_TIMER_DEINIT_FAIL 
RETCODE_TIMER_START_FAIL 
RETCODE_TIMER_STOP_FAIL 
RETCODE_TIMER_MAX 

End of TIMER return codes

RETCODE_RNG_HAL_ERROR 
RETCODE_RNG_HAL_BUSY 
RETCODE_RNG_HAL_TIMEOUT 
RETCODE_CRC_HAL_INIT_FAIL 
RETCODE_CRC_HAL_DEINIT_FAIL 

A field of this type is e.g. used by the BSP in the handlers that are created for communication devices to inform the MCU module about the interface type that is configured for a device.

Enumerator
BCDS_HAL_INTERFACE_NONE 

Undefined / Default / None of the bus communication interface is used

BCDS_HAL_INTERFACE_SPI 

SPI is used as the communication interface

BCDS_HAL_INTERFACE_I2C 

I2C is used as the communication interface

BCDS_HAL_INTERFACE_UART 

UART is used as the communication interface

A field of this type is e.g. used by the BSP in the handlers that are created for communication devices to inform the MCU module about the transfer mode that is configured for a device.

Enumerator
BCDS_HAL_TRANSFER_MODE_BLOCKING 
Deprecated:
. Use BCDS_HAL_CallMode_E instead
BCDS_HAL_TRANSFER_MODE_INTERRUPT 

BCDS_HAL_TRANSFER_MODE_INTERRUPT

BCDS_HAL_TRANSFER_MODE_DMA 

BCDS_HAL_TRANSFER_MODE_DMA

BCDS_HAL_TRANSFER_MODE_INTERRUPT_RX_DMA_TX 
BCDS_HAL_TRANSFER_MODE_INTERRUPT_TX_DMA_RX 

BCDS_HAL_TRANSFER_MODE_INTERRUPT_RX_DMA_TX

Function Documentation

bool HAL_IsInISR ( void  )
Return values
TRUEif we are in Isr Context

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:53 by doxygen 1.8.8