|
| | StmCan (CAN_HandleTypeDef *hcan) noexcept |
| | Construct for bxCAN.
|
| |
| | StmCan (FDCAN_HandleTypeDef *hfdcan) noexcept |
| | Construct for FDCAN.
|
| |
| | StmCan (const hf_stm32_can_config_t &config) noexcept |
| | Construct from config struct.
|
| |
| | ~StmCan () noexcept override |
| |
| | StmCan (const StmCan &)=delete |
| |
| StmCan & | operator= (const StmCan &)=delete |
| |
| hf_can_err_t | Initialize () noexcept override |
| | Initialize the CAN controller (must be implemented by derived classes).
|
| |
| hf_can_err_t | Deinitialize () noexcept override |
| | Deinitialize the CAN controller (must be implemented by derived classes).
|
| |
| hf_can_err_t | SendMessage (const hf_can_message_t &message, hf_u32_t timeout_ms=1000) noexcept override |
| | Send a CAN message.
|
| |
| hf_can_err_t | ReceiveMessage (hf_can_message_t &message, hf_u32_t timeout_ms=0) noexcept override |
| | Receive a CAN message.
|
| |
| hf_can_err_t | SetReceiveCallback (hf_can_receive_callback_t callback) noexcept override |
| | Set callback for received messages.
|
| |
| hf_can_err_t | SetAcceptanceFilter (hf_u32_t id, hf_u32_t mask, bool extended=false) noexcept override |
| | Set acceptance filter for incoming messages.
|
| |
| hf_can_err_t | GetStatus (hf_can_status_t &status) noexcept override |
| | Get current CAN bus status.
|
| |
| hf_can_err_t | Reset () noexcept override |
| | Reset the CAN controller.
|
| |
| bool | SupportsCanFD () const noexcept override |
| | Check if CAN-FD is supported by this controller.
|
| |
| StmCanVariant | GetVariant () const noexcept |
| |
| void | NotifyRxFromIsr (const hf_can_message_t &msg) noexcept |
| | ISR helper — call from HAL CAN/FDCAN RX callback.
|
| |
| virtual | ~BaseCan () noexcept=default |
| | Virtual destructor ensures proper cleanup in derived classes.
|
| |
| | BaseCan (const BaseCan &)=delete |
| |
| BaseCan & | operator= (const BaseCan &)=delete |
| |
| | BaseCan (BaseCan &&)=delete |
| |
| BaseCan & | operator= (BaseCan &&)=delete |
| |
| bool | EnsureInitialized () noexcept |
| | Ensures that the CAN bus is initialized (lazy initialization).
|
| |
| bool | EnsureDeinitialized () noexcept |
| | Ensures that the CAN bus is deinitialized.
|
| |
| bool | IsInitialized () const noexcept |
| | Checks if the class is initialized.
|
| |
| virtual void | ClearReceiveCallback () noexcept |
| | Clear the receive callback.
|
| |
| virtual hf_can_err_t | ClearAcceptanceFilter () noexcept |
| | Clear all acceptance filters (accept all messages).
|
| |
| virtual hf_can_err_t | SetReceiveCallbackFD (hf_can_fd_receive_callback_t callback) noexcept |
| | Set CAN-FD receive callback with enhanced information.
|
| |
| virtual bool | SetCanFDMode (bool enable, hf_u32_t data_baudrate=2000000, hf_u32_t timeout_ms=1000) noexcept |
| | Enable or disable CAN-FD mode.
|
| |
| virtual bool | ConfigureCanFDTiming (hf_u16_t nominal_prescaler, hf_u8_t nominal_tseg1, hf_u8_t nominal_tseg2, hf_u16_t data_prescaler, hf_u8_t data_tseg1, hf_u8_t data_tseg2, hf_u8_t sjw=1) noexcept |
| | Configure CAN-FD timing parameters.
|
| |
| virtual bool | SetTransmitterDelayCompensation (hf_u8_t tdc_offset, hf_u8_t tdc_filter) noexcept |
| | Set transmitter delay compensation (CAN-FD feature).
|
| |
| virtual hf_u32_t | SendMessageBatch (const hf_can_message_t *messages, hf_u32_t count, hf_u32_t timeout_ms=1000) noexcept |
| | Send multiple messages in a batch.
|
| |
| virtual hf_u32_t | ReceiveMessageBatch (hf_can_message_t *messages, hf_u32_t max_count, hf_u32_t timeout_ms=100) noexcept |
| | Receive multiple messages in a batch.
|
| |
| virtual hf_can_err_t | ResetStatistics () noexcept |
| | Reset CAN operation statistics.
|
| |
| virtual hf_can_err_t | ResetDiagnostics () noexcept |
| | Reset CAN diagnostic information.
|
| |
| virtual hf_can_err_t | GetStatistics (hf_can_statistics_t &statistics) noexcept |
| | Get CAN operation statistics.
|
| |
| virtual hf_can_err_t | GetDiagnostics (hf_can_diagnostics_t &diagnostics) noexcept |
| | Get CAN diagnostic information.
|
| |
STM32 CAN implementation.
Design:
- Supports both bxCAN and FDCAN via a variant tag + union of handles.
- SendMessage/ReceiveMessage use blocking HAL calls.
- Acceptance filter wraps HAL filter configuration.
- Receive callback stored for ISR forwarding.