#ifndef _HW_W5500_H_ #define _HW_W5500_H_ #include "hw/spi.h" struct w5500 { struct spi *spidev; }; /** * Initialize a WIZnet W5500 Ethernet and TCP/IP-offload chip. * * The W5500 has 2 channels of communication with the MCU: * * - An SPI-based RPC protocol: * + mode: mode 0 or mode 3 * + bit-order: MSB-first * + clock frequency: 33.3MHz - 80MHz * - An interrupt pin that it pulls low when an event happens (to let * the MCU know that it should do an SPI RPC "get" to see what * happened.) */ #define w5500_init(self, name, spi, pin_intr) do { \ bi_decl(bi_1_pin_with_name(pin_intr, name" interrupt")); \ _w5500_init(self, spi, pin_intr); \ } while (0) void _w5500_init(struct w5500 *self, struct spi* spi, uint pin_intr); #endif /* _HW_W5500_H_ */