From b35e60e72058343ae18755af6abbda8615964b58 Mon Sep 17 00:00:00 2001 From: Firas Hamdi Date: Tue, 14 May 2024 09:56:03 +0200 Subject: [PATCH] cpu/samd5x: add CAN error codes --- cpu/samd5x/include/candev_samd5x.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpu/samd5x/include/candev_samd5x.h b/cpu/samd5x/include/candev_samd5x.h index 3e065f93d8..6e6583e6bd 100644 --- a/cpu/samd5x/include/candev_samd5x.h +++ b/cpu/samd5x/include/candev_samd5x.h @@ -75,6 +75,16 @@ extern "C" { #define CANDEV_SAMD5X_MAX_TX_BUFFER 32 #define CANDEV_SAMD5X_MSG_RAM_MAX_SIZE 448 +/* SAMD5x CAN controller error codes (values from datasheet section 39.8.14) */ +#define CANDEV_SAMD5X_NO_ERROR 0 +#define CANDEV_SAMD5X_STUFF_ERROR 1 +#define CANDEV_SAMD5X_FORM_ERROR 2 +#define CANDEV_SAMD5X_ACK_ERROR 3 +#define CANDEV_SAMD5X_BIT1_ERROR 4 +#define CANDEV_SAMD5X_BIT0_ERROR 5 +#define CANDEV_SAMD5X_CRC_ERROR 6 +#define CANDEV_SAMD5X_NO_CHANGE_ERROR 7 + /** * @brief CAN device configuration descriptor */