10 static const uint32_t SPI_CLOCK = 10000000;
12 static const int N_TXBUFFERS = 3;
13 static const int N_RXBUFFERS = 2;
56 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
57 spi::DATA_RATE_8MHZ> {
60 void set_mcp_clock(
CanClock clock) { this->mcp_clock_ = clock; };
62 static const struct TxBnRegs {
68 static const struct RxBnRegs {
78 bool setup_internal()
override;
81 uint8_t read_register_(
REGISTER reg);
82 void read_registers_(
REGISTER reg, uint8_t values[], uint8_t n);
83 void set_register_(
REGISTER reg, uint8_t value);
84 void set_registers_(
REGISTER reg, uint8_t values[], uint8_t n);
85 void modify_register_(
REGISTER reg, uint8_t mask, uint8_t data);
87 void prepare_id_(uint8_t *buffer,
bool extended, uint32_t
id);
98 bool check_receive_();
100 uint8_t get_error_flags_();
101 void clear_rx_n_ovr_flags_();
103 uint8_t get_int_mask_();
105 void clear_tx_int_();
106 uint8_t get_status_();
107 void clear_rx_n_ovr_();
The SPIDevice is what components using the SPI will create.
BedjetMode mode
BedJet operating mode.
Implementation of SPI Controller mode.