summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-10-16 15:34:08 +1100
committerDamien George <damien.p.george@gmail.com>2017-10-16 15:34:08 +1100
commitc0ea91bc898139aca3ad3e21fc33ff9f0e817952 (patch)
tree61612fdc44d8299a584a178ac513927009f1fa95
parent73e387cff6a3e31a9ea0c300d92a1a4a62d791ef (diff)
drivers/wiznet5k: Get low-level W5500 driver working.
This patch implements the basic SPI read/write functions for the W5500 chip. It also allows _WIZCHIP_ to be configured externally to select the specific Wiznet chip.
-rw-r--r--drivers/wiznet5k/ethernet/w5500/w5500.c10
-rw-r--r--drivers/wiznet5k/ethernet/w5500/w5500.h1
-rw-r--r--drivers/wiznet5k/ethernet/wizchip_conf.h2
3 files changed, 12 insertions, 1 deletions
diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.c b/drivers/wiznet5k/ethernet/w5500/w5500.c
index 6b3111f99..3107b1b71 100644
--- a/drivers/wiznet5k/ethernet/w5500/w5500.c
+++ b/drivers/wiznet5k/ethernet/w5500/w5500.c
@@ -57,6 +57,16 @@
////////////////////////////////////////////////////
+#define LPC_SSP0 (0)
+
+static void Chip_SSP_ReadFrames_Blocking(int dummy, uint8_t *buf, uint32_t len) {
+ WIZCHIP.IF.SPI._read_bytes(buf, len);
+}
+
+static void Chip_SSP_WriteFrames_Blocking(int dummy, const uint8_t *buf, uint32_t len) {
+ WIZCHIP.IF.SPI._write_bytes(buf, len);
+}
+
uint8_t WIZCHIP_READ(uint32_t AddrSel)
{
uint8_t ret;
diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.h b/drivers/wiznet5k/ethernet/w5500/w5500.h
index f0ffcb0c8..c2afb180e 100644
--- a/drivers/wiznet5k/ethernet/w5500/w5500.h
+++ b/drivers/wiznet5k/ethernet/w5500/w5500.h
@@ -44,7 +44,6 @@
#include <stdint.h>
#include "../wizchip_conf.h"
-#include "board.h"
#define _W5500_IO_BASE_ 0x00000000
diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.h b/drivers/wiznet5k/ethernet/wizchip_conf.h
index 55c79ae0a..4a7a7bd69 100644
--- a/drivers/wiznet5k/ethernet/wizchip_conf.h
+++ b/drivers/wiznet5k/ethernet/wizchip_conf.h
@@ -56,7 +56,9 @@
* @todo You should select one, \b 5100, \b 5200 ,\b 5500 or etc. \n\n
* ex> <code> #define \_WIZCHIP_ 5500 </code>
*/
+#ifndef _WIZCHIP_
#define _WIZCHIP_ 5200 // 5100, 5200, 5500
+#endif
#define _WIZCHIP_IO_MODE_NONE_ 0x0000
#define _WIZCHIP_IO_MODE_BUS_ 0x0100 /**< Bus interface mode */