Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/shield_w5100: add module for the W5100 Ethernet Shield #19764

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions boards/common/arduino-atmega/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,6 @@ extern "C" {
#endif
/** @} */

/**
* @name Configuration parameters for the W5100 driver
* @{
*/
#ifndef W5100_PARAM_CS
#define W5100_PARAM_CS (ARDUINO_PIN_10)
#endif
#ifndef W5100_PARAM_EVT
#define W5100_PARAM_EVT (ARDUINO_PIN_2)
#endif
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
12 changes: 0 additions & 12 deletions boards/common/arduino-due/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ extern "C" {
#define LED0_TOGGLE ((PIOB->PIO_ODSR & PIO_PB27) ? LED0_OFF : LED0_ON)
/** @} */

/**
* @name Configuration parameters for the W5100 driver
* @{
*/
#ifndef W5100_PARAM_CS
#define W5100_PARAM_CS (ARDUINO_PIN_10)
#endif
#ifndef W5100_PARAM_EVT
#define W5100_PARAM_EVT (ARDUINO_PIN_2)
#endif
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
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 drivers
* @brief Provides drivers for hardware extension daughter boards such as
* Arduino Shields
*/

/**
* @defgroup drivers_shield_w5100 W5100 Ethernet Shield driver
* @ingroup drivers_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