You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/04 10:38:48 UTC

[GitHub] [incubator-nuttx] michi-jung opened a new pull request #2974: STM32L5 Architecture Support

michi-jung opened a new pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974


   ## Summary
   
   This is my current state of work on getting NuttX to run on STM32L5. I am especially interested in the TrustZone support of ARMV8-M. The 'nsh' configuration of the stm32l562e-dk board runs fine as the non-secure companion to STMicroelectronics' port of TrustedFirmware-M.
   
   ## Impact
   
   All code is in new subdirectories and should not have any impact on current configurations.
   
   ## Testing
   
   I am running a basic 'nsh' configuration fine directly on a Nucleo-L552ZE-Q board and as a companion to TrustedFirmware-M on STM32L562E-DK.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-800491791


   Hi @acassis, I believe we can merge this now. I will provide the LSE drive ramp-up in a separate pull request. And the headers can be changed to ASF once the remaining license issues are cleared.
   
   Thanks to @acassis, @davids5, @xiaoxiang781216 and @raiden00pl for your help!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594901666



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
##########
@@ -0,0 +1,867 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_STM32L5_STM32L562XX)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_RCC_CR_OFFSET         0x0000  /* Clock control register */
+#define STM32L5_RCC_ICSCR_OFFSET      0x0004  /* Internal clock sources calibration register */
+#define STM32L5_RCC_CFGR_OFFSET       0x0008  /* Clock configuration register */
+#define STM32L5_RCC_PLLCFG_OFFSET     0x000c  /* PLL configuration register */
+#define STM32L5_RCC_PLLSAI1CFG_OFFSET 0x0010  /* PLLSAI1 configuration register */
+#define STM32L5_RCC_PLLSAI2CFG_OFFSET 0x0014  /* PLLSAI2 configuration register */
+#define STM32L5_RCC_CIER_OFFSET       0x0018  /* Clock interrupt enable register */
+#define STM32L5_RCC_CIFR_OFFSET       0x001c  /* Clock interrupt flag register */
+#define STM32L5_RCC_CICR_OFFSET       0x0020  /* Clock interrupt clear register */
+#define STM32L5_RCC_AHB1RSTR_OFFSET   0x0028  /* AHB1 peripheral reset register */
+#define STM32L5_RCC_AHB2RSTR_OFFSET   0x002c  /* AHB2 peripheral reset register */
+#define STM32L5_RCC_AHB3RSTR_OFFSET   0x0030  /* AHB3 peripheral reset register */
+#define STM32L5_RCC_APB1RSTR1_OFFSET  0x0038  /* APB1 Peripheral reset register 1 */
+#define STM32L5_RCC_APB1RSTR2_OFFSET  0x003c  /* APB1 Peripheral reset register 2 */
+#define STM32L5_RCC_APB2RSTR_OFFSET   0x0040  /* APB2 Peripheral reset register */
+#define STM32L5_RCC_AHB1ENR_OFFSET    0x0048  /* AHB1 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB2ENR_OFFSET    0x004c  /* AHB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB3ENR_OFFSET    0x0050  /* AHB3 Peripheral Clock enable register */
+#define STM32L5_RCC_APB1ENR1_OFFSET   0x0058  /* APB1 Peripheral Clock enable register 1 */
+#define STM32L5_RCC_APB1ENR2_OFFSET   0x005c  /* APB1 Peripheral Clock enable register 2 */
+#define STM32L5_RCC_APB2ENR_OFFSET    0x0060  /* APB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB1SMENR_OFFSET  0x0068  /* RCC AHB1 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB2SMENR_OFFSET  0x006c  /* RCC AHB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB3SMENR_OFFSET  0x0070  /* RCC AHB3 low power mode peripheral clock enable register */
+#define STM32L5_RCC_APB1SMENR1_OFFSET 0x0078  /* RCC APB1 low power mode peripheral clock enable register 1 */
+#define STM32L5_RCC_APB1SMENR2_OFFSET 0x007c  /* RCC APB1 low power mode peripheral clock enable register 2 */
+#define STM32L5_RCC_APB2SMENR_OFFSET  0x0080  /* RCC APB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_CCIPR_OFFSET      0x0088  /* Peripherals independent clock configuration register 1 */
+#define STM32L5_RCC_BDCR_OFFSET       0x0090  /* Backup domain control register */
+#define STM32L5_RCC_CSR_OFFSET        0x0094  /* Control/status register */
+#define STM32L5_RCC_CRRCR_OFFSET      0x0098  /* Clock recovery RC register */
+#define STM32L5_RCC_CCIPR2_OFFSET     0x009c  /* Peripherals independent clock configuration register 2 */
+#define STM32L5_RCC_SECCFGR_OFFSET    0x00b8  /* Secure configuration register */
+#define STM32L5_RCC_SECSR_OFFSET      0x00bc  /* Secure status register */
+#define STM32L5_RCC_AHB1SECSR_OFFSET  0x00e8  /* AHB1 security status register */
+#define STM32L5_RCC_AHB2SECSR_OFFSET  0x00ec  /* AHB2 security status register */
+#define STM32L5_RCC_AHB3SECSR_OFFSET  0x00f0  /* AHB3 security status register */
+#define STM32L5_RCC_APB1SECSR1_OFFSET 0x00f8  /* APB1 security status register 1 */
+#define STM32L5_RCC_APB1SECSR2_OFFSET 0x00fc  /* APB1 security status register 2 */
+#define STM32L5_RCC_APB2SECSR_OFFSET  0x0100  /* APB2 security status register */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_RCC_CR                (STM32L5_RCC_BASE+STM32L5_RCC_CR_OFFSET)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/0582434c43ddf642c312b4fc6210d060a151e01f (The same commit applies to your next review finding)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900877



