libuav original
Dependents: UAVCAN UAVCAN_Subscriber
CanInitHelper< RxQueueCapacity > Class Template Reference
Helper class. More...
#include <can.hpp>
Public Member Functions | |
int | init (uavcan::uint32_t bitrate) |
This overload simply configures the provided bitrate. | |
template<typename DelayCallable > | |
int | init (DelayCallable delay_callable, uavcan::uint32_t &inout_bitrate=BitRateAutoDetect) |
This function can either initialize the driver at a fixed bit rate, or it can perform automatic bit rate detection. | |
Static Public Member Functions | |
static uavcan::MonotonicDuration | getRecommendedListeningDelay () |
Use this value for listening delay during automatic bit rate detection. |
Detailed Description
template<unsigned RxQueueCapacity = 128>
class uavcan_stm32::CanInitHelper< RxQueueCapacity >
Helper class.
Normally only this class should be used by the application. 145 usec per Extended CAN frame @ 1 Mbps, e.g. 32 RX slots * 145 usec --> 4.6 msec before RX queue overruns.
Definition at line 293 of file drivers/stm32/driver/include/uavcan_stm32/can.hpp.
Member Function Documentation
static uavcan::MonotonicDuration getRecommendedListeningDelay | ( | ) | [static] |
Use this value for listening delay during automatic bit rate detection.
Definition at line 376 of file drivers/stm32/driver/include/uavcan_stm32/can.hpp.
int init | ( | uavcan::uint32_t | bitrate ) |
This overload simply configures the provided bitrate.
Auto bit rate detection will not be performed. Bitrate value must be positive.
- Returns:
- Negative value on error; non-negative on success. Refer to constants Err*.
Definition at line 312 of file drivers/stm32/driver/include/uavcan_stm32/can.hpp.
int init | ( | DelayCallable | delay_callable, |
uavcan::uint32_t & | inout_bitrate = BitRateAutoDetect |
||
) |
This function can either initialize the driver at a fixed bit rate, or it can perform automatic bit rate detection.
For theory please refer to the CiA application note #801.
- Parameters:
-
delay_callable A callable entity that suspends execution for strictly more than one second. The callable entity will be invoked without arguments. getRecommendedListeningDelay(). inout_bitrate Fixed bit rate or zero. Zero invokes the bit rate detection process. If auto detection was used, the function will update the argument with established bit rate. In case of an error the value will be undefined.
- Returns:
- Negative value on error; non-negative on success. Refer to constants Err*.
Definition at line 332 of file drivers/stm32/driver/include/uavcan_stm32/can.hpp.
Generated on Tue Jul 12 2022 17:17:38 by 1.7.2