/* This function reads from the SPI interface using the configuration parameter within the sc structure. The opcode parameter is used to specify which control register to access. This controller has the following seven control register commands */
void enc28j60_lwip_read_spi(uint32_t spiHandle, uint8_t opcode, uint8_t address, uint8_t *byteData, uint32_t numBytes, uint8_t offset)
/* This function reads from the SPI interface using the configuration parameter within the sc structure. The opcode parameter is used to specify which control register to access. This controller has the following seven control register commands */
void enc28j60_lwip_read_spi(uint32_t spiHandle, uint8_t opcode, uint8_t address, uint8_t *byteData, uint32_t numBytes, uint8_t offset)
{
    uint8_t opcodeArg;
    opcodeArg = ENC28J60_SPI_OPCODE_ARGUMENT(opcode, address);
    SPI_WRITE_READ_SETTINGS wrc{false, offset, false, 0, ENC28J60_CS, ENC28J60_CS_ACTIVE};
    nanoSPI_Write_Read(spiHandle, wrc, &opcodeArg, 1, byteData, numBytes);
}