#include <stm32f302xc.h>
#include <stm32f3xx_hal.h>
#include <stm32f3xx_hal_conf.h>

struct base_t {
  int i = 0;
  base_t(){};
  virtual uint16_t size() = 0;
};

struct derived_t : public base_t {
  uint16_t size() override;
};

HAL_StatusTypeDef ftcan_init(CAN_HandleTypeDef *hcan);

HAL_StatusTypeDef ftcan_transmit(CAN_HandleTypeDef *hcan, uint16_t id, const uint8_t *data, size_t datalen);

HAL_StatusTypeDef spi_init(SPI_HandleTypeDef *hspi);

HAL_StatusTypeDef spi_receive(SPI_HandleTypeDef *hspi, uint8_t group);
