Internal Interface Wrap
API reference
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
EspCan.cpp File Reference

ESP32 CAN (TWAI) implementation for the HardFOC system - ESP-IDF v5.5 Compatible. More...

#include "EspCan.h"
#include <algorithm>
#include <climits>
#include <cstring>
#include "esp_log.h"
#include "esp_timer.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/task.h"
Include dependency graph for EspCan.cpp:

Namespaces

namespace  anonymous_namespace{EspCan.cpp}
 

Functions

TickType_t anonymous_namespace{EspCan.cpp}::MsToTicksCeil (hf_u32_t timeout_ms) noexcept
 Milliseconds to ticks, rounded up so a non-zero timeout never becomes 0 ticks.
 
int anonymous_namespace{EspCan.cpp}::ToTwaiTimeout (hf_u32_t timeout_ms) noexcept
 BaseCan timeout to the TWAI driver's int timeout (-1 = forever).
 
hf_can_bus_state_t anonymous_namespace{EspCan.cpp}::MapTwaiState (twai_error_state_t state) noexcept
 TWAI driver error state to hf_can_bus_state_t.
 

Variables

static const char * TAG = "EspCan"
 

Detailed Description

ESP32 CAN (TWAI) implementation for the HardFOC system - ESP-IDF v5.5 Compatible.

This file provides a comprehensive CAN bus implementation for the ESP32 microcontroller family using modern ESP-IDF v5.5+ TWAI node-based APIs. The implementation provides advanced features for ESP32 with external SN65 transceivers.

Key Features Implemented:

Author
Nebiyu Tadesse
Date
2025
Note
This implementation requires ESP-IDF v5.5 or later
Requires ESP-IDF v5.5 or later for full feature support

Variable Documentation

◆ TAG

const char* TAG = "EspCan"
static