feat(can): Split filtering for multiple can peripherals

This commit is contained in:
CarlWachter
2024-09-11 16:28:58 +02:00
parent a6c92c9adc
commit f7f1b0bde0
2 changed files with 23 additions and 14 deletions

View File

@@ -46,8 +46,10 @@ namespace sta
public:
/**
* @param handle CAN handle
*
* @param filter_start Start index for filters (default: 0 for can1, 14 for can2)
*/
STM32CanController(CAN_HandleTypeDef * handle);
STM32CanController(CAN_HandleTypeDef * handle, uint32_t filter_start = 0);
/**
* @brief Enable RX pending interrupts.
@@ -97,6 +99,7 @@ namespace sta
private:
CAN_HandleTypeDef * handle_; /**< CAN handle */
CAN_FilterTypeDef filters_[MAX_FILTER_COUNT]; /**< Filter settings */
uint32_t filter_start_; /**< Start index for filters */
};