#include <CAN.h>
|
int | computeTimings (uint32_t target_bitrate, Timings &out_timings) |
|
virtual int16_t | send (const uavcan::CanFrame &frame, uavcan::MonotonicTime tx_deadline, uavcan::CanIOFlags flags) override |
|
virtual int16_t | receive (uavcan::CanFrame &out_frame, uavcan::MonotonicTime &out_ts_monotonic, uavcan::UtcTime &out_ts_utc, uavcan::CanIOFlags &out_flags) override |
|
virtual int16_t | configureFilters (const uavcan::CanFilterConfig *filter_configs, uint16_t num_configs) override |
|
virtual uint16_t | getNumFilters () const override |
|
void | handleTxMailboxInterrupt (uint8_t mailbox_index, bool txok, uint64_t utc_usec) |
|
bool | waitMsrINakBitStateChange (bool target_state) |
|
Definition at line 88 of file CAN.h.
◆ anonymous enum
◆ anonymous enum
◆ anonymous enum
Enumerator |
---|
MaxRxQueueCapacity | |
Definition at line 160 of file CAN.h.
◆ OperatingMode
Enumerator |
---|
NormalMode | |
SilentMode | |
Definition at line 164 of file CAN.h.
◆ PX4CAN()
PX4::PX4CAN::PX4CAN |
( |
bxcan::CanType * |
can, |
|
|
BusEvent * |
update_event, |
|
|
uint8_t |
self_index, |
|
|
uint8_t |
rx_queue_capacity |
|
) |
| |
|
inline |
◆ available()
int32_t PX4::PX4CAN::available |
( |
| ) |
|
|
override |
◆ begin()
bool PX4::PX4CAN::begin |
( |
uint32_t |
bitrate | ) |
|
|
override |
◆ canAcceptNewTxFrame()
bool PX4::PX4CAN::canAcceptNewTxFrame |
( |
const uavcan::CanFrame & |
frame | ) |
const |
◆ computeTimings()
int PX4::PX4CAN::computeTimings |
( |
uint32_t |
target_bitrate, |
|
|
Timings & |
out_timings |
|
) |
| |
|
private |
◆ configureFilters()
virtual int16_t PX4::PX4CAN::configureFilters |
( |
const uavcan::CanFilterConfig * |
filter_configs, |
|
|
uint16_t |
num_configs |
|
) |
| |
|
overrideprivatevirtual |
◆ discardTimedOutTxMailboxes()
void PX4::PX4CAN::discardTimedOutTxMailboxes |
( |
uavcan::MonotonicTime |
current_time | ) |
|
◆ end()
void PX4::PX4CAN::end |
( |
| ) |
|
|
inlineoverride |
◆ getErrorCount()
virtual uint64_t PX4::PX4CAN::getErrorCount |
( |
| ) |
const |
|
overridevirtual |
Total number of hardware failures and other kinds of errors (e.g. queue overruns). May increase continuously if the interface is not connected to the bus.
◆ getNumFilters()
virtual uint16_t PX4::PX4CAN::getNumFilters |
( |
| ) |
const |
|
inlineoverrideprivatevirtual |
◆ getPeakNumTxMailboxesUsed()
uint8_t PX4::PX4CAN::getPeakNumTxMailboxesUsed |
( |
| ) |
const |
|
inline |
Peak number of TX mailboxes used concurrently since initialization. Range is [1, 3]. Value of 3 suggests that priority inversion could be taking place.
Definition at line 240 of file CAN.h.
◆ getRxQueueLength()
unsigned PX4::PX4CAN::getRxQueueLength |
( |
| ) |
const |
Returns the number of frames pending in the RX queue. This is intended for debug use only.
◆ getVoluntaryTxAbortCount()
uint32_t PX4::PX4CAN::getVoluntaryTxAbortCount |
( |
| ) |
const |
|
inline |
Number of times the driver exercised library's requirement to abort transmission on first error. This is an atomic read, it doesn't require a critical section. See uavcan::CanIOFlagAbortOnError.
Definition at line 218 of file CAN.h.
◆ hadActivity()
bool PX4::PX4CAN::hadActivity |
( |
| ) |
|
Whether this iface had at least one successful IO since the previous call of this method. This is designed for use with iface activity LEDs.
◆ handleRxInterrupt()
void PX4::PX4CAN::handleRxInterrupt |
( |
uint8_t |
fifo_index, |
|
|
uint64_t |
utc_usec |
|
) |
| |
◆ handleTxInterrupt()
void PX4::PX4CAN::handleTxInterrupt |
( |
uint64_t |
utc_usec | ) |
|
◆ handleTxMailboxInterrupt()
void PX4::PX4CAN::handleTxMailboxInterrupt |
( |
uint8_t |
mailbox_index, |
|
|
bool |
txok, |
|
|
uint64_t |
utc_usec |
|
) |
| |
|
private |
◆ init()
int PX4::PX4CAN::init |
( |
const uint32_t |
bitrate, |
|
|
const OperatingMode |
mode |
|
) |
| |
Initializes the hardware CAN controller. Assumes:
- Iface clock is enabled
- Iface has been resetted via RCC
- Caller will configure NVIC by itself
◆ is_initialized()
bool PX4::PX4CAN::is_initialized |
( |
| ) |
|
|
override |
◆ isRxBufferEmpty()
bool PX4::PX4CAN::isRxBufferEmpty |
( |
| ) |
const |
◆ pollErrorFlagsFromISR()
void PX4::PX4CAN::pollErrorFlagsFromISR |
( |
| ) |
|
This method is used to count errors and abort transmission on error if necessary. This functionality used to be implemented in the SCE interrupt handler, but that approach was generating too much processing overhead, especially on disconnected interfaces.
Should be called from RX ISR, TX ISR, and select(); interrupts must be enabled.
◆ receive()
virtual int16_t PX4::PX4CAN::receive |
( |
uavcan::CanFrame & |
out_frame, |
|
|
uavcan::MonotonicTime & |
out_ts_monotonic, |
|
|
uavcan::UtcTime & |
out_ts_utc, |
|
|
uavcan::CanIOFlags & |
out_flags |
|
) |
| |
|
overrideprivatevirtual |
◆ reset()
void PX4::PX4CAN::reset |
( |
| ) |
|
|
override |
◆ send()
virtual int16_t PX4::PX4CAN::send |
( |
const uavcan::CanFrame & |
frame, |
|
|
uavcan::MonotonicTime |
tx_deadline, |
|
|
uavcan::CanIOFlags |
flags |
|
) |
| |
|
overrideprivatevirtual |
◆ set_update_event()
void PX4::PX4CAN::set_update_event |
( |
BusEvent * |
update_event | ) |
|
|
inline |
◆ tx_pending()
int32_t PX4::PX4CAN::tx_pending |
( |
| ) |
|
|
override |
◆ waitMsrINakBitStateChange()
bool PX4::PX4CAN::waitMsrINakBitStateChange |
( |
bool |
target_state | ) |
|
|
private |
◆ bitrate_
uint32_t PX4::PX4CAN::bitrate_ |
|
private |
◆ can_
◆ error_cnt_
uint64_t PX4::PX4CAN::error_cnt_ |
|
private |
◆ had_activity_
bool PX4::PX4CAN::had_activity_ |
|
private |
◆ initialized_
bool PX4::PX4CAN::initialized_ |
|
private |
◆ peak_tx_mailbox_index_
uint8_t PX4::PX4CAN::peak_tx_mailbox_index_ |
|
private |
◆ pending_tx_
◆ rx_queue_
◆ self_index_
const uint8_t PX4::PX4CAN::self_index_ |
|
private |
◆ served_aborts_cnt_
uint32_t PX4::PX4CAN::served_aborts_cnt_ |
|
private |
◆ TSR_ABRQx
◆ update_event_
The documentation for this class was generated from the following file:
- libraries/AP_HAL_PX4/CAN.h