PSoC 6 Hardware Abstraction Layer (HAL)
HWMGR (Hardware Manager)

General Description

High level interface for interacting with the Cypress Hardware Manager.

This provides two related functions:

Macros

#define CYHAL_HWMGR_RSLT_ERR_INVALID   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 0))
 
#define CYHAL_HWMGR_RSLT_ERR_INUSE   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 1))
 
#define CYHAL_HWMGR_RSLT_ERR_NONE_FREE   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 2))
 
#define CYHAL_HWMGR_RSLT_WARN_UNUSED   (CY_RSLT_CREATE(CY_RSLT_TYPE_WARNING, CYHAL_RSLT_MODULE_CHIP_HWMGR, 50))
 

Functions

cy_rslt_t cyhal_hwmgr_init ()
 
cy_rslt_t cyhal_hwmgr_reserve (const cyhal_resource_inst_t *obj)
 
void cyhal_hwmgr_free (const cyhal_resource_inst_t *obj)
 
cy_rslt_t cyhal_hwmgr_allocate (cyhal_resource_t type, cyhal_resource_inst_t *obj)
 
cy_rslt_t cyhal_hwmgr_allocate_clock (cyhal_clock_divider_t *obj, cyhal_clock_divider_types_t div, bool accept_larger)
 
void cyhal_hwmgr_free_clock (cyhal_clock_divider_t *obj)
 

Macro Definition Documentation

◆ CYHAL_HWMGR_RSLT_ERR_INVALID

#define CYHAL_HWMGR_RSLT_ERR_INVALID   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 0))

The requested resource type is invalid

◆ CYHAL_HWMGR_RSLT_ERR_INUSE

#define CYHAL_HWMGR_RSLT_ERR_INUSE   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 1))

The requested resource is already in use

◆ CYHAL_HWMGR_RSLT_ERR_NONE_FREE

#define CYHAL_HWMGR_RSLT_ERR_NONE_FREE   (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CYHAL_RSLT_MODULE_CHIP_HWMGR, 2))

No resources of the requested type are available

◆ CYHAL_HWMGR_RSLT_WARN_UNUSED

#define CYHAL_HWMGR_RSLT_WARN_UNUSED   (CY_RSLT_CREATE(CY_RSLT_TYPE_WARNING, CYHAL_RSLT_MODULE_CHIP_HWMGR, 50))

Attempt to free a resource that was not used

Function Documentation

◆ cyhal_hwmgr_init()

cy_rslt_t cyhal_hwmgr_init ( )

Initializes the hardware manager to keep track of what resources are being used.

Returns
The status of the init request

◆ cyhal_hwmgr_reserve()

cy_rslt_t cyhal_hwmgr_reserve ( const cyhal_resource_inst_t *  obj)

Reserve the specified resource.

Parameters
[in]objThe resource object that should be reserved
Returns
The status of the reserve request

◆ cyhal_hwmgr_free()

void cyhal_hwmgr_free ( const cyhal_resource_inst_t *  obj)

Free the specified resource to allow it to be used by something else.

Parameters
[in,out]objThe resource object to free

◆ cyhal_hwmgr_allocate()

cy_rslt_t cyhal_hwmgr_allocate ( cyhal_resource_t  type,
cyhal_resource_inst_t *  obj 
)

Allocates a free block of the specified type if available

Parameters
[in]typeThe type of resource to allocate
[out]objThe resource object that was allocated
Returns
The status of the allocate request

◆ cyhal_hwmgr_allocate_clock()

cy_rslt_t cyhal_hwmgr_allocate_clock ( cyhal_clock_divider_t *  obj,
cyhal_clock_divider_types_t  div,
bool  accept_larger 
)

Allocate (pick and reserve) an Clock Divider resource and provide a reference to it.

Parameters
[out]objThe resource object that was allocated
[in]divThe type of divider to allocate
[in]accept_largerWhether a larger type can be provided if there are none of the requested size available
Returns
The status of the reserve request

◆ cyhal_hwmgr_free_clock()

void cyhal_hwmgr_free_clock ( cyhal_clock_divider_t *  obj)

Free the specified Clock Divider resource and allow it be used by something else.

Parameters
[in]objThe resource object that was allocated