High level interface for interacting with the Cypress Hardware Manager.
This provides two related functions:
- Allows HAL drivers (or application firmware) to mark specific hardware blocks as consumed, so that other firmware will not accidentally try to use the block for a conflicting purpose.
- For resources which are interchangeable, such as clock dividers, provides allocation and reservation of an available instance (if one exists).
◆ CYHAL_HWMGR_RSLT_ERR_INVALID
The requested resource type is invalid
◆ CYHAL_HWMGR_RSLT_ERR_INUSE
The requested resource is already in use
◆ CYHAL_HWMGR_RSLT_ERR_NONE_FREE
No resources of the requested type are available
◆ CYHAL_HWMGR_RSLT_WARN_UNUSED
Attempt to free a resource that was not used
◆ 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()
Reserve the specified resource.
- Parameters
-
| [in] | obj | The resource object that should be reserved |
- Returns
- The status of the reserve request
◆ cyhal_hwmgr_free()
Free the specified resource to allow it to be used by something else.
- Parameters
-
| [in,out] | obj | The resource object to free |
◆ cyhal_hwmgr_allocate()
Allocates a free block of the specified type if available
- Parameters
-
| [in] | type | The type of resource to allocate |
| [out] | obj | The resource object that was allocated |
- Returns
- The status of the allocate request
◆ cyhal_hwmgr_allocate_clock()
Allocate (pick and reserve) an Clock Divider resource and provide a reference to it.
- Parameters
-
| [out] | obj | The resource object that was allocated |
| [in] | div | The type of divider to allocate |
| [in] | accept_larger | Whether 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()
Free the specified Clock Divider resource and allow it be used by something else.
- Parameters
-
| [in] | obj | The resource object that was allocated |