Cypress middleware APIs return results of type cy_rslt_t.
It consists of three parts:
Module base Type Library-specific error code +-----------------------------------+------+------------------------------+ |CY_RSLT_MODULE_ECM_BASE | 0x2 | Error code | +-----------------------------------+------+------------------------------+ 14 bits 2 bits 16 bits See the macro section of this document for library-specific error codes.
The data structure cy_rslt_t is part of cy_result.h located in <core_lib/include>.
Module base: This base is derived from CY_RSLT_MODULE_MIDDLEWARE_BASE (defined in cy_result.h) and is an offset of the CY_RSLT_MODULE_MIDDLEWARE_BASE. The details of the offset and the middleware base are defined in cy_result_mw.h, that is part of GitHub connectivity-utilities For example, Ethernet Connection Manager (ECM) uses CY_RSLT_MODULE_ECM_BASE as the module base.
Type: This type is defined in cy_result.h and can be one of CY_RSLT_TYPE_FATAL, CY_RSLT_TYPE_ERROR, CY_RSLT_TYPE_WARNING, or CY_RSLT_TYPE_INFO. ECM library error codes are of type CY_RSLT_TYPE_ERROR.
Library-specific error code: These error codes are library-specific and defined in the macro section.
Helper macros used for creating the library-specific result are provided as part of cy_result.h.