WIZnet Developer Forum

W5500 - Errors in function

Hi everyone!

I’m trying to run the W5500 chip with standard functions, but I fail at the very beginning. I want to write a code for data transfer via SPI, and now i have this:

void SPI_MasterInit(void) //Initialize SPI
{
DDRB = ((1<<PB5)|(1<<PB7)|(1<<PB4)); //spi pins on port b MOSI SCK,SS outputs
PCR |= ((1<<SPE)|(1<<MSTR)|(1<<SPR0)); // SPI enable, Master, f/16
}

uint8_t spi_rb(void) { //Read/write functions
SPDR = 0x00;
while (!(SPSR & (1 << SPIF)));
return SPDR;
}

void spi_wb(uint8_t wb) {
SPDR = wb;
while (!(SPSR & (1 << SPIF)));
}

But when I write in the main function (or refer to the main function) on this:

reg_wizchip_spi_cbfunc(spi_rb, spi_wb);

The compiler produces an error:

undefined reference to `reg_wizchip_spi_cbfunc(unsigned char ()(), void ()(unsigned char))'

If someone came across this, give me advice on how this can be prevented. I’ve been trying to run the B5500 for almost a month and get it to work, but it does not work.

Thank you for any answer. Peace to you

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.