Defines a type and related utilities for function result handling.
The cy_rslt_t type is a structured bitfield which encodes information about result type, the originating module, and a code for the specific error (or warning etc). In order to extract these individual fields from a cy_rslt_t value, the utility macros CY_RSLT_GET_TYPE, CY_RSLT_GET_MODULE, and CY_RSLT_GET_CODE are provided. For example:
|
| typedef uint32_t | cy_rslt_t |
| | Provides the result of an operation as a structured bitfield. More...
|
| |
|
Utility macros for constructing result values and extracting individual fields from existing results.
|
| #define | CY_RSLT_GET_TYPE(x) (((x) >> CY_RSLT_TYPE_POSITION) & CY_RSLT_TYPE_MASK) |
| | Get the value of the result type field. More...
|
| |
| #define | CY_RSLT_GET_MODULE(x) (((x) >> CY_RSLT_MODULE_POSITION) & CY_RSLT_MODULE_MASK) |
| | Get the value of the module identifier field. More...
|
| |
| #define | CY_RSLT_GET_CODE(x) (((x) >> CY_RSLT_CODE_POSITION) & CY_RSLT_CODE_MASK) |
| | Get the value of the result code field. More...
|
| |
| #define | CY_RSLT_CREATE(type, module, code) |
| | Create a new cy_rslt_t value that encodes the specified type, module, and result code.
More...
|
| |
◆ CY_RSLT_SUCCESS
| #define CY_RSLT_SUCCESS ((cy_rslt_t)0x00000000U) |
◆ CY_RSLT_GET_TYPE
| #define CY_RSLT_GET_TYPE |
( |
|
x | ) |
(((x) >> CY_RSLT_TYPE_POSITION) & CY_RSLT_TYPE_MASK) |
Get the value of the result type field.
- Parameters
-
| x | the cy_rslt_t value from which to extract the result type |
◆ CY_RSLT_GET_MODULE
| #define CY_RSLT_GET_MODULE |
( |
|
x | ) |
(((x) >> CY_RSLT_MODULE_POSITION) & CY_RSLT_MODULE_MASK) |
Get the value of the module identifier field.
- Parameters
-
| x | the cy_rslt_t value from which to extract the module id |
◆ CY_RSLT_GET_CODE
| #define CY_RSLT_GET_CODE |
( |
|
x | ) |
(((x) >> CY_RSLT_CODE_POSITION) & CY_RSLT_CODE_MASK) |
Get the value of the result code field.
- Parameters
-
| x | the cy_rslt_t value from which to extract the result code |
◆ CY_RSLT_CREATE
| #define CY_RSLT_CREATE |
( |
|
type, |
|
|
|
module, |
|
|
|
code |
|
) |
| |
Value:((((module) & CY_RSLT_MODULE_MASK) << CY_RSLT_MODULE_POSITION) | \
(((code) & CY_RSLT_CODE_MASK) << CY_RSLT_CODE_POSITION) | \
(((type) & CY_RSLT_TYPE_MASK) << CY_RSLT_TYPE_POSITION))
Create a new cy_rslt_t value that encodes the specified type, module, and result code.
- Parameters
-
◆ CY_RSLT_MODULE_DRIVERS_PDL_BASE
| #define CY_RSLT_MODULE_DRIVERS_PDL_BASE (0x0000U) |
Base identifier for peripheral driver library modules (0x0000 - 0x007F)
◆ CY_RSLT_MODULE_DRIVERS_WHD_BASE
| #define CY_RSLT_MODULE_DRIVERS_WHD_BASE (0x0080U) |
Base identifier for wireless host driver library modules (0x0080 - 0x00FF)
◆ CY_RSLT_MODULE_ABSTRACTION_HAL_BASE
| #define CY_RSLT_MODULE_ABSTRACTION_HAL_BASE (0x0100U) |
Base identifier for HAL modules (0x0100 - 0x017F)
◆ CY_RSLT_MODULE_ABSTRACTION_BSP
| #define CY_RSLT_MODULE_ABSTRACTION_BSP (0x0180U) |
Module identifier for board support package
◆ CY_RSLT_MODULE_ABSTRACTION_FS
| #define CY_RSLT_MODULE_ABSTRACTION_FS (0x0181U) |
Module identifier for file system abstraction
◆ CY_RSLT_MODULE_ABSTRACTION_RESOURCE
| #define CY_RSLT_MODULE_ABSTRACTION_RESOURCE (0x0182U) |
Module identifier for resource abstraction
◆ CY_RSLT_MODULE_ABSTRACTION_OS
| #define CY_RSLT_MODULE_ABSTRACTION_OS (0x0183U) |
Module identifier for rtos abstraction
◆ CY_RSLT_MODULE_ABSTRACTION_ENV
| #define CY_RSLT_MODULE_ABSTRACTION_ENV (0x0184U) |
Base identifier for environment abstraction modules (0x0184 - 0x01FF)
◆ CY_RSLT_MODULE_BOARD_LIB_BASE
| #define CY_RSLT_MODULE_BOARD_LIB_BASE (0x01A0U) |
Base identifier for Board Library modules (0x01A0 - 0x01BF)
◆ CY_RSLT_MODULE_BOARD_LIB_RETARGET_IO
| #define CY_RSLT_MODULE_BOARD_LIB_RETARGET_IO (0x1A0U) |
Module identifier for the Retarget IO Board Library
◆ CY_RSLT_MODULE_BOARD_LIB_RGB_LED
| #define CY_RSLT_MODULE_BOARD_LIB_RGB_LED (0x01A1U) |
Module identifier for the RGB LED Board Library
◆ CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH
| #define CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH (0x01A2U) |
Module identifier for the Serial Flash Board Library
◆ CY_RSLT_MODULE_MIDDLEWARE_BASE
| #define CY_RSLT_MODULE_MIDDLEWARE_BASE (0x0200U) |
Base identifier for Middleware module codes (0x0200 - 0x02FF)
◆ cy_rslt_t
Provides the result of an operation as a structured bitfield.
See the General Description for more details on structure and usage.