#include <modm/architecture/interface/can.hpp>
|
static constexpr size_t | RxBufferSize = 16 |
| Size of the receive buffer.
|
|
static constexpr size_t | TxBufferSize = 16 |
| Size of the transmit buffer.
|
|
Enum Values | Documentation |
---|
Connected | This bit is set by hardware when the warning limit has been reached (Receive Error Counter or Transmit Error Counter ≥ 96).
|
ErrorWarning | This bit is set by hardware when the Error Passive limit has been reached (Receive Error Counter or Transmit Error Counter > 127).
|
ErrorPassive | This bit is set by hardware when it enters the bus-off state. The bus-off state is entered on TEC overflow, greater than 255
|
Possible modes of the CAN controller.
Enum Values | Documentation |
---|
Normal | standard operation mode
|
ListenOnly | only possible to receive messages
|
LoopBack | messages sent are immediately received by own controller
|
ListenOnlyLoopBack | combination of both modes
|
static void modm::PeripheralDriver::acknowledgeInterruptFlag |
( |
| ) |
|
|
inheritedstatic |
Acknowledge an interrupt flag.
We use acknowledge here, since it describes the intention rather than the actual implementation.
template<uint64_t available, uint64_t requested, percent_t tolerance>
static void modm::PeripheralDriver::assertBaudrateInTolerance |
( |
| ) |
|
|
inheritedinlinestatic |
Since baudrates are usually generated by prescaling a system clock, only several distinct values can be generated. This method checks if the user requested baudrate is within error tolerance of the system achievable baudrate.
template<class... Signals>
static void modm::Can::connect |
( |
| ) |
|
|
static |
Configures the Tx and Rx signals and connects them.
- Template Parameters
-
Signals | One Tx and one Rx signal are required and can be passed out-of-order. |
template<class SystemClock , bitrate_t bitrate = 125_kbps, percent_t tolerance = 1_pct>
static void modm::Can::initialize |
( |
Mode |
startupMode | ) |
|
|
static |
Initializes the hardware and sets the baudrate.
- Template Parameters
-
SystemClock | the currently active system clock |
bitrate | the desired bitrate in Hz |
tolerance | the allowed relative tolerance for the resulting baudrate |
static bool modm::Can::isReadyToSend |
( |
| ) |
|
|
static |
The CAN controller has a free slot to send a new message.
- Returns
- true if a slot is available, false otherwise
static bool modm::Can::sendMessage |
( |
const can::Message & |
message | ) |
|
|
static |
Send a message over the CAN.
- Returns
- true if the message was send, false otherwise
The documentation for this class was generated from the following file:
- architecture/interface/can.hpp