24#ifdef USE_SPI_PSRAM_DMA
34 void begin() { this->ok_ =
true; }
36 bool ok()
const {
return this->ok_; }
37 void write(std::span<const uint8_t> header, std::span<const uint8_t> data);
39 void read(std::span<const uint8_t> header, std::span<uint8_t> data);
43 spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_8MHZ> {
45 GPIOPin *get_cs_pin()
const {
return this->
cs_; }
49 explicit Selection(Device &device) : device_(device) { this->device_.
enable(); }
50 ~Selection() { this->device_.
disable(); }
51 Selection(
const Selection &) =
delete;
52 Selection &operator=(
const Selection &) =
delete;
57 void exchange_(std::span<const uint8_t> header, std::span<const uint8_t> tx, std::span<uint8_t> rx);
59 GPIOPin *busy_pin_{
nullptr};
BedjetMode mode
BedJet operating mode.
void set_release_device(bool release)
void set_write_only(bool write_only)
void set_psram_dma(bool enable)
The SPIDevice is what components using the SPI will create.
void set_data_rate(uint32_t data_rate)
void spi_setup() override
void set_cs_pin(GPIOPin *cs)
void set_mode(SPIMode mode)
void set_bit_order(SPIBitOrder order)
void set_spi_parent(SPIComponent *parent)
void spi_teardown() override
void set_psram_dma(bool enable)
void set_busy_pin(GPIOPin *pin)
void write(std::span< const uint8_t > header, std::span< const uint8_t > data)
void set_cs_pin(GPIOPin *pin)
void set_release_device(bool release)
void set_spi_parent(spi::SPIComponent *parent)
SX126xSpiDevice()=default
SX126xSpiDevice & operator=(const SX126xSpiDevice &)=delete
void set_write_only(bool write_only)
GPIOPin * get_busy_pin() const
void read(std::span< const uint8_t > header, std::span< uint8_t > data)
GPIOPin * get_cs_pin() const
void set_bit_order(spi::SPIBitOrder order)
SX126xSpiDevice(const SX126xSpiDevice &)=delete
void set_mode(spi::SPIMode mode)
void set_data_rate(uint32_t rate)
SPIMode
Modes mapping to clock phase and polarity.
SPIBitOrder
The bit-order for SPI devices. This defines how the data read from and written to the device is inter...