|
template<class... Signals> |
static void | connect (Gpio::InputType inputType=Gpio::InputType::Floating) |
|
template<class SystemClock , bitrate_t bitrate = kbps(125), percent_t tolerance = pct(1), bitrate_t fastDataBitrate = 0> |
static void | initialize (uint32_t interruptPriority, Mode startupMode=Mode::Normal, bool overwriteOnOverrun=true) |
|
static void | setMode (Mode mode) |
|
static void | setAutomaticRetransmission (bool retransmission) |
|
static bool | isMessageAvailable () |
|
static bool | isReadyToSend () |
|
static bool | getMessage (can::Message &message, uint8_t *filter_id=nullptr, uint16_t *timestamp=nullptr) |
|
static bool | sendMessage (const can::Message &message) |
|
static bool | setStandardFilter (uint8_t standardIndex, FilterConfig config, modm::can::StandardIdentifier id, modm::can::StandardMask mask) |
|
static bool | setStandardFilter (uint8_t standardIndex, FilterConfig config, modm::can::StandardIdentifier id0, modm::can::StandardIdentifier id1) |
|
static bool | setStandardRangeFilter (uint8_t standardIndex, FilterConfig config, modm::can::StandardIdentifier first, modm::can::StandardIdentifier last) |
|
static bool | setExtendedFilter (uint8_t extendedIndex, FilterConfig config, modm::can::ExtendedIdentifier id, modm::can::ExtendedMask mask) |
|
static bool | setExtendedFilter (uint8_t extendedIndex, FilterConfig config, modm::can::ExtendedIdentifier id0, modm::can::ExtendedIdentifier id1) |
|
static bool | setExtendedRangeFilter (uint8_t extendedIndex, FilterConfig config, modm::can::ExtendedIdentifier first, modm::can::ExtendedIdentifier last) |
|
static void | clearStandardFilters () |
| Disable all standard filters, receive no standard frames.
|
|
static void | clearExtendedFilters () |
| Disable all extended filters, receive no extended frames.
|
|
static uint8_t | getReceiveErrorCounter () |
|
static uint8_t | getTransmitErrorCounter () |
|
static BusState | getBusState () |
|
static void | setErrorInterruptCallback (ErrorCallback callback) |
|
static ErrorCallback | getErrorInterruptCallback () |
|
static uint16_t | getCurrentTimestamp () |
|
static void | acknowledgeInterruptFlag () |
|
template<uint64_t available, uint64_t requested, percent_t tolerance> |
static void | assertBaudrateInTolerance () |
|
template<double available, double requested, percent_t tolerance> |
static void | assertDurationInTolerance () |
|
static void | configurePurpose () |
| configures a peripheral for a specific purpose
|
|
template<class... Signals> |
static void | connect () |
|
static bool | getInterruptFlag () |
| Read an interrupt flag.
|
|
static bool | getMessage (can::Message &message) |
| Returns true if a message was copied into the message buffer.
|
|
static void | getParameter () |
| returns a parameter
|
|
template<class SystemClock , bitrate_t bitrate = 125_kbps, percent_t tolerance = 1_pct> |
static void | initialize (Mode startupMode) |
|
static void | initialize () |
| initializes the peripheral, must be called before use.
|
|
static void | setParameter () |
| sets a parameter
|
|
FDCAN2 (CAN with Flexible Data-Rate)
The controller area network (CAN) subsystem consists of one CAN module, a shared Message RAM memory and a configuration block. The modules (FDCAN) are compliant with ISO 11898-1: 2015 (CAN protocol specification version 2.0 part A, B) and CAN FD protocol specification version 1.0. A Message RAM implements filters, receive FIFOs, transmit event FIFOs and transmit FIFOs. The RAM is 0.8 Kbyte per FDCAN instance, except for the H7 series, which has 10 Kbytes of total message RAM arbitrarily split between FDCAN instances.
This driver supports SW-managed/in-memory FIFOs which augment the hardware TX and RX FIFOs. Note that the HW TX queue defaults to FIFO order but can be configured to transmit the highest priority (lowest arbitration ID) frames first.
Filter
Up to 28 filters can be defined for 11-bit IDs, up to 8 filters for 29-bit IDs. The filter banks are not shared between the CAN instances.
You can set the in-memory (SW-managed) buffer size using the buffer.tx
and buffer.rx
parameters. If set to 0, filling a HW FIFO will immediately drop frames.
The tx_hw_queue_mode
configures the order in which frames are transmitted from the hardware buffers. "FIFO" transmits in the order frames were enqueued. "Priority" transmits the message with the lowest arbitration ID first.
- Author
- Raphael Lehmann raphael@rleh.de
-
Christopher Durand christopher.durand@rwth-aachen.de
-
Kaelin Laundry wasabifan@outlook.com