|
| enum class | hf_can_err_t : hf_u8_t {
X
, CAN_SUCCESS = 0
, CAN_ERR_FAILURE = 1
, CAN_ERR_NOT_INITIALIZED = 2
,
CAN_ERR_ALREADY_INITIALIZED = 3
, CAN_ERR_INVALID_PARAMETER = 4
, CAN_ERR_NULL_POINTER = 5
, CAN_ERR_OUT_OF_MEMORY = 6
,
CAN_ERR_BUS_OFF = 7
, CAN_ERR_BUS_ERROR = 8
, CAN_ERR_BUS_BUSY = 9
, CAN_ERR_BUS_NOT_AVAILABLE = 10
,
CAN_ERR_BUS_RECOVERY_FAILED = 11
, CAN_ERR_BUS_ARBITRATION_LOST = 12
, CAN_ERR_MESSAGE_TIMEOUT = 13
, CAN_ERR_MESSAGE_LOST = 14
,
CAN_ERR_MESSAGE_INVALID = 15
, CAN_ERR_MESSAGE_TOO_LONG = 16
, CAN_ERR_MESSAGE_INVALID_ID = 17
, CAN_ERR_MESSAGE_INVALID_DLC = 18
,
CAN_ERR_QUEUE_FULL = 19
, CAN_ERR_QUEUE_EMPTY = 20
, CAN_ERR_TX_FAILED = 21
, CAN_ERR_TX_ABORTED = 22
,
CAN_ERR_TX_ERROR_PASSIVE = 23
, CAN_ERR_TX_ERROR_WARNING = 24
, CAN_ERR_RX_OVERRUN = 25
, CAN_ERR_RX_ERROR_PASSIVE = 26
,
CAN_ERR_RX_ERROR_WARNING = 27
, CAN_ERR_RX_FIFO_FULL = 28
, CAN_ERR_HARDWARE_FAULT = 29
, CAN_ERR_COMMUNICATION_FAILURE = 30
,
CAN_ERR_DEVICE_NOT_RESPONDING = 31
, CAN_ERR_VOLTAGE_OUT_OF_RANGE = 32
, CAN_ERR_CLOCK_ERROR = 33
, CAN_ERR_TRANSCEIVER_ERROR = 34
,
CAN_ERR_INVALID_CONFIGURATION = 35
, CAN_ERR_UNSUPPORTED_OPERATION = 36
, CAN_ERR_INVALID_BAUD_RATE = 37
, CAN_ERR_INVALID_CONTROLLER_ID = 38
,
CAN_ERR_FILTER_ERROR = 39
, CAN_ERR_FILTER_FULL = 40
, CAN_ERR_STUFF_ERROR = 41
, CAN_ERR_FORM_ERROR = 42
,
CAN_ERR_CRC_ERROR = 43
, CAN_ERR_ACK_ERROR = 44
, CAN_ERR_BIT_ERROR = 45
, CAN_ERR_SYSTEM_ERROR = 46
,
CAN_ERR_PERMISSION_DENIED = 47
, CAN_ERR_OPERATION_ABORTED = 48
, CAN_ERR_FAIL = 49
, CAN_ERR_RESOURCE_BUSY = 50
,
CAN_ERR_INVALID_STATE = 51
, CAN_ERR_NOT_SUPPORTED = 52
, CAN_ERR_TIMEOUT_ALT = 53
, CAN_ERR_UNKNOWN = 54
} |
| |
| enum class | hf_can_frame_error_t : hf_u8_t {
NONE = 0
, ID_RANGE
, CLASSIC_TOO_LONG
, FD_TOO_LONG
,
FD_LENGTH_NOT_EXACT
, RTR_ON_FD
, FD_BITS_ON_CLASSIC
, RTR_WITH_DATA
} |
| | Why a frame is not well formed. More...
|
| |
| enum class | hf_can_bus_state_t : hf_u8_t {
STOPPED = 0
, ERROR_ACTIVE
, ERROR_WARNING
, ERROR_PASSIVE
,
BUS_OFF
} |
| | Controller error state (ISO 11898-1 fault confinement). More...
|
| |
Abstract base class for CAN bus implementations in the HardFOC system.
This header-only file defines the abstract base class for CAN bus communication that provides a consistent API across different CAN controller implementations. Concrete implementations for various microcontrollers inherit from this class.
ERROR HANDLING:
- All CAN error codes are defined in this file using the hf_can_err_t enumeration
- Lower-level types (McuTypes_CAN.h) maintain minimal error constants for compatibility
- All virtual methods return hf_can_err_t for comprehensive error reporting
- No legacy compatibility code - use hf_can_message_t structure for all operations
- Author
- Nebiyu Tadesse
- Date
- 2025
- Copyright
- HardFOC
- Note
- This is a header-only abstract base class following the same pattern as BaseAdc.
-
Users should program against this interface, not specific implementations.
-
All legacy camelCase types and bool-returning methods have been removed.