summaryrefslogtreecommitdiffstatshomepage
path: root/drivers/wiznet5k/ethernet/wizchip_conf.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-31 23:50:57 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-01 22:52:37 +0100
commit79d17e3e7d7cdf401ead80a31e767d6831b1146c (patch)
treec59067dab49ab2b2f059cebbdd82ec04108ba8ae /drivers/wiznet5k/ethernet/wizchip_conf.c
parent812cf62f4358ea541f03ef69e7b918a763c826ed (diff)
downloadmicropython-79d17e3e7d7cdf401ead80a31e767d6831b1146c.tar.gz
micropython-79d17e3e7d7cdf401ead80a31e767d6831b1146c.zip
drivers, wiznet5k: Change SPI interface to read/write multiple bytes.
Diffstat (limited to 'drivers/wiznet5k/ethernet/wizchip_conf.c')
-rw-r--r--drivers/wiznet5k/ethernet/wizchip_conf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.c b/drivers/wiznet5k/ethernet/wizchip_conf.c
index bfc19e35ce..c733cdf873 100644
--- a/drivers/wiznet5k/ethernet/wizchip_conf.c
+++ b/drivers/wiznet5k/ethernet/wizchip_conf.c
@@ -96,13 +96,13 @@ void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
-uint8_t wizchip_spi_readbyte(void) {return 0;};
+void wizchip_spi_readbytes(uint8_t *buf, uint32_t len) {}
/**
* @brief Default function to write in SPI interface.
* @note This function help not to access wrong address. If you do not describe this function or register any functions,
* null function is called.
*/
-void wizchip_spi_writebyte(uint8_t wb) {};
+void wizchip_spi_writebytes(const uint8_t *buf, uint32_t len) {}
/**
* @\ref _WIZCHIP instance
@@ -168,19 +168,19 @@ void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint
}
}
-void reg_wizchip_spi_cbfunc(uint8_t (*spi_rb)(void), void (*spi_wb)(uint8_t wb))
+void reg_wizchip_spi_cbfunc((void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)(const uint8_t *, uint32_t))
{
while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_SPI_));
if(!spi_rb || !spi_wb)
{
- WIZCHIP.IF.SPI._read_byte = wizchip_spi_readbyte;
- WIZCHIP.IF.SPI._write_byte = wizchip_spi_writebyte;
+ WIZCHIP.IF.SPI._read_bytes = wizchip_spi_readbytes;
+ WIZCHIP.IF.SPI._write_bytes = wizchip_spi_writebytes;
}
else
{
- WIZCHIP.IF.SPI._read_byte = spi_rb;
- WIZCHIP.IF.SPI._write_byte = spi_wb;
+ WIZCHIP.IF.SPI._read_bytes = spi_rb;
+ WIZCHIP.IF.SPI._write_bytes = spi_wb;
}
}