/* This function writes the SPI interface using the configuration parameter within the sc structure. The op code parameter is used to specify which control register to access. This controller has the following seven control register commands */
void enc28j60_lwip_write_spi(uint32_t spiHandle, uint8_t opcode, uint8_t address, uint8_t byteData)
/* This function writes the SPI interface using the configuration parameter within the sc structure. The op code parameter is used to specify which control register to access. This controller has the following seven control register commands */
void enc28j60_lwip_write_spi(uint32_t spiHandle, uint8_t opcode, uint8_t address, uint8_t byteData)
{
    uint8_t opcodeArg;
    uint8_t commandWithData[2];
    opcodeArg = ENC28J60_SPI_OPCODE_ARGUMENT(opcode, address);
    commandWithData[0] = opcodeArg;
    commandWithData[1] = byteData;
    SPI_WRITE_READ_SETTINGS wrc{false, 0, false, 0, ENC28J60_CS, ENC28J60_CS_ACTIVE};
    nanoSPI_Write_Read(spiHandle, wrc, commandWithData, 2, 0, 0);
}