Errors

Normative

The error codes a conformant Port driver reports. Development errors are only raised when development error reporting is enabled (see enable_development_error_reporting in Configuration Reference). The Port driver defines no runtime errors. Governed by CHI-PORT-MUST-11 and CHI-PORT-MUST-12 in Port — Requirements.

Development errors

When development error reporting is enabled, each API detects the conditions below and raises the listed error via LogM_Report with development-error level.

Development errors by API

API

Condition

Error id

Port_Init

Driver not in PORT_DRV_STATE_UNINIT

PORT_DEVERR_INVALID_STATE

Port_Init

configPtr is not NULL_PTR

PORT_DEVERR_PARAM_POINTER

Port_GetPinValue / Port_SetPinValue / Port_TogglePinValue

pinId is not a configured pin

PORT_DEVERR_PARAM_PIN

Port_SetPinValue

value out of range

PORT_DEVERR_PARAM_PIN_VALUE

Port_GetPortValue / Port_SetMaskedPortValue

portId out of range for the HW setup

PORT_DEVERR_PARAM_PORT

Port_SetEdgeDetection

Driver not initialized

PORT_DEVERR_UNINIT

Port_SetEdgeDetection

pinId is not a configured pin

PORT_DEVERR_PARAM_PIN

Port_SetEdgeDetection

edgeConfig selection not supported

PORT_DEVERR_PARAM_EDGE_CONFIG

Development error code group

Development error type

Defines

PORT_DEVERR_UNINIT (1U)

API service called without initialization

PORT_DEVERR_INVALID_STATE (2U)

API service called with an invalid state

PORT_DEVERR_PARAM_POINTER (3U)

API service called with invalid pointer parameter.

PORT_DEVERR_PARAM_PORT (4U)

API service called with invalid port ID

PORT_DEVERR_PARAM_PIN (5U)

API service called with invalid pin ID

PORT_DEVERR_PARAM_PIN_VALUE (6U)

API service called with invalid pin value

PORT_DEVERR_PARAM_EDGE_CONFIG (7U)

API service called with invalid edge detection configuration (e.g. part of the edge detection function is not supported by the HW)

Available via: Port_DriverTypes.h. Vendor-specific error definitions MUST be provided via Port.h instead.