# HG changeset patch # User sergeig # Date 1377707290 0 # Node ID edcc78939bd03a8ba78937bc16fc249693aedecd # Parent 1e90246544b4c321d0a1b3e59a79fd2bbe54f856 * include/canio.h: Added structure cyg_can_err_count_info for reading CAN hardware error counter values from CAN hardware. * doc/can.sgml: Documented new CAN config key CYG_IO_GET_CONFIG_ERR_COUNTERS. diff --git a/packages/io/can/current/ChangeLog b/packages/io/can/current/ChangeLog --- a/packages/io/can/current/ChangeLog +++ b/packages/io/can/current/ChangeLog @@ -1,3 +1,10 @@ +2013-06-24 Uwe Kindler + + * include/canio.h: Added structure cyg_can_err_count_info for reading + CAN hardware error counter values from CAN hardware. + * doc/can.sgml: Documented new CAN config key + CYG_IO_GET_CONFIG_ERR_COUNTERS. + 2013-05-06 Uwe Kindler * doc/can.sgml: Documented return code -ENOSPC for cyg_io_set_config() diff --git a/packages/io/can/current/doc/can.sgml b/packages/io/can/current/doc/can.sgml --- a/packages/io/can/current/doc/can.sgml +++ b/packages/io/can/current/doc/can.sgml @@ -664,6 +664,7 @@ CYG_IO_GET_CONFIG_CAN_MSGBUF_INFO CYG_IO_GET_CONFIG_CAN_TIMEOUT CYG_IO_GET_CONFIG_CAN_HDI CYG_IO_GET_CONFIG_CAN_STATE +CYG_IO_GET_CONFIG_CAN_ERR_COUNTERS @@ -1009,6 +1010,26 @@ present state of the CAN controller. Pos +
+Reading CAN hardware error counters + + +typedef struct cyg_can_err_count_info_st +{ + cyg_uint8 rx_err_count; + cyg_uint8 tx_err_count; +} cyg_can_err_count_info; + + + +Each CAN node maintains two error counters: the Transmit Error Counter (TEC) +and the Receive Error Counter (REC). There are several rules governing how +these counters are incremented and/or decremented. +CYG_IO_GET_CONFIG_CAN_ERR_COUNTERS retrieves the present +value of both error counters (TEC and REC). + +
+
Changing mode of CAN hardware diff --git a/packages/io/can/current/include/canio.h b/packages/io/can/current/include/canio.h --- a/packages/io/can/current/include/canio.h +++ b/packages/io/can/current/include/canio.h @@ -283,6 +283,16 @@ typedef struct cyg_can_timeout_info_st // +// For reading error counter values from CAN controller +// +typedef struct cyg_can_err_count_info_st +{ + cyg_uint8 rx_err_count; + cyg_uint8 tx_err_count; +} cyg_can_err_count_info; + + +// // this data type defines a handle to a message buffer or message box // of the CAN hardware device //