Skip to content

Commit

Permalink
drivers/shield_w5100: add module for the W5100 Ethernet Shield
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maribu committed Jun 27, 2023
1 parent 85c2f43 commit cf68026
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
8 changes: 8 additions & 0 deletions drivers/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ ifneq (,$(filter servo_%,$(USEMODULE)))
USEMODULE += servo
endif

ifneq (,$(filter shield_w5100,$(USEMODULE)))
FEATURES_REQUIRED += arduino_pins
FEATURES_REQUIRED += arduino_shield_isp
FEATURES_REQUIRED += arduino_shield_uno
FEATURES_REQUIRED += arduino_spi
USEMODULE += w5100
endif

ifneq (,$(filter sht1%,$(USEMODULE)))
USEMODULE += sht1x
endif
Expand Down
30 changes: 29 additions & 1 deletion drivers/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,32 @@
* @ingroup config
* @brief Compile time configurations for different kinds of
* devices that do not match any other category
*/
*/

/**
* @defgroup drivers_shield Shields - hardware extension daughter board drivers
* @ingroup driver
* @brief Provides drivers for hardware extension daughter boards such as
* Arduino Shields
*/

/**
* @defgroup drivers_shield_w5100 W5100 Ethernet Shield driver
* @ingroup driver_shield
* @brief Driver for the Arduino W5100 Ethernet Shield
*
* Usage
* =====
*
* The driver is enabled by using the module `shield_w5100`, e.g. with:
*
* ```
* USEMODULE=shield_w5100 make BOARD=arduino-due -C examples/gnrc_networking
* ```
*
* It depends on @ref drivers_w5100 and provides nothing more than the providing
* the correct configuration. For this, it depends on the `arduino_pins`,
* `arduino_spi`, `arduino_shield_uno` and the `arduino_shield_isp` feature.
* It should work out of the box for any fully Arduino UNO compatible board
* (including the ISP header) and correct I/O mapping (`arduino_*`) features.
*/
10 changes: 10 additions & 0 deletions drivers/w5100/include/w5100_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@

#include "board.h"

#ifdef MODULE_SHIELD_W5100
#include "arduino_iomap.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef MODULE_SHIELD_W5100
#define W5100_PARAM_SPI ARDUINO_SPI_ISP
#define W5100_PARAM_CS ARDUINO_PIN_10
#define W5100_PARAM_EVT ARDUINO_PIN_2
#endif

/**
* @name Default configuration parameters for the W5100 driver
* @{
Expand Down
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ PSEUDOMODULES += shell_commands
## @}
PSEUDOMODULES += shell_hooks
PSEUDOMODULES += shell_lock_auto_locking
PSEUDOMODULES += shield_w5100
PSEUDOMODULES += slipdev_stdio
PSEUDOMODULES += slipdev_l2addr
PSEUDOMODULES += sock
Expand Down

0 comments on commit cf68026

Please sign in to comment.