Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Modify ethernet chip version check function
Browse files Browse the repository at this point in the history
  • Loading branch information
Giung951 committed Jan 19, 2022
1 parent 09e8851 commit 4621ffd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions port/ioLibrary_Driver/w5x00_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,25 @@ void wizchip_initialize(void)

void wizchip_check(void)
{
#if (_WIZCHIP_ == W5100S)
/* Read version register */
if (getVER() != 0x51) // W5100S
if (getVER() != 0x51)
{
printf(" ACCESS ERR : VERSIONR != 0x51, read value = 0x%02x\n", getVER());
printf(" ACCESS ERR : VERSION != 0x51, read value = 0x%02x\n", getVER());

while (1)
;
}
#elif (_WIZCHIP_ == W5500)
/* Read version register */
if (getVERSIONR() != 0x04)
{
printf(" ACCESS ERR : VERSION != 0x04, read value = 0x%02x\n", getVERSIONR());

while (1)
;
}
#endif
}

/* Network */
Expand Down
1 change: 1 addition & 0 deletions port/ioLibrary_Driver/w5x00_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static uint8_t wizchip_read(void);
* \param tx_data Buffer of data to write
*/
static void wizchip_write(uint8_t tx_data);

#ifdef USE_SPI_DMA
/*! \brief Configure all DMA parameters and optionally start transfer
* \ingroup w5x00_spi
Expand Down

0 comments on commit 4621ffd

Please sign in to comment.