You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2026/05/06 07:07:22 UTC

(mynewt-core) branch master updated (ffd5a795b -> 146878e48)

This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


    from ffd5a795b hw/mcu/stm32f4: Fix mcu info command
     new fc245085f hw/mcu/atmel: Add GPIO deinit
     new 146878e48 hw/bsp/arduino_zero: Rename pins for consistency

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hw/bsp/arduino_zero/include/bsp/bsp.h | 49 +++++++++++++++++------------------
 hw/mcu/atmel/samd21xx/src/hal_gpio.c  | 25 ++++++++++++++++++
 2 files changed, 49 insertions(+), 25 deletions(-)


(mynewt-core) 02/02: hw/bsp/arduino_zero: Rename pins for consistency

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 146878e4868a9885e7baaa04b07e87dab05ecdc9
Author: Wiktor Kwiatkowski <wi...@codecoup.pl>
AuthorDate: Wed Apr 29 12:34:50 2026 +0200

    hw/bsp/arduino_zero: Rename pins for consistency
    
    Rename ARDUINO_ZERO_* pin definitions to ARDUINO_PIN_* to match
    the naming convention used by other boards
---
 hw/bsp/arduino_zero/include/bsp/bsp.h | 49 +++++++++++++++++------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/hw/bsp/arduino_zero/include/bsp/bsp.h b/hw/bsp/arduino_zero/include/bsp/bsp.h
index 7be30695e..1eedaa5f2 100644
--- a/hw/bsp/arduino_zero/include/bsp/bsp.h
+++ b/hw/bsp/arduino_zero/include/bsp/bsp.h
@@ -28,42 +28,41 @@
 extern "C" {
 #endif
 
-enum system_device_id
-{
+enum system_device_id {
     /* NOTE: Some HALs use a virtual enumeration of the devices, while
      * other still use the actual pins (GPIO). For arduino this means
      * that the sysIDs for analog and digital pins are the actual pin
      * numbers */
 
-    ARDUINO_ZERO_D0 =     (11),
-    ARDUINO_ZERO_D1 =     (10),
-    ARDUINO_ZERO_D3 =     (9),
-    ARDUINO_ZERO_D5 =     (15),
-    ARDUINO_ZERO_D6 =     (20),
-    ARDUINO_ZERO_D7 =     (21),
-    ARDUINO_ZERO_D8 =     (6),
-    ARDUINO_ZERO_D9 =     (7),
-    ARDUINO_ZERO_D10 =    (18),
-    ARDUINO_ZERO_D11 =    (16),
-    ARDUINO_ZERO_D12 =    (19),
-    ARDUINO_ZERO_D13 =    (17),
+    ARDUINO_PIN_D0 = 11,
+    ARDUINO_PIN_D1 = 10,
+    ARDUINO_PIN_D3 = 9,
+    ARDUINO_PIN_D5 = 15,
+    ARDUINO_PIN_D6 = 20,
+    ARDUINO_PIN_D7 = 21,
+    ARDUINO_PIN_D8 = 6,
+    ARDUINO_PIN_D9 = 7,
+    ARDUINO_PIN_D10 = 18,
+    ARDUINO_PIN_D11 = 16,
+    ARDUINO_PIN_D12 = 19,
+    ARDUINO_PIN_D13 = 17,
 
 #if MYNEWT_VAL(BSP_ARDUINO_ZERO_PRO)
-    ARDUINO_ZERO_D2 =     (8),
-    ARDUINO_ZERO_D4 =     (14),
+    ARDUINO_PIN_D2 = 8,
+    ARDUINO_PIN_D4 = 14
 #else
-    ARDUINO_ZERO_D2 =     (14),
-    ARDUINO_ZERO_D4 =     (8),
+    ARDUINO_PIN_D2 = 14,
+    ARDUINO_PIN_D4 = 8,
 #endif
 
     /* Use SPI 2 */
-    ARDUINO_ZERO_SPI_ICSP = 0,
+    ARDUINO_PIN_SPI_ICSP = 0,
 
     /* Use SPI 3 */
-    ARDUINO_ZERO_SPI_ALT  = 1,
+    ARDUINO_PIN_SPI_ALT = 1,
 
     /* a I2c port on SCLK and SDA */
-    ARDUINO_ZERO_I2C      = 4,
+    ARDUINO_PIN_I2C = 4,
 };
 
 #define BSP_WINC1500_SPI_PORT   0
@@ -71,11 +70,11 @@ enum system_device_id
 extern uint8_t _ram_start;
 #define RAM_SIZE        0x00008000
 
-#define ARDUINO_ZERO_PIN_UART_RX (ARDUINO_ZERO_D0)
-#define ARDUINO_ZERO_PIN_UART_TX (ARDUINO_ZERO_D1)
+#define ARDUINO_ZERO_PIN_UART_RX (ARDUINO_PIN_D0)
+#define ARDUINO_ZERO_PIN_UART_TX (ARDUINO_PIN_D1)
 
-#define LED_BLINK_PIN   (ARDUINO_ZERO_D13)
-#define LED_2           (27)
+#define LED_BLINK_PIN ARDUINO_PIN_D13
+#define LED_2         27
 
 #define CONSOLE_UART_SPEED      115200
 


(mynewt-core) 01/02: hw/mcu/atmel: Add GPIO deinit

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit fc245085febc37d00feb75d99576d27d8ed813a1
Author: Wiktor Kwiatkowski <wi...@codecoup.pl>
AuthorDate: Wed Apr 29 12:16:06 2026 +0200

    hw/mcu/atmel: Add GPIO deinit
    
    Add missing hal_gpio_deinit function. It restores the pin to its
    default state
---
 hw/mcu/atmel/samd21xx/src/hal_gpio.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/mcu/atmel/samd21xx/src/hal_gpio.c b/hw/mcu/atmel/samd21xx/src/hal_gpio.c
index 3d0d003fe..1d4f66469 100644
--- a/hw/mcu/atmel/samd21xx/src/hal_gpio.c
+++ b/hw/mcu/atmel/samd21xx/src/hal_gpio.c
@@ -270,6 +270,31 @@ hal_gpio_toggle(int pin)
     return hal_gpio_read(pin);
 }
 
+int
+hal_gpio_deinit(int pin)
+{
+    struct port_config cfg;
+
+    int port = GPIO_PORT(pin);
+    int port_pin = GPIO_PIN(pin);
+
+    if (port > GPIO_MAX_PORT) {
+        return -1;
+    }
+
+    if ((port_pin & valid_pins[port]) == 0) {
+        return -1;
+    }
+
+    cfg.direction = PORT_PIN_DIR_INPUT;
+    cfg.input_pull = PORT_PIN_PULL_NONE;
+    cfg.powersave = true;
+
+    port_pin_set_config(pin, &cfg);
+
+    return 0;
+}
+
 /*
  * Interrupt handler for gpio.
  */