Creating a stream object from SPI

Hello everybody,

Can someone help me creating a block class from a SPI device? I want to use it with the webserver generating the response as a file download from this spi data and have good speed.

class DEVICE
{
  private:
    SPIClass * _hspi = NULL;
    int _interruptPin = 16;
    const int _spiClk = 15000000;
    void readFromSPI(byte reg_address, int num, byte buff[]);

  public:
    size_t len;
    void Begin(void);
    int Read(uint8_t *buffer, size_t maxLen);
};
#include <SPI.h>
#include "DEVICE.h"

void DEVICE::readFromSPI(byte reg_address, int num, byte buff[])
{
}

void DEVICE::Begin()
{
}

int DEVICE::Read(uint8_t *buffer, size_t maxLen)
{
  readFromSPI(...);
  return (n);
}

Can someone help me creating a block class from a SPI device?

What do you need help with? Why do you think you need a class to do that?

Well at least the code is well indented and formatted. But to be clear, I have no clue what you are wanting or what the data is and wha i feeding it to the spi.

Soon I will post the progress.

Thank you.