Sfoglia il codice sorgente

CMSIS Driver: Updated CAN API V1.2 (issue #179: added Bus-off state)

Robert Rostohar 8 anni fa
parent
commit
3bb9b77f5f
2 ha cambiato i file con 13 aggiunte e 6 eliminazioni
  1. 3 1
      ARM.CMSIS.pdsc
  2. 10 5
      CMSIS/Driver/Include/Driver_CAN.h

+ 3 - 1
ARM.CMSIS.pdsc

@@ -15,6 +15,8 @@
       CMSIS-Core(M): 5.0.3 (see revision history for details)
       - Added MPU Functions for ARMv8-M for Cortex-M23/M33.
       CMSIS-Core(A): 1.0.1 (see revision history for details)
+      CMSIS-Driver:
+      - CAN Driver API V1.2.0
       CMSIS-RTOS:
       - RTX: added variant for Infineon XMC4 series affected by PMU_CM.001 errata
       CMSIS-RTOS2:
@@ -622,7 +624,7 @@ and 8-bit Java bytecodes in Jazelle state.
         <file category="header" name="CMSIS/Driver/Include/Driver_I2C.h" />
       </files>
     </api>
-    <api Cclass="CMSIS Driver" Cgroup="CAN" Capiversion="1.1.0" exclusive="0">
+    <api Cclass="CMSIS Driver" Cgroup="CAN" Capiversion="1.2.0" exclusive="0">
       <description>CAN Driver API for Cortex-M</description>
       <files>
         <file category="doc" name="CMSIS/Documentation/Driver/html/group__can__interface__gr.html"/>

+ 10 - 5
CMSIS/Driver/Include/Driver_CAN.h

@@ -15,13 +15,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
- * $Date:        2. Feb 2017
- * $Revision:    V1.1
+ * $Date:        13. Sept 2017
+ * $Revision:    V1.2
  *
  * Project:      CAN (Controller Area Network) Driver definitions
  */
 
 /* History:
+ *  Version 1.2
+ *    Added ARM_CAN_UNIT_STATE_BUS_OFF unit state and
+ *    ARM_CAN_EVENT_UNIT_INACTIVE unit event
  *  Version 1.1
  *    ARM_CAN_STATUS made volatile
  *  Version 1.0
@@ -38,7 +41,7 @@ extern "C"
 
 #include "Driver_Common.h"
 
-#define ARM_CAN_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1,1)  /* API version */
+#define ARM_CAN_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1,2)  /* API version */
 
 
 /****** CAN Bitrate selection codes *****/
@@ -151,9 +154,10 @@ typedef struct _ARM_CAN_MSG_INFO {
 #define ARM_CAN_NO_MESSAGE_AVAILABLE   (ARM_DRIVER_ERROR_SPECIFIC - 7)          ///< Message is not available
 
 /****** CAN Status codes *****/
-#define ARM_CAN_UNIT_STATE_INACTIVE    (0U)             ///< Unit state: Not active on bus (initialize or error bus off)
+#define ARM_CAN_UNIT_STATE_INACTIVE    (0U)             ///< Unit state: Not active on bus (initialization)
 #define ARM_CAN_UNIT_STATE_ACTIVE      (1U)             ///< Unit state: Active on bus (can generate active error frame)
 #define ARM_CAN_UNIT_STATE_PASSIVE     (2U)             ///< Unit state: Error passive (can not generate active error frame)
+#define ARM_CAN_UNIT_STATE_BUS_OFF     (3U)             ///< Unit state: Bus-off (can recover to active state)
 #define ARM_CAN_LEC_NO_ERROR           (0U)             ///< Last error code: No error
 #define ARM_CAN_LEC_BIT_ERROR          (1U)             ///< Last error code: Bit error
 #define ARM_CAN_LEC_STUFF_ERROR        (2U)             ///< Last error code: Bit stuffing error
@@ -174,10 +178,11 @@ typedef volatile struct _ARM_CAN_STATUS {
 
 
 /****** CAN Unit Event *****/
+#define ARM_CAN_EVENT_UNIT_INACTIVE    (0U)             ///< Unit entered Inactive state
 #define ARM_CAN_EVENT_UNIT_ACTIVE      (1U)             ///< Unit entered Error Active state
 #define ARM_CAN_EVENT_UNIT_WARNING     (2U)             ///< Unit entered Error Warning state (one or both error counters >= 96)
 #define ARM_CAN_EVENT_UNIT_PASSIVE     (3U)             ///< Unit entered Error Passive state
-#define ARM_CAN_EVENT_UNIT_BUS_OFF     (4U)             ///< Unit entered bus off state
+#define ARM_CAN_EVENT_UNIT_BUS_OFF     (4U)             ///< Unit entered Bus-off state
 
 /****** CAN Send/Receive Event *****/
 #define ARM_CAN_EVENT_SEND_COMPLETE    (1UL << 0)       ///< Send complete