Skip to content

Commit

Permalink
Merge pull request #21004 from maribu/boards/common/arduino-zero/ardu…
Browse files Browse the repository at this point in the history
…ino-iomap

boards/wemos-zero: fix Arduio I/O Map
  • Loading branch information
mguetschow authored Nov 19, 2024
2 parents 387f970 + fd233fe commit 89b5169
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
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
# 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

0 comments on commit 89b5169

Please sign in to comment.