##########
File path: arch/arm/src/stm32l5/stm32l5_lse.c
##########
@@ -0,0 +1,166 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/stm32l5_lse.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Michael Jung <mi...@gmx.net>
+ *
+ * Based on arch/arm/src/stm32l4/stm32l4_lse.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *   Author: dev@ziggurat29.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "arm_arch.h"
+
+#include "stm32l5_pwr.h"
+#include "stm32l5_rcc.h"
+#include "stm32l5_waste.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32l5_rcc_enablelse
+ *
+ * Description:
+ *   Enable the External Low-Speed (LSE) oscillator and the LSE system clock.
+ *
+ ****************************************************************************/
+
+void stm32l5_rcc_enablelse(void)
+{
+  bool writable;
+  uint32_t regval;
+
+  /* Check if both the External Low-Speed (LSE) oscillator and the LSE system
+   * clock are already running.
+   */
+
+  regval = getreg32(STM32L5_RCC_BDCR);
+
+  if ((regval & (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN)) !=
+                (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN))
+    {
+      /* The LSE is in the RTC domain and write access is denied to this
+       * domain after reset, you have to enable write access using DBP bit in
+       * the PWR CR register before to configuring the LSE.
+       */
+
+      writable = stm32l5_pwr_enablebkp(true);
+
+      /* Enable the External Low-Speed (LSE) oscillator by setting the LSEON
+       * bit the RCC BDCR register.
+       */
+
+      regval |= RCC_BDCR_LSEON;
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+      /* Set start-up drive capability for LSE oscillator. */
+
+      regval &= ~RCC_BDCR_LSEDRV_MASK;
+      regval |= CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
+#endif
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE clock to be ready */
+
+      while (((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
+        {
+          up_waste();
+        }
+
+      /* Enable LSE system clock.  The LSE system clock has been introduced
+       * first by the STM32L5 family of MCUs.  It seems to provide a means
+       * to gate the LSE clock distribution to peripherals.  It must be
+       * enabled for MSI PLL mode (syncing the MSI to the LSE).
+       */
+
+      regval |= RCC_BDCR_LSESYSEN;
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE system clock to be ready */
+
+      while (!((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSESYSRDY))

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/b02cff4086308ec6ed3c692b83411a3b04e3ff78




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r588224862



##########
File path: arch/arm/src/stm32l5/chip.h
##########
@@ -0,0 +1,56 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/chip.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_CHIP_H
+#define __ARCH_ARM_SRC_STM32L5_CHIP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/* Include the memory map and the chip definitions file.  Other chip hardware
+ * files should then include this file for the proper setup.
+ */
+
+#include <arch/irq.h>
+#include <arch/stm32l5/chip.h>
+#include "hardware/stm32l5_pinmap.h"
+#include "hardware/stm32l5_memorymap.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* If the common ARMv8-M vector handling logic is used, then it expects the
+ * following definition in this file that provides the number of supported
+ * external interrupts which, for this architecture, is provided in the
+ * arch/stm32l5/chip.h header file.
+ */
+
+#define ARMV8M_PERIPHERAL_INTERRUPTS STM32L5_IRQ_NEXTINTS
+
+/* Cache line sizes (in bytes) for the STM32L5 */
+
+#define ARMV8M_DCACHE_LINESIZE 0  /* no cache */
+#define ARMV8M_ICACHE_LINESIZE 0  /* no cache */

Review comment:
       @michi-jung shouldn't the cache line be 32 bytes like in other STM32xx ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-800021088


   The 'Check / check (pull_request)' step now shows a lot of coding-style problems, which are not in the files I modified but in other files that have meanwhile been touched in apache:master. Shall I re-base and force push this pull-request?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-800176312


   @michi-jung  - the rest of the CI fails are in this PR. One more fixup and force push should do it, 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594899319



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I think I addressed this with https://github.com/apache/incubator-nuttx/pull/2974/commits/66f6a22c40060bd66b0f5fe6053b1dbfb70bf326. Can you please have a look?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r595083147



##########
File path: arch/arm/src/stm32l5/stm32l5_lse.c
##########
@@ -0,0 +1,166 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/stm32l5_lse.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Michael Jung <mi...@gmx.net>
+ *
+ * Based on arch/arm/src/stm32l4/stm32l4_lse.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *   Author: dev@ziggurat29.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "arm_arch.h"
+
+#include "stm32l5_pwr.h"
+#include "stm32l5_rcc.h"
+#include "stm32l5_waste.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32l5_rcc_enablelse
+ *
+ * Description:
+ *   Enable the External Low-Speed (LSE) oscillator and the LSE system clock.
+ *
+ ****************************************************************************/
+
+void stm32l5_rcc_enablelse(void)
+{
+  bool writable;
+  uint32_t regval;
+
+  /* Check if both the External Low-Speed (LSE) oscillator and the LSE system
+   * clock are already running.
+   */
+
+  regval = getreg32(STM32L5_RCC_BDCR);
+
+  if ((regval & (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN)) !=
+                (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN))
+    {
+      /* The LSE is in the RTC domain and write access is denied to this
+       * domain after reset, you have to enable write access using DBP bit in
+       * the PWR CR register before to configuring the LSE.
+       */
+
+      writable = stm32l5_pwr_enablebkp(true);
+
+      /* Enable the External Low-Speed (LSE) oscillator by setting the LSEON
+       * bit the RCC BDCR register.
+       */
+
+      regval |= RCC_BDCR_LSEON;
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+      /* Set start-up drive capability for LSE oscillator. */
+
+      regval &= ~RCC_BDCR_LSEDRV_MASK;
+      regval |= CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
+#endif
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE clock to be ready */
+
+      while (((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
+        {
+          up_waste();
+        }
+
+      /* Enable LSE system clock.  The LSE system clock has been introduced
+       * first by the STM32L5 family of MCUs.  It seems to provide a means
+       * to gate the LSE clock distribution to peripherals.  It must be
+       * enabled for MSI PLL mode (syncing the MSI to the LSE).
+       */
+
+      regval |= RCC_BDCR_LSESYSEN;
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE system clock to be ready */
+
+      while (!((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSESYSRDY))

Review comment:
       It is better than the dead wait. But will not ramp to get it started. - I do not feel strongly about ramping herein at this point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_memorymap.h
   hardware/stm32l5_pinmap.h
   hardware/stm32l5_pwr.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-799383248


   Hi @michi-jung except from Haltian licensing issue, is there something else missing to merge it? I'm considering to move ahead and later when Haltian submit the SGA we fix the files' license. @raiden00pl did you have the chance to review it?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-791333149


   @michi-jung @xiaoxiang781216 - yes but it will take me a while to get to it.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594899319



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I think I addressed this with https://github.com/apache/incubator-nuttx/pull/2974/commits/2316fea6d0990b6c891cd77d8c771ec9b05015e5 (same commit as referenced above). Can you please have a look?

##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
##########
@@ -0,0 +1,867 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_STM32L5_STM32L562XX)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_RCC_CR_OFFSET         0x0000  /* Clock control register */
+#define STM32L5_RCC_ICSCR_OFFSET      0x0004  /* Internal clock sources calibration register */
+#define STM32L5_RCC_CFGR_OFFSET       0x0008  /* Clock configuration register */
+#define STM32L5_RCC_PLLCFG_OFFSET     0x000c  /* PLL configuration register */
+#define STM32L5_RCC_PLLSAI1CFG_OFFSET 0x0010  /* PLLSAI1 configuration register */
+#define STM32L5_RCC_PLLSAI2CFG_OFFSET 0x0014  /* PLLSAI2 configuration register */
+#define STM32L5_RCC_CIER_OFFSET       0x0018  /* Clock interrupt enable register */
+#define STM32L5_RCC_CIFR_OFFSET       0x001c  /* Clock interrupt flag register */
+#define STM32L5_RCC_CICR_OFFSET       0x0020  /* Clock interrupt clear register */
+#define STM32L5_RCC_AHB1RSTR_OFFSET   0x0028  /* AHB1 peripheral reset register */
+#define STM32L5_RCC_AHB2RSTR_OFFSET   0x002c  /* AHB2 peripheral reset register */
+#define STM32L5_RCC_AHB3RSTR_OFFSET   0x0030  /* AHB3 peripheral reset register */
+#define STM32L5_RCC_APB1RSTR1_OFFSET  0x0038  /* APB1 Peripheral reset register 1 */
+#define STM32L5_RCC_APB1RSTR2_OFFSET  0x003c  /* APB1 Peripheral reset register 2 */
+#define STM32L5_RCC_APB2RSTR_OFFSET   0x0040  /* APB2 Peripheral reset register */
+#define STM32L5_RCC_AHB1ENR_OFFSET    0x0048  /* AHB1 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB2ENR_OFFSET    0x004c  /* AHB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB3ENR_OFFSET    0x0050  /* AHB3 Peripheral Clock enable register */
+#define STM32L5_RCC_APB1ENR1_OFFSET   0x0058  /* APB1 Peripheral Clock enable register 1 */
+#define STM32L5_RCC_APB1ENR2_OFFSET   0x005c  /* APB1 Peripheral Clock enable register 2 */
+#define STM32L5_RCC_APB2ENR_OFFSET    0x0060  /* APB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB1SMENR_OFFSET  0x0068  /* RCC AHB1 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB2SMENR_OFFSET  0x006c  /* RCC AHB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB3SMENR_OFFSET  0x0070  /* RCC AHB3 low power mode peripheral clock enable register */
+#define STM32L5_RCC_APB1SMENR1_OFFSET 0x0078  /* RCC APB1 low power mode peripheral clock enable register 1 */
+#define STM32L5_RCC_APB1SMENR2_OFFSET 0x007c  /* RCC APB1 low power mode peripheral clock enable register 2 */
+#define STM32L5_RCC_APB2SMENR_OFFSET  0x0080  /* RCC APB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_CCIPR_OFFSET      0x0088  /* Peripherals independent clock configuration register 1 */
+#define STM32L5_RCC_BDCR_OFFSET       0x0090  /* Backup domain control register */
+#define STM32L5_RCC_CSR_OFFSET        0x0094  /* Control/status register */
+#define STM32L5_RCC_CRRCR_OFFSET      0x0098  /* Clock recovery RC register */
+#define STM32L5_RCC_CCIPR2_OFFSET     0x009c  /* Peripherals independent clock configuration register 2 */
+#define STM32L5_RCC_SECCFGR_OFFSET    0x00b8  /* Secure configuration register */
+#define STM32L5_RCC_SECSR_OFFSET      0x00bc  /* Secure status register */
+#define STM32L5_RCC_AHB1SECSR_OFFSET  0x00e8  /* AHB1 security status register */
+#define STM32L5_RCC_AHB2SECSR_OFFSET  0x00ec  /* AHB2 security status register */
+#define STM32L5_RCC_AHB3SECSR_OFFSET  0x00f0  /* AHB3 security status register */
+#define STM32L5_RCC_APB1SECSR1_OFFSET 0x00f8  /* APB1 security status register 1 */
+#define STM32L5_RCC_APB1SECSR2_OFFSET 0x00fc  /* APB1 security status register 2 */
+#define STM32L5_RCC_APB2SECSR_OFFSET  0x0100  /* APB2 security status register */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_RCC_CR                (STM32L5_RCC_BASE+STM32L5_RCC_CR_OFFSET)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/2316fea6d0990b6c891cd77d8c771ec9b05015e5 (The same commit applies to your next review finding)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900312



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/70ffe11526af37f412e475063a7b690ed1e5fa3d




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594482692



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       Makes sense. I will remove all _SPEED_ constants. Thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900877



##########
File path: arch/arm/src/stm32l5/stm32l5_lse.c
##########
@@ -0,0 +1,166 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/stm32l5_lse.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Michael Jung <mi...@gmx.net>
+ *
+ * Based on arch/arm/src/stm32l4/stm32l4_lse.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *   Author: dev@ziggurat29.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "arm_arch.h"
+
+#include "stm32l5_pwr.h"
+#include "stm32l5_rcc.h"
+#include "stm32l5_waste.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32l5_rcc_enablelse
+ *
+ * Description:
+ *   Enable the External Low-Speed (LSE) oscillator and the LSE system clock.
+ *
+ ****************************************************************************/
+
+void stm32l5_rcc_enablelse(void)
+{
+  bool writable;
+  uint32_t regval;
+
+  /* Check if both the External Low-Speed (LSE) oscillator and the LSE system
+   * clock are already running.
+   */
+
+  regval = getreg32(STM32L5_RCC_BDCR);
+
+  if ((regval & (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN)) !=
+                (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN))
+    {
+      /* The LSE is in the RTC domain and write access is denied to this
+       * domain after reset, you have to enable write access using DBP bit in
+       * the PWR CR register before to configuring the LSE.
+       */
+
+      writable = stm32l5_pwr_enablebkp(true);
+
+      /* Enable the External Low-Speed (LSE) oscillator by setting the LSEON
+       * bit the RCC BDCR register.
+       */
+
+      regval |= RCC_BDCR_LSEON;
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+      /* Set start-up drive capability for LSE oscillator. */
+
+      regval &= ~RCC_BDCR_LSEDRV_MASK;
+      regval |= CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
+#endif
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE clock to be ready */
+
+      while (((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
+        {
+          up_waste();
+        }
+
+      /* Enable LSE system clock.  The LSE system clock has been introduced
+       * first by the STM32L5 family of MCUs.  It seems to provide a means
+       * to gate the LSE clock distribution to peripherals.  It must be
+       * enabled for MSI PLL mode (syncing the MSI to the LSE).
+       */
+
+      regval |= RCC_BDCR_LSESYSEN;
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE system clock to be ready */
+
+      while (!((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSESYSRDY))

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/74cebdaacd2ff10fc9d190e04199f6810e9a976d




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594902175



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/commit/abf72d375c7788eab2d0419ba2e30e64b28f4d75




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r588231228



##########
File path: arch/arm/src/stm32l5/chip.h
##########
@@ -0,0 +1,56 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/chip.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_CHIP_H
+#define __ARCH_ARM_SRC_STM32L5_CHIP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/* Include the memory map and the chip definitions file.  Other chip hardware
+ * files should then include this file for the proper setup.
+ */
+
+#include <arch/irq.h>
+#include <arch/stm32l5/chip.h>
+#include "hardware/stm32l5_pinmap.h"
+#include "hardware/stm32l5_memorymap.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* If the common ARMv8-M vector handling logic is used, then it expects the
+ * following definition in this file that provides the number of supported
+ * external interrupts which, for this architecture, is provided in the
+ * arch/stm32l5/chip.h header file.
+ */
+
+#define ARMV8M_PERIPHERAL_INTERRUPTS STM32L5_IRQ_NEXTINTS
+
+/* Cache line sizes (in bytes) for the STM32L5 */
+
+#define ARMV8M_DCACHE_LINESIZE 0  /* no cache */
+#define ARMV8M_ICACHE_LINESIZE 0  /* no cache */

Review comment:
       The Cortex-M33 used in STM32L5 does not include any D-Cache or I-Cache.  For other architectures that include e.g. a Cortex-M7 with a D-Cache those literals are important for cache aligned DMA operations.  Actually, both those defines are not used in the complete stm32l5 code. I am going to remove them. Thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_pinmap.h
   hardware/stm32l5_pwr.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594901666



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
##########
@@ -0,0 +1,867 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_STM32L5_STM32L562XX)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_RCC_CR_OFFSET         0x0000  /* Clock control register */
+#define STM32L5_RCC_ICSCR_OFFSET      0x0004  /* Internal clock sources calibration register */
+#define STM32L5_RCC_CFGR_OFFSET       0x0008  /* Clock configuration register */
+#define STM32L5_RCC_PLLCFG_OFFSET     0x000c  /* PLL configuration register */
+#define STM32L5_RCC_PLLSAI1CFG_OFFSET 0x0010  /* PLLSAI1 configuration register */
+#define STM32L5_RCC_PLLSAI2CFG_OFFSET 0x0014  /* PLLSAI2 configuration register */
+#define STM32L5_RCC_CIER_OFFSET       0x0018  /* Clock interrupt enable register */
+#define STM32L5_RCC_CIFR_OFFSET       0x001c  /* Clock interrupt flag register */
+#define STM32L5_RCC_CICR_OFFSET       0x0020  /* Clock interrupt clear register */
+#define STM32L5_RCC_AHB1RSTR_OFFSET   0x0028  /* AHB1 peripheral reset register */
+#define STM32L5_RCC_AHB2RSTR_OFFSET   0x002c  /* AHB2 peripheral reset register */
+#define STM32L5_RCC_AHB3RSTR_OFFSET   0x0030  /* AHB3 peripheral reset register */
+#define STM32L5_RCC_APB1RSTR1_OFFSET  0x0038  /* APB1 Peripheral reset register 1 */
+#define STM32L5_RCC_APB1RSTR2_OFFSET  0x003c  /* APB1 Peripheral reset register 2 */
+#define STM32L5_RCC_APB2RSTR_OFFSET   0x0040  /* APB2 Peripheral reset register */
+#define STM32L5_RCC_AHB1ENR_OFFSET    0x0048  /* AHB1 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB2ENR_OFFSET    0x004c  /* AHB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB3ENR_OFFSET    0x0050  /* AHB3 Peripheral Clock enable register */
+#define STM32L5_RCC_APB1ENR1_OFFSET   0x0058  /* APB1 Peripheral Clock enable register 1 */
+#define STM32L5_RCC_APB1ENR2_OFFSET   0x005c  /* APB1 Peripheral Clock enable register 2 */
+#define STM32L5_RCC_APB2ENR_OFFSET    0x0060  /* APB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB1SMENR_OFFSET  0x0068  /* RCC AHB1 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB2SMENR_OFFSET  0x006c  /* RCC AHB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB3SMENR_OFFSET  0x0070  /* RCC AHB3 low power mode peripheral clock enable register */
+#define STM32L5_RCC_APB1SMENR1_OFFSET 0x0078  /* RCC APB1 low power mode peripheral clock enable register 1 */
+#define STM32L5_RCC_APB1SMENR2_OFFSET 0x007c  /* RCC APB1 low power mode peripheral clock enable register 2 */
+#define STM32L5_RCC_APB2SMENR_OFFSET  0x0080  /* RCC APB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_CCIPR_OFFSET      0x0088  /* Peripherals independent clock configuration register 1 */
+#define STM32L5_RCC_BDCR_OFFSET       0x0090  /* Backup domain control register */
+#define STM32L5_RCC_CSR_OFFSET        0x0094  /* Control/status register */
+#define STM32L5_RCC_CRRCR_OFFSET      0x0098  /* Clock recovery RC register */
+#define STM32L5_RCC_CCIPR2_OFFSET     0x009c  /* Peripherals independent clock configuration register 2 */
+#define STM32L5_RCC_SECCFGR_OFFSET    0x00b8  /* Secure configuration register */
+#define STM32L5_RCC_SECSR_OFFSET      0x00bc  /* Secure status register */
+#define STM32L5_RCC_AHB1SECSR_OFFSET  0x00e8  /* AHB1 security status register */
+#define STM32L5_RCC_AHB2SECSR_OFFSET  0x00ec  /* AHB2 security status register */
+#define STM32L5_RCC_AHB3SECSR_OFFSET  0x00f0  /* AHB3 security status register */
+#define STM32L5_RCC_APB1SECSR1_OFFSET 0x00f8  /* APB1 security status register 1 */
+#define STM32L5_RCC_APB1SECSR2_OFFSET 0x00fc  /* APB1 security status register 2 */
+#define STM32L5_RCC_APB2SECSR_OFFSET  0x0100  /* APB2 security status register */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_RCC_CR                (STM32L5_RCC_BASE+STM32L5_RCC_CR_OFFSET)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/commit/66f6a22c40060bd66b0f5fe6053b1dbfb70bf326 (The same commit applies to your next review finding)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594481677



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       You mean because of the blank after GPIO_AF9, right? Ok, will remove all blanks. Thanks.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] raiden00pl commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-799398180


   I looked through most of the files and LGTM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594491892



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I was looking across the files like the interrupt defined and the style fixes that have come in like https://github.com/apache/incubator-nuttx/commit/3ac61053ceca8b2dfacc2e4176aa3360c36e074b#diff-d310763a5f38df7e5c27a03851d879846192a0cccbb51d160b7e542d7884f8ddR76-R94
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900312



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/b49fa3bf90b7ddb26a0e76f6faacef3ed5c8b027




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-791292507


   I think I am happy with the pull request now.  We can iron out the remaining BSD license headers once respective ICLAs are available. Could you please give me feedback on what remains to be done to get this upstream? Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594902175



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/70759650d9cf4d499a75e22a8f0eb91a5c07bb0d




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-800021088


   The 'Build / Fetch-Source (pull_request)' step now shows a lot of coding-style problems, which are not in the files I modified but in other files that have meanwhile been touched in apache:master. Shall I re-base and force push this pull-request?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_gpio.h
   hardware/stm32l5_memorymap.h
   hardware/stm32l5_pinmap.h
   hardware/stm32l5_pwr.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.c
   stm32l5_gpio.h
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594484069



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I grep'ed all the header files and they all seem to be (N+O).  Can you point me to an (N + O) case, please? Thanks.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_gpio.h
   hardware/stm32l5_memorymap.h
   hardware/stm32l5_pinmap.h
   hardware/stm32l5_pwr.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-800061224


   > The 'Check / check (pull_request)' step now shows a lot of coding-style problems, which are not in the files I modified but in other files that have meanwhile been touched in apache:master. Shall I re-base and force push this pull-request?
   
   yes, please:
   ```
   git fetch apache
   git rebase apache/master
   git push -f origin stm32l5-upstreaming
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594316975



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
##########
@@ -0,0 +1,867 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_rcc.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562xx_RCC_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#if defined(CONFIG_STM32L5_STM32L562XX)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_RCC_CR_OFFSET         0x0000  /* Clock control register */
+#define STM32L5_RCC_ICSCR_OFFSET      0x0004  /* Internal clock sources calibration register */
+#define STM32L5_RCC_CFGR_OFFSET       0x0008  /* Clock configuration register */
+#define STM32L5_RCC_PLLCFG_OFFSET     0x000c  /* PLL configuration register */
+#define STM32L5_RCC_PLLSAI1CFG_OFFSET 0x0010  /* PLLSAI1 configuration register */
+#define STM32L5_RCC_PLLSAI2CFG_OFFSET 0x0014  /* PLLSAI2 configuration register */
+#define STM32L5_RCC_CIER_OFFSET       0x0018  /* Clock interrupt enable register */
+#define STM32L5_RCC_CIFR_OFFSET       0x001c  /* Clock interrupt flag register */
+#define STM32L5_RCC_CICR_OFFSET       0x0020  /* Clock interrupt clear register */
+#define STM32L5_RCC_AHB1RSTR_OFFSET   0x0028  /* AHB1 peripheral reset register */
+#define STM32L5_RCC_AHB2RSTR_OFFSET   0x002c  /* AHB2 peripheral reset register */
+#define STM32L5_RCC_AHB3RSTR_OFFSET   0x0030  /* AHB3 peripheral reset register */
+#define STM32L5_RCC_APB1RSTR1_OFFSET  0x0038  /* APB1 Peripheral reset register 1 */
+#define STM32L5_RCC_APB1RSTR2_OFFSET  0x003c  /* APB1 Peripheral reset register 2 */
+#define STM32L5_RCC_APB2RSTR_OFFSET   0x0040  /* APB2 Peripheral reset register */
+#define STM32L5_RCC_AHB1ENR_OFFSET    0x0048  /* AHB1 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB2ENR_OFFSET    0x004c  /* AHB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB3ENR_OFFSET    0x0050  /* AHB3 Peripheral Clock enable register */
+#define STM32L5_RCC_APB1ENR1_OFFSET   0x0058  /* APB1 Peripheral Clock enable register 1 */
+#define STM32L5_RCC_APB1ENR2_OFFSET   0x005c  /* APB1 Peripheral Clock enable register 2 */
+#define STM32L5_RCC_APB2ENR_OFFSET    0x0060  /* APB2 Peripheral Clock enable register */
+#define STM32L5_RCC_AHB1SMENR_OFFSET  0x0068  /* RCC AHB1 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB2SMENR_OFFSET  0x006c  /* RCC AHB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_AHB3SMENR_OFFSET  0x0070  /* RCC AHB3 low power mode peripheral clock enable register */
+#define STM32L5_RCC_APB1SMENR1_OFFSET 0x0078  /* RCC APB1 low power mode peripheral clock enable register 1 */
+#define STM32L5_RCC_APB1SMENR2_OFFSET 0x007c  /* RCC APB1 low power mode peripheral clock enable register 2 */
+#define STM32L5_RCC_APB2SMENR_OFFSET  0x0080  /* RCC APB2 low power mode peripheral clock enable register */
+#define STM32L5_RCC_CCIPR_OFFSET      0x0088  /* Peripherals independent clock configuration register 1 */
+#define STM32L5_RCC_BDCR_OFFSET       0x0090  /* Backup domain control register */
+#define STM32L5_RCC_CSR_OFFSET        0x0094  /* Control/status register */
+#define STM32L5_RCC_CRRCR_OFFSET      0x0098  /* Clock recovery RC register */
+#define STM32L5_RCC_CCIPR2_OFFSET     0x009c  /* Peripherals independent clock configuration register 2 */
+#define STM32L5_RCC_SECCFGR_OFFSET    0x00b8  /* Secure configuration register */
+#define STM32L5_RCC_SECSR_OFFSET      0x00bc  /* Secure status register */
+#define STM32L5_RCC_AHB1SECSR_OFFSET  0x00e8  /* AHB1 security status register */
+#define STM32L5_RCC_AHB2SECSR_OFFSET  0x00ec  /* AHB2 security status register */
+#define STM32L5_RCC_AHB3SECSR_OFFSET  0x00f0  /* AHB3 security status register */
+#define STM32L5_RCC_APB1SECSR1_OFFSET 0x00f8  /* APB1 security status register 1 */
+#define STM32L5_RCC_APB1SECSR2_OFFSET 0x00fc  /* APB1 security status register 2 */
+#define STM32L5_RCC_APB2SECSR_OFFSET  0x0100  /* APB2 security status register */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_RCC_CR                (STM32L5_RCC_BASE+STM32L5_RCC_CR_OFFSET)

Review comment:
       formatting  is not consistent

##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       Formatting is not consistent 

##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       " 
   some files have (N+O)  some have (N + O)

##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       I blew this on the F7/H7 and it is coming back to bite us on EMI and overshoot.
   
   Remove the drive strengths on all GPIO, all GPIO will need to have a _n - the board config should set this, using the _n |   GPIO_SPEED_xxMHz it needs. 

##########
File path: arch/arm/src/stm32l5/stm32l5_lse.c
##########
@@ -0,0 +1,166 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/stm32l5_lse.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Michael Jung <mi...@gmx.net>
+ *
+ * Based on arch/arm/src/stm32l4/stm32l4_lse.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *   Author: dev@ziggurat29.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "arm_arch.h"
+
+#include "stm32l5_pwr.h"
+#include "stm32l5_rcc.h"
+#include "stm32l5_waste.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32l5_rcc_enablelse
+ *
+ * Description:
+ *   Enable the External Low-Speed (LSE) oscillator and the LSE system clock.
+ *
+ ****************************************************************************/
+
+void stm32l5_rcc_enablelse(void)
+{
+  bool writable;
+  uint32_t regval;
+
+  /* Check if both the External Low-Speed (LSE) oscillator and the LSE system
+   * clock are already running.
+   */
+
+  regval = getreg32(STM32L5_RCC_BDCR);
+
+  if ((regval & (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN)) !=
+                (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN))
+    {
+      /* The LSE is in the RTC domain and write access is denied to this
+       * domain after reset, you have to enable write access using DBP bit in
+       * the PWR CR register before to configuring the LSE.
+       */
+
+      writable = stm32l5_pwr_enablebkp(true);
+
+      /* Enable the External Low-Speed (LSE) oscillator by setting the LSEON
+       * bit the RCC BDCR register.
+       */
+
+      regval |= RCC_BDCR_LSEON;
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+      /* Set start-up drive capability for LSE oscillator. */
+
+      regval &= ~RCC_BDCR_LSEDRV_MASK;
+      regval |= CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
+#endif
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE clock to be ready */
+
+      while (((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
+        {
+          up_waste();
+        }
+
+      /* Enable LSE system clock.  The LSE system clock has been introduced
+       * first by the STM32L5 family of MCUs.  It seems to provide a means
+       * to gate the LSE clock distribution to peripherals.  It must be
+       * enabled for MSI PLL mode (syncing the MSI to the LSE).
+       */
+
+      regval |= RCC_BDCR_LSESYSEN;
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE system clock to be ready */
+
+      while (!((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSESYSRDY))

Review comment:
       This can be an infinite loop if the LSECLOCK_RUN_DRV_CAPABILITY is not set high enough.  See https://github.com/apache/incubator-nuttx/pull/2943 and https://github.com/apache/incubator-nuttx/pull/2967 https://github.com/apache/incubator-nuttx/pull/2969




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594899319



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I think I addressed this with https://github.com/apache/incubator-nuttx/pull/2974/commits/0582434c43ddf642c312b4fc6210d060a151e01f (same commit as referenced above). Can you please have a look?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594486139



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       yes




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900312



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/abf72d375c7788eab2d0419ba2e30e64b28f4d75




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r595084262



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       Spaces have been removed with separate commit https://github.com/apache/incubator-nuttx/commit/70759650d9cf4d499a75e22a8f0eb91a5c07bb0d




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-791355408


   @xiaoxiang781216 also we need to request @raiden00pl to take a look!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594902175



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/233c38d9adce7a28767bb2edfabb772df0d0fe5b




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r595080968



##########
File path: arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
##########
@@ -0,0 +1,745 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l562xx_pinmap.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L562XX_PINMAP_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Alternate Pin Functions.  All members of the STM32L552xx and STM32L562xx
+ * families share the same pin multiplexing (although they may differ in the
+ * pins physically available).  See DS12736, Table 22 "Alternate Function AF0
+ * to AF7" and Table 23 "Alternate Function AF8 to AF15".
+ *
+ * Alternative pin selections are provided with a numeric suffix like _1, _2,
+ * etc.  Drivers, however, will use the pin selection without the numeric
+ * suffix.  Additional definitions are required in the board.h file.  For
+ * example, if FDCAN1_RX connects vis PA11 on some board, then the following
+ * definitions should appear inthe board.h header file for that board:
+ *
+ * #define GPIO_FDCAN1_RX GPIO_FDCAN1_RX_1
+ *
+ * The driver will then automatically configure PA11 as the FDCAN1 RX pin.
+ */
+
+/* ADC */
+
+#define GPIO_ADC12_IN1         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_ADC12_IN2         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_ADC12_IN3         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_ADC12_IN4         (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_ADC12_IN5         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_ADC12_IN6         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_ADC12_IN7         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_ADC12_IN8         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_ADC12_IN9         (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_ADC12_IN10        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_ADC12_IN11        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_ADC12_IN12        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_ADC12_IN13        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_ADC12_IN14        (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_ADC12_IN15        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_ADC12_IN16        (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+
+/* FDCAN */
+
+#define GPIO_FDCAN1_RX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_FDCAN1_RX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_FDCAN1_RX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_FDCAN1_TX_1       (GPIO_ALT|GPIO_AF9 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_FDCAN1_TX_2       (GPIO_ALT|GPIO_AF9 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_FDCAN1_TX_3       (GPIO_ALT|GPIO_AF9 |GPIO_PORTD|GPIO_PIN1)
+
+/* Clocks outputs */
+
+#define GPIO_MCO               (GPIO_ALT|GPIO_AF0 |GPIO_PORTA|GPIO_PIN8)
+
+/* Comparators */
+
+#define GPIO_COMP1_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_COMP1_INM_2       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_COMP1_INP_1       (GPIO_ANALOG|GPIO_PORTC|GPIO_PIN5)
+#define GPIO_COMP1_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN2)
+#define GPIO_COMP1_INP_3       (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_COMP1_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_COMP1_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN10)
+
+#define GPIO_COMP2_INM_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_COMP2_INM_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_COMP2_INP_1       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_COMP2_INP_2       (GPIO_ANALOG|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_COMP2_OUT_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_COMP2_OUT_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN11)
+
+/* DAC */
+
+#define GPIO_DAC1_OUT_1        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_DAC1_OUT_2        (GPIO_ANALOG|GPIO_PORTA|GPIO_PIN5)
+
+/* Digital Filter for Sigma-Delta Modulators (DFSDM) */
+
+#define GPIO_DFSDM_DATIN0_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN1)
+#define GPIO_DFSDM_DATIN0_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_DFSDM_DATIN1_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_DFSDM_DATIN1_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_DFSDM_DATIN2_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_DFSDM_DATIN2_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_1    (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN7)
+#define GPIO_DFSDM_DATIN3_2    (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN4)
+
+#define GPIO_DFSDM_CKIN0_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_DFSDM_CKIN0_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_DFSDM_CKIN1_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_DFSDM_CKIN1_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTD|GPIO_PIN7)
+#define GPIO_DFSDM_CKIN2_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_DFSDM_CKIN2_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN8)
+#define GPIO_DFSDM_CKIN3_1     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_DFSDM_CKIN3_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_DFSDM_CKOUT_1     (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_DFSDM_CKOUT_2     (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_DFSDM_CKOUT_3     (GPIO_ALT|GPIO_AF6 |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_DFSDM_CKOUT_4     (GPIO_ALT|GPIO_AF6 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_DFSDM_CKOUT_5     (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN7)
+
+/* I2C */
+
+#define GPIO_I2C1_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN13)
+#define GPIO_I2C1_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_I2C1_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C1_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN15)
+
+#define GPIO_I2C2_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_I2C2_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_I2C2_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN2)
+
+#define GPIO_I2C3_SDA_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_I2C3_SDA_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_I2C3_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN8)
+#define GPIO_I2C3_SCL_1        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_I2C3_SCL_2        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_I2C3_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTG|GPIO_PIN7)
+#define GPIO_I2C3_SMBA_1       (GPIO_ALT|GPIO_AF4 |GPIO_PORTB|GPIO_PIN2)
+#define GPIO_I2C3_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTG|GPIO_PIN6)
+
+#define GPIO_I2C4_SDA_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C4_SDA_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C4_SDA_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN13)
+#define GPIO_I2C4_SDA_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN15)
+#define GPIO_I2C4_SCL_1        (GPIO_ALT|GPIO_AF5 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C4_SCL_2        (GPIO_ALT|GPIO_AF3 |GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C4_SCL_3        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_I2C4_SCL_4        (GPIO_ALT|GPIO_AF4 |GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14)
+#define GPIO_I2C4_SMBA_2       (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11)
+#define GPIO_I2C4_SMBA_3       (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14)
+
+/* JTAG */
+
+#define GPIO_JTCK_SWCLK        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_JTDI              (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_JTDO              (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_JTMS_SWDAT        (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_JTRST             (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
+
+/* OCTOSPI */
+
+#define GPIO_OSPI_NCS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_OSPI_NCS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_OSPI_NCS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_OSPI_NCS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_OSPI_NCS_5        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_1       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_OSPI_NCLK_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN11)
+#define GPIO_OSPI_NCLK_3       (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_OSPI_NCLK_4       (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_OSPI_CLK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTF|GPIO_PIN10)
+#define GPIO_OSPI_CLK_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_OSPI_CLK_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_OSPI_CLK_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_OSPI_IO0_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_OSPI_IO0_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_OSPI_IO0_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_OSPI_IO1_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_OSPI_IO1_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_OSPI_IO1_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_OSPI_IO2_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_OSPI_IO2_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN7)
+#define GPIO_OSPI_IO3_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_OSPI_IO3_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN15)
+#define GPIO_OSPI_IO3_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_OSPI_IO4_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_OSPI_IO4_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_OSPI_IO4_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN4)
+#define GPIO_OSPI_IO5_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_OSPI_IO5_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN2)
+#define GPIO_OSPI_IO5_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN5)
+#define GPIO_OSPI_IO6_1        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_OSPI_IO6_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_OSPI_IO7_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN0)
+#define GPIO_OSPI_IO7_2        (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN4)
+#define GPIO_OSPI_IO7_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN7)
+#define GPIO_OSPI_DQS_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN3)
+#define GPIO_OSPI_DQS_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN6)
+#define GPIO_OSPI_DQS_3        (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_OSPI_DQS_4        (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN2)
+
+/* RTC */
+
+#define GPIO_RTC_REFIN         (GPIO_ALT|GPIO_AF0 |GPIO_PORTB|GPIO_PIN15)
+
+/* SAI */
+
+#define GPIO_SAI1_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_SAI1_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN0)
+
+#define GPIO_SAI1_D1_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D1_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_D1_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_D1_4         (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_D1_5         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_D2_1         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D2_2         (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_D2_3         (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_D3_1         (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN10)
+#define GPIO_SAI1_D3_2         (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN5)
+
+#define GPIO_SAI1_CK1_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_CK1_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_CK1_3        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_CK1_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTG|GPIO_PIN7)
+#define GPIO_SAI1_CK2_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_CK2_2        (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN5)
+
+#define GPIO_SAI1_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SAI1_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN4)
+#define GPIO_SAI1_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_SAI1_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SAI1_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN5)
+#define GPIO_SAI1_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_SAI1_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SAI1_SD_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SAI1_SD_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SAI1_SD_A_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_SAI1_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SAI1_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN2)
+#define GPIO_SAI1_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN7)
+
+#define GPIO_SAI1_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SAI1_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN14)
+#define GPIO_SAI1_FS_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_SAI1_FS_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_SAI1_FS_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN9)
+#define GPIO_SAI1_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SAI1_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_SAI1_SCK_B_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN8)
+#define GPIO_SAI1_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN13)
+#define GPIO_SAI1_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SAI1_SD_B_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN3)
+#define GPIO_SAI1_SD_B_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN7)
+#define GPIO_SAI1_SD_B_5       (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN6)
+#define GPIO_SAI1_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SAI1_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_SAI1_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTF|GPIO_PIN7)
+
+#define GPIO_SAI2_EXTCLK_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_SAI2_EXTCLK_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN9)
+
+#define GPIO_SAI2_FS_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SAI2_FS_A_3       (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN12)
+#define GPIO_SAI2_FS_A_4       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN10)
+#define GPIO_SAI2_SCK_A_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SAI2_SCK_A_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN11)
+#define GPIO_SAI2_SCK_A_3      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SAI2_SD_A_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SAI2_SD_A_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_A_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SAI2_MCLK_A_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SAI2_MCLK_A_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTD|GPIO_PIN9)
+#define GPIO_SAI2_MCLK_A_4     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN11)
+
+#define GPIO_SAI2_FS_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SAI2_FS_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN3)
+#define GPIO_SAI2_SCK_B_1      (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SAI2_SCK_B_2      (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SAI2_SD_B_1       (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SAI2_SD_B_2       (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SAI2_MCLK_B_1     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SAI2_MCLK_B_2     (GPIO_ALT|GPIO_AF13|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SAI2_MCLK_B_3     (GPIO_ALT|GPIO_AF13|GPIO_PORTG|GPIO_PIN4)
+
+/* SDIO */
+
+#define GPIO_SDMMC1_CKIN_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_CDIR_1     (GPIO_ALT|GPIO_AF8 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D0DIR_1    (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D123DIR_1  (GPIO_ALT|GPIO_AF8 |GPIO_PORTC|GPIO_PIN7)
+
+#define GPIO_SDMMC1_D0_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN8)
+#define GPIO_SDMMC1_D1_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_SDMMC1_D2_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SDMMC1_D3_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SDMMC1_D4_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_SDMMC1_D5_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SDMMC1_D5_2       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN0)
+#define GPIO_SDMMC1_D6_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN6)
+#define GPIO_SDMMC1_D7_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN7)
+#define GPIO_SDMMC1_CK_1       (GPIO_ALT|GPIO_AF12|GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SDMMC1_CMD_1      (GPIO_ALT|GPIO_AF12|GPIO_PORTD|GPIO_PIN2)
+
+/* SPI */
+
+#define GPIO_SPI1_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI1_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI1_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN0)
+#define GPIO_SPI1_NSS_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN12)
+#define GPIO_SPI1_NSS_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN5)
+#define GPIO_SPI1_SCK_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN1)
+#define GPIO_SPI1_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_SPI1_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI1_SCK_4        (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_SPI1_SCK_5        (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN2)
+#define GPIO_SPI1_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN7)
+#define GPIO_SPI1_MOSI_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_SPI1_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI1_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_SPI1_MOSI_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN4)
+#define GPIO_SPI1_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_SPI1_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_SPI1_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI1_MISO_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_SPI1_MISO_5       (GPIO_ALT|GPIO_AF5 |GPIO_PORTG|GPIO_PIN3)
+
+#define GPIO_SPI2_NSS_1        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN9)
+#define GPIO_SPI2_NSS_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_SPI2_NSS_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN0)
+#define GPIO_SPI2_SCK_1        (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SPI2_SCK_2        (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN13)
+#define GPIO_SPI2_SCK_3        (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN1)
+#define GPIO_SPI2_SCK_4        (GPIO_ALT|GPIO_AF3 |GPIO_PORTD|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN15)
+#define GPIO_SPI2_MOSI_2       (GPIO_ALT|GPIO_AF3 |GPIO_PORTC|GPIO_PIN1)
+#define GPIO_SPI2_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN3)
+#define GPIO_SPI2_MOSI_4       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN4)
+#define GPIO_SPI2_MISO_1       (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN14)
+#define GPIO_SPI2_MISO_2       (GPIO_ALT|GPIO_AF5 |GPIO_PORTC|GPIO_PIN2)
+#define GPIO_SPI2_MISO_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN3)
+
+#define GPIO_SPI3_NSS_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN4)
+#define GPIO_SPI3_NSS_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_SPI3_NSS_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN12)
+#define GPIO_SPI3_SCK_1        (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN3)
+#define GPIO_SPI3_SCK_2        (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN10)
+#define GPIO_SPI3_SCK_3        (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN9)
+#define GPIO_SPI3_MOSI_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN5)
+#define GPIO_SPI3_MOSI_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN12)
+#define GPIO_SPI3_MOSI_3       (GPIO_ALT|GPIO_AF5 |GPIO_PORTD|GPIO_PIN6)
+#define GPIO_SPI3_MOSI_4       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN11)
+#define GPIO_SPI3_MISO_1       (GPIO_ALT|GPIO_AF6 |GPIO_PORTB|GPIO_PIN4)
+#define GPIO_SPI3_MISO_2       (GPIO_ALT|GPIO_AF6 |GPIO_PORTC|GPIO_PIN11)
+#define GPIO_SPI3_MISO_3       (GPIO_ALT|GPIO_AF6 |GPIO_PORTG|GPIO_PIN10)
+
+/* Timers */
+
+#define GPIO_TIM1_CH1N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_TIM1_CH1N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_TIM1_CH1N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_TIM1_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN9)
+#define GPIO_TIM1_CH2N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_TIM1_CH2N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_TIM1_CH2N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN10)
+#define GPIO_TIM1_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_TIM1_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN11)
+#define GPIO_TIM1_CH3N_1       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN1)
+#define GPIO_TIM1_CH3N_2       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_TIM1_CH3N_3       (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN12)
+#define GPIO_TIM1_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN10)
+#define GPIO_TIM1_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN13)
+#define GPIO_TIM1_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT   |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN_1       (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN_2       (GPIO_ALT|GPIO_AF1 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_3       (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN12)
+#define GPIO_TIM1_BKIN_4       (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_5       (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN15)
+#define GPIO_TIM1_BKIN_6       (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_TIM1_BKIN2_1      (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_BKIN2_2      (GPIO_ALT|GPIO_AF2 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_3      (GPIO_ALT|GPIO_AF3 |GPIO_PORTE|GPIO_PIN14)
+#define GPIO_TIM1_BKIN2_4      (GPIO_ALT|GPIO_AF12|GPIO_PORTA|GPIO_PIN11)
+#define GPIO_TIM1_ETR_1        (GPIO_ALT|GPIO_AF1 |GPIO_PORTA|GPIO_PIN12)
+#define GPIO_TIM1_ETR_2        (GPIO_ALT|GPIO_AF1 |GPIO_PORTE|GPIO_PIN7)
+
+#define GPIO_TIM2_CH1IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1IN_3      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH1OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TIM2_CH1OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_CH1OUT_3     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_CH2IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH2OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_TIM2_CH2OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_TIM2_CH3IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH3OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
+#define GPIO_TIM2_CH3OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_TIM2_CH4IN_1      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4IN_2      (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_CH4OUT_1     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_TIM2_CH4OUT_2     (GPIO_ALT|GPIO_AF1 |GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_TIM2_ETR_1        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN5)
+#define GPIO_TIM2_ETR_2        (GPIO_ALT|GPIO_AF2 |GPIO_PORTA|GPIO_PIN15)
+#define GPIO_TIM2_ETR_3        (GPIO_ALT|GPIO_AF14|GPIO_PORTA|GPIO_PIN0)
+
+#define GPIO_TIM3_CH1IN_1      (GPIO_ALT|GPIO_AF2 |GPIO_SPEED_50MHz|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)

Review comment:
       it left spaces




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594900877



##########
File path: arch/arm/src/stm32l5/stm32l5_lse.c
##########
@@ -0,0 +1,166 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/stm32l5_lse.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Michael Jung <mi...@gmx.net>
+ *
+ * Based on arch/arm/src/stm32l4/stm32l4_lse.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *   Author: dev@ziggurat29.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "arm_arch.h"
+
+#include "stm32l5_pwr.h"
+#include "stm32l5_rcc.h"
+#include "stm32l5_waste.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY
+# if CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY < 0 || \
+     CONFIG_STM32L5_RTC_LSECLOCK_RUN_DRV_CAPABILITY > 3
+#  error "Invalid LSE drive capability setting"
+#endif
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32l5_rcc_enablelse
+ *
+ * Description:
+ *   Enable the External Low-Speed (LSE) oscillator and the LSE system clock.
+ *
+ ****************************************************************************/
+
+void stm32l5_rcc_enablelse(void)
+{
+  bool writable;
+  uint32_t regval;
+
+  /* Check if both the External Low-Speed (LSE) oscillator and the LSE system
+   * clock are already running.
+   */
+
+  regval = getreg32(STM32L5_RCC_BDCR);
+
+  if ((regval & (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN)) !=
+                (RCC_BDCR_LSEON | RCC_BDCR_LSERDY |
+                 RCC_BDCR_LSESYSEN | RCC_BDCR_LSESYSEN))
+    {
+      /* The LSE is in the RTC domain and write access is denied to this
+       * domain after reset, you have to enable write access using DBP bit in
+       * the PWR CR register before to configuring the LSE.
+       */
+
+      writable = stm32l5_pwr_enablebkp(true);
+
+      /* Enable the External Low-Speed (LSE) oscillator by setting the LSEON
+       * bit the RCC BDCR register.
+       */
+
+      regval |= RCC_BDCR_LSEON;
+
+#ifdef CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY
+      /* Set start-up drive capability for LSE oscillator. */
+
+      regval &= ~RCC_BDCR_LSEDRV_MASK;
+      regval |= CONFIG_STM32L5_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
+#endif
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE clock to be ready */
+
+      while (((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSERDY) == 0)
+        {
+          up_waste();
+        }
+
+      /* Enable LSE system clock.  The LSE system clock has been introduced
+       * first by the STM32L5 family of MCUs.  It seems to provide a means
+       * to gate the LSE clock distribution to peripherals.  It must be
+       * enabled for MSI PLL mode (syncing the MSI to the LSE).
+       */
+
+      regval |= RCC_BDCR_LSESYSEN;
+
+      putreg32(regval, STM32L5_RCC_BDCR);
+
+      /* Wait for the LSE system clock to be ready */
+
+      while (!((regval = getreg32(STM32L5_RCC_BDCR)) & RCC_BDCR_LSESYSRDY))

Review comment:
       Please have a look at https://github.com/apache/incubator-nuttx/pull/2974/commits/8767cf85523812fc7e0cc6de97c1829065a9a98a




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-791313120


   @davids5 could you take a look? you are STM expert.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on a change in pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on a change in pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#discussion_r594899319



##########
File path: arch/arm/src/stm32l5/hardware/stm32l5_exti.h
##########
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * arch/arm/src/stm32l5/hardware/stm32l5_exti.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+#define __ARCH_ARM_SRC_STM32L5_HARDWARE_STM32L5_EXTI_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include "chip.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Register Offsets *********************************************************/
+
+#define STM32L5_EXTI_RTSR1_OFFSET      0x0000  /* Rising Trigger Selection 1       */
+#define STM32L5_EXTI_FTSR1_OFFSET      0x0004  /* Falling Trigger Selection 1      */
+#define STM32L5_EXTI_SWIER1_OFFSET     0x0008  /* Software Interrupt Event 1       */
+#define STM32L5_EXTI_RPR1_OFFSET       0x000c  /* Rising Edge Pending 1            */
+#define STM32L5_EXTI_FPR1_OFFSET       0x0010  /* Falling Edge Pending 1           */
+#define STM32L5_EXTI_SECCFGR1_OFFSET   0x0014  /* Security Configuration 1         */
+#define STM32L5_EXTI_PRIVCFGR1_OFFSET  0x0018  /* Privilege Configuration 1        */
+#define STM32L5_EXTI_RTSR2_OFFSET      0x0020  /* Rising Trigger Selection 2       */
+#define STM32L5_EXTI_FTSR2_OFFSET      0x0024  /* Falling Trigger Selection 2      */
+#define STM32L5_EXTI_SWIER2_OFFSET     0x0028  /* Software Interrupt Event 2       */
+#define STM32L5_EXTI_RPR2_OFFSET       0x002c  /* Rising Edge Pending 2            */
+#define STM32L5_EXTI_FPR2_OFFSET       0x0030  /* Falling Edge Pending 2           */
+#define STM32L5_EXTI_SECCFGR2_OFFSET   0x0034  /* Security Configuration 2         */
+#define STM32L5_EXTI_PRIVCFGR2_OFFSET  0x0038  /* Privilege Configuration 2        */
+#define STM32L5_EXTI_EXTICR1_OFFSET    0x0060  /* External Interrupt Selection 1   */
+#define STM32L5_EXTI_EXTICR2_OFFSET    0x0060  /* External Interrupt Selection 2   */
+#define STM32L5_EXTI_EXTICR3_OFFSET    0x0060  /* External Interrupt Selection 3   */
+#define STM32L5_EXTI_EXTICR4_OFFSET    0x0060  /* External Interrupt Selection 4   */
+#define STM32L5_EXTI_LOCKR_OFFSET      0x0070  /* Lock                             */
+#define STM32L5_EXTI_IMR1_OFFSET       0x0080  /* CPU Wakeup with Interrupt Mask 1 */
+#define STM32L5_EXTI_EMR1_OFFSET       0x0084  /* CPU Wakeup with Event Mask 1     */
+#define STM32L5_EXTI_IMR2_OFFSET       0x0090  /* CPU Wakeup with Interrupt Mask 2 */
+#define STM32L5_EXTI_EMR2_OFFSET       0x0094  /* CPU Wakeup with Event Mask 2     */
+
+/* Register Addresses *******************************************************/
+
+#define STM32L5_EXTI_RTSR1      (STM32L5_EXTI_BASE+STM32L5_EXTI_RTSR1_OFFSET)

Review comment:
       I think I addressed this with https://github.com/apache/incubator-nuttx/pull/2974/commits/66f6a22c40060bd66b0f5fe6053b1dbfb70bf326 (same commit as referenced above). Can you please have a look?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung edited a comment on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung edited a comment on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-790516563


   The remaining files with a BSD license header are:
   
   hardware/stm32l562xx_dbgmcu.h
   hardware/stm32l5_flash.h
   hardware/stm32l5_pwr.h
   hardware/stm32l5_spi.h
   hardware/stm32l5_syscfg.h
   hardware/stm32l5_tim.h
   hardware/stm32l5_uart.h
   stm32l5_allocateheap.c
   stm32l5_flash.c
   stm32l5_flash.h
   stm32l5_gpio.h
   stm32l5_gpio.c
   stm32l5_irq.c
   stm32l5_lse.c
   stm32l5_lsi.c
   stm32l5_rcc.c
   stm32l5_rcc.h
   stm32l5_serial.c
   stm32l5_spi.c
   stm32l5_spi.h
   stm32l5_tim.c
   stm32l5_tim.h
   stm32l5_tim_lowerhalf.c
   stm32l5_uart.h
   
   Most of them can get cleared if we get ICLAs or an SGA from the Haltian team.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] michi-jung commented on pull request #2974: STM32L5 Architecture Support

Posted by GitBox <gi...@apache.org>.
michi-jung commented on pull request #2974:
URL: https://github.com/apache/incubator-nuttx/pull/2974#issuecomment-799442242


   Hi @acassis, I will try to resolve @davids5's review comments tonight. Once that is done its fine with me to go ahead and merge it. Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org