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

boards/wemos-zero: fix Arduio I/O Map #21004

Merged
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
15 changes: 13 additions & 2 deletions boards/common/arduino-zero/include/arduino_iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,22 @@ extern "C" {
* @name Mapping of MCU pins to Arduino pins
* @{
*/

/* The WeMos Zero / HW-819 has D2 and D4 swapped compared to official Arduino
* Zero, so we have to handle D2 and D4 differently depending on board */
#ifdef BOARD_WEMOS_ZERO
mguetschow marked this conversation as resolved.
Show resolved Hide resolved
# define ARDUINO_PIN_2 GPIO_PIN(PA, 8)
# define ARDUINO_PIN_4 GPIO_PIN(PA, 14)
#else /* Official Arduino Zero or fully compatible: */
# define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
# define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#endif

/* all other pins are identical for all currently supported Arduino Zero
* compatible boards */
#define ARDUINO_PIN_0 GPIO_PIN(PA, 11)
#define ARDUINO_PIN_1 GPIO_PIN(PA, 10)
#define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
#define ARDUINO_PIN_3 GPIO_PIN(PA, 9)
#define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#define ARDUINO_PIN_5 GPIO_PIN(PA, 15)
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20)
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21)
Expand Down
5 changes: 3 additions & 2 deletions boards/wemos-zero/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
## Overview

The WeMos Zero is a cheap clone of Arduino Zero featuring a ATSAMD21G18A.
These boards either have a silkscreen "WeMos" or "HW-910" label on their back.
Unlike the original Zero, it does not include an embedded debugger/programmer.
Instead, the [UF2 Bootloader](https://github.com/microsoft/uf2-samdx1) is
used to program this board. The SAMD21 is a ARM Cortex-M0+ micro-controller.
It has 256KiB of flash memory and 32KiB of RAM.

Note: The official Arduino Zero using the native USB port and the Adafruit
Metro M0 Express should also work with board definition.
@note The official Arduino Zero using the native USB port and the Adafruit
Metro M0 Express should also work with this board definition.

## Hardware

Expand Down
Loading