2.8.46 CANx_ErrorCountGet Function

The prototype of CANx_ErrorCountGet() varies based on device family. Refer to the generated header file for the actual prototype to be used.

C

void CANx_ErrorCountGet(uint8_t *txErrorCount, uint8_t *rxErrorCount) // x - Instance of the CAN peripheral

void CANx_ErrorCountGet(uint16_t *txErrorCount, uint8_t *rxErrorCount) // x - Instance of the CAN peripheral

Summary

Returns the transmit and receive error count during transfer.

Description

This routine returns the transmit and receive error count during transfer.

Precondition

CANx_Initialize must have been called for the associated CAN instance.

Parameters

ParamDescription
txErrorCountTransmit Error Count to be received
rxErrorCountReceive Error Count to be received

Returns

None.

Example

uint8_t txErrorCnt, rxErrorCnt;
CAN0_ErrorCountGet(&txErrorCnt, &rxErrorCnt);
uint16_t txErrorCount;
uint8_t rxErrorCount;
CAN0_ErrorCountGet(&txErrorCount, &rxErrorCount);

Remarks

None.