Skip to content

Commit f1ab3b1

Browse files
committed
drivers/shield_w5100: add module for the W5100 Ethernet Shield
This module provides no more than the correct configuration parameters for the `w5100` driver using the Arduino I/O mapping features. But by doing so, it will work out of the box with every mechanically and electrically compatible board for which the Arduino I/O mapping features are implemented.
1 parent 85c2f43 commit f1ab3b1

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

drivers/Makefile.dep

+8
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ ifneq (,$(filter servo_%,$(USEMODULE)))
180180
USEMODULE += servo
181181
endif
182182

183+
ifneq (,$(filter shield_w5100,$(USEMODULE)))
184+
FEATURES_REQUIRED += arduino_pins
185+
FEATURES_REQUIRED += arduino_shield_isp
186+
FEATURES_REQUIRED += arduino_shield_uno
187+
FEATURES_REQUIRED += arduino_spi
188+
USEMODULE += w5100
189+
endif
190+
183191
ifneq (,$(filter sht1%,$(USEMODULE)))
184192
USEMODULE += sht1x
185193
endif

drivers/doc.txt

+29-1
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,32 @@
121121
* @ingroup config
122122
* @brief Compile time configurations for different kinds of
123123
* devices that do not match any other category
124-
*/
124+
*/
125+
126+
/**
127+
* @defgroup drivers_shield Shields - hardware extension daughter board drivers
128+
* @ingroup drivers
129+
* @brief Provides drivers for hardware extension daughter boards such as
130+
* Arduino Shields
131+
*/
132+
133+
/**
134+
* @defgroup drivers_shield_w5100 W5100 Ethernet Shield driver
135+
* @ingroup drivers_shield
136+
* @brief Driver for the Arduino W5100 Ethernet Shield
137+
*
138+
* Usage
139+
* =====
140+
*
141+
* The driver is enabled by using the module `shield_w5100`, e.g. with:
142+
*
143+
* ```
144+
* USEMODULE=shield_w5100 make BOARD=arduino-due -C examples/gnrc_networking
145+
* ```
146+
*
147+
* It depends on @ref drivers_w5100 and provides nothing more than the providing
148+
* the correct configuration. For this, it depends on the `arduino_pins`,
149+
* `arduino_spi`, `arduino_shield_uno` and the `arduino_shield_isp` feature.
150+
* It should work out of the box for any fully Arduino UNO compatible board
151+
* (including the ISP header) and correct I/O mapping (`arduino_*`) features.
152+
*/

drivers/w5100/include/w5100_params.h

+10
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,20 @@
2121

2222
#include "board.h"
2323

24+
#ifdef MODULE_SHIELD_W5100
25+
#include "arduino_iomap.h"
26+
#endif
27+
2428
#ifdef __cplusplus
2529
extern "C" {
2630
#endif
2731

32+
#ifdef MODULE_SHIELD_W5100
33+
#define W5100_PARAM_SPI ARDUINO_SPI_ISP
34+
#define W5100_PARAM_CS ARDUINO_PIN_10
35+
#define W5100_PARAM_EVT ARDUINO_PIN_2
36+
#endif
37+
2838
/**
2939
* @name Default configuration parameters for the W5100 driver
3040
* @{

makefiles/pseudomodules.inc.mk

+1
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ PSEUDOMODULES += shell_commands
494494
## @}
495495
PSEUDOMODULES += shell_hooks
496496
PSEUDOMODULES += shell_lock_auto_locking
497+
PSEUDOMODULES += shield_w5100
497498
PSEUDOMODULES += slipdev_stdio
498499
PSEUDOMODULES += slipdev_l2addr
499500
PSEUDOMODULES += sock

0 commit comments

Comments
 (0)