From 90dac8f895f783abd8750e2b3b38a2d7cb98ab3c Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 3 Nov 2015 13:13:01 +0000 Subject: Mass update for board files (only those with .chcfg files). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8431 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/boards/OLIMEX_STM32_E407/board.c | 2 +- os/hal/boards/OLIMEX_STM32_E407/board.h | 668 ++++++++++++++------------ os/hal/boards/OLIMEX_STM32_E407_REV_D/board.h | 356 ++++++++------ os/hal/boards/OLIMEX_STM32_H407/board.h | 356 ++++++++------ os/hal/boards/ST_NUCLEO_F030R8/board.h | 184 +++---- os/hal/boards/ST_NUCLEO_F072RB/board.h | 215 +++++---- os/hal/boards/ST_NUCLEO_F091RC/board.h | 215 +++++---- os/hal/boards/ST_NUCLEO_F302R8/board.h | 216 +++++---- os/hal/boards/ST_NUCLEO_F334R8/board.h | 216 +++++---- os/hal/boards/ST_NUCLEO_F401RE/board.h | 319 ++++++------ os/hal/boards/ST_NUCLEO_F411RE/board.h | 319 ++++++------ os/hal/boards/ST_NUCLEO_L053R8/board.h | 23 +- os/hal/boards/ST_NUCLEO_L152RE/board.h | 284 ++++++----- os/hal/boards/ST_NUCLEO_L476RG/board.h | 284 ++++++----- os/hal/boards/ST_STM32373C_EVAL/board.h | 258 ++++++---- os/hal/boards/ST_STM32F072B_DISCOVERY/board.h | 227 +++++---- os/hal/boards/ST_STM32F0_DISCOVERY/board.h | 184 +++---- os/hal/boards/ST_STM32F3_DISCOVERY/board.h | 238 +++++---- os/hal/boards/ST_STM32F429I_DISCOVERY/board.h | 402 ++++++++++------ os/hal/boards/ST_STM32F4_DISCOVERY/board.h | 340 +++++++------ os/hal/boards/ST_STM32F746G_DISCOVERY/board.h | 4 +- os/hal/boards/ST_STM32L_DISCOVERY/board.h | 222 +++++---- 22 files changed, 3104 insertions(+), 2428 deletions(-) (limited to 'os/hal') diff --git a/os/hal/boards/OLIMEX_STM32_E407/board.c b/os/hal/boards/OLIMEX_STM32_E407/board.c index e2144859f..f67cc2962 100644 --- a/os/hal/boards/OLIMEX_STM32_E407/board.c +++ b/os/hal/boards/OLIMEX_STM32_E407/board.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/boards/OLIMEX_STM32_E407/board.h b/os/hal/boards/OLIMEX_STM32_E407/board.h index e0034beaf..6402a0f50 100644 --- a/os/hal/boards/OLIMEX_STM32_E407/board.h +++ b/os/hal/boards/OLIMEX_STM32_E407/board.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,18 +37,18 @@ * Board oscillators-related settings. */ #if !defined(STM32_LSECLK) -#define STM32_LSECLK 32768 +#define STM32_LSECLK 32768U #endif #if !defined(STM32_HSECLK) -#define STM32_HSECLK 12000000 +#define STM32_HSECLK 12000000U #endif /* * Board voltages. * Required for performance limits calculation. */ -#define STM32_VDD 330 +#define STM32_VDD 330U /* * MCU type as defined in the ST header. @@ -58,180 +58,240 @@ /* * IO pins assignments. */ -#define GPIOA_BUTTON_WKUP 0 -#define GPIOA_ETH_RMII_REF_CLK 1 -#define GPIOA_ETH_RMII_MDIO 2 -#define GPIOA_ETH_RMII_MDINT 3 -#define GPIOA_PIN4 4 -#define GPIOA_PIN5 5 -#define GPIOA_PIN6 6 -#define GPIOA_ETH_RMII_CRS_DV 7 -#define GPIOA_USB_HS_BUSON 8 -#define GPIOA_OTG_FS_VBUS 9 -#define GPIOA_OTG_FS_ID 10 -#define GPIOA_OTG_FS_DM 11 -#define GPIOA_OTG_FS_DP 12 -#define GPIOA_JTAG_TMS 13 -#define GPIOA_JTAG_TCK 14 -#define GPIOA_JTAG_TDI 15 +#define GPIOA_BUTTON_WKUP 0U +#define GPIOA_ETH_RMII_REF_CLK 1U +#define GPIOA_ETH_RMII_MDIO 2U +#define GPIOA_ETH_RMII_MDINT 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_ETH_RMII_CRS_DV 7U +#define GPIOA_USB_HS_BUSON 8U +#define GPIOA_OTG_FS_VBUS 9U +#define GPIOA_OTG_FS_ID 10U +#define GPIOA_OTG_FS_DM 11U +#define GPIOA_OTG_FS_DP 12U +#define GPIOA_JTAG_TMS 13U +#define GPIOA_JTAG_TCK 14U +#define GPIOA_JTAG_TDI 15U -#define GPIOB_USB_FS_BUSON 0 -#define GPIOB_USB_HS_FAULT 1 -#define GPIOB_BOOT1 2 -#define GPIOB_JTAG_TDO 3 -#define GPIOB_JTAG_TRST 4 -#define GPIOB_PIN5 5 -#define GPIOB_PIN6 6 -#define GPIOB_PIN7 7 -#define GPIOB_I2C1_SCL 8 -#define GPIOB_I2C1_SDA 9 -#define GPIOB_SPI2_SCK 10 -#define GPIOB_PIN11 11 -#define GPIOB_OTG_HS_ID 12 -#define GPIOB_OTG_HS_VBUS 13 -#define GPIOB_OTG_HS_DM 14 -#define GPIOB_OTG_HS_DP 15 +#define GPIOB_USB_FS_BUSON 0U +#define GPIOB_USB_HS_FAULT 1U +#define GPIOB_BOOT1 2U +#define GPIOB_JTAG_TDO 3U +#define GPIOB_JTAG_TRST 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_I2C1_SCL 8U +#define GPIOB_I2C1_SDA 9U +#define GPIOB_SPI2_SCK 10U +#define GPIOB_PIN11 11U +#define GPIOB_OTG_HS_ID 12U +#define GPIOB_OTG_HS_VBUS 13U +#define GPIOB_OTG_HS_DM 14U +#define GPIOB_OTG_HS_DP 15U -#define GPIOC_PIN0 0 -#define GPIOC_ETH_RMII_MDC 1 -#define GPIOC_SPI2_MISO 2 -#define GPIOC_SPI2_MOSI 3 -#define GPIOC_ETH_RMII_RXD0 4 -#define GPIOC_ETH_RMII_RXD1 5 -#define GPIOC_USART6_TX 6 -#define GPIOC_USART6_RX 7 -#define GPIOC_SD_D0 8 -#define GPIOC_SD_D1 9 -#define GPIOC_SD_D2 10 -#define GPIOC_SD_D3 11 -#define GPIOC_SD_CLK 12 -#define GPIOC_LED 13 -#define GPIOC_OSC32_IN 14 -#define GPIOC_OSC32_OUT 15 +#define GPIOC_PIN0 0U +#define GPIOC_ETH_RMII_MDC 1U +#define GPIOC_SPI2_MISO 2U +#define GPIOC_SPI2_MOSI 3U +#define GPIOC_ETH_RMII_RXD0 4U +#define GPIOC_ETH_RMII_RXD1 5U +#define GPIOC_USART6_TX 6U +#define GPIOC_USART6_RX 7U +#define GPIOC_SD_D0 8U +#define GPIOC_SD_D1 9U +#define GPIOC_SD_D2 10U +#define GPIOC_SD_D3 11U +#define GPIOC_SD_CLK 12U +#define GPIOC_LED 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U -#define GPIOD_PIN0 0 -#define GPIOD_PIN1 1 -#define GPIOD_SD_CMD 2 -#define GPIOD_PIN3 3 -#define GPIOD_PIN4 4 -#define GPIOD_PIN5 5 -#define GPIOD_PIN6 6 -#define GPIOD_PIN7 7 -#define GPIOD_PIN8 8 -#define GPIOD_PIN9 9 -#define GPIOD_PIN10 10 -#define GPIOD_PIN11 11 -#define GPIOD_PIN12 12 -#define GPIOD_PIN13 13 -#define GPIOD_PIN14 14 -#define GPIOD_PIN15 15 +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_SD_CMD 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U -#define GPIOE_PIN0 0 -#define GPIOE_PIN1 1 -#define GPIOE_PIN2 2 -#define GPIOE_PIN3 3 -#define GPIOE_PIN4 4 -#define GPIOE_PIN5 5 -#define GPIOE_PIN6 6 -#define GPIOE_PIN7 7 -#define GPIOE_PIN8 8 -#define GPIOE_PIN9 9 -#define GPIOE_PIN10 10 -#define GPIOE_PIN11 11 -#define GPIOE_PIN12 12 -#define GPIOE_PIN13 13 -#define GPIOE_PIN14 14 -#define GPIOE_PIN15 15 +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U -#define GPIOF_PIN0 0 -#define GPIOF_PIN1 1 -#define GPIOF_PIN2 2 -#define GPIOF_PIN3 3 -#define GPIOF_PIN4 4 -#define GPIOF_PIN5 5 -#define GPIOF_PIN6 6 -#define GPIOF_PIN7 7 -#define GPIOF_PIN8 8 -#define GPIOF_PIN9 9 -#define GPIOF_PIN10 10 -#define GPIOF_USB_FS_FAULT 11 -#define GPIOF_PIN12 12 -#define GPIOF_PIN13 13 -#define GPIOF_PIN14 14 -#define GPIOF_PIN15 15 +#define GPIOF_PIN0 0U +#define GPIOF_PIN1 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_USB_FS_FAULT 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U -#define GPIOG_PIN0 0 -#define GPIOG_PIN1 1 -#define GPIOG_PIN2 2 -#define GPIOG_PIN3 3 -#define GPIOG_PIN4 4 -#define GPIOG_PIN5 5 -#define GPIOG_PIN6 6 -#define GPIOG_PIN7 7 -#define GPIOG_PIN8 8 -#define GPIOG_PIN9 9 -#define GPIOG_SPI2_CS 10 -#define GPIOG_ETH_RMII_TXEN 11 -#define GPIOG_PIN12 12 -#define GPIOG_ETH_RMII_TXD0 13 -#define GPIOG_ETH_RMII_TXD1 14 -#define GPIOG_PIN15 15 +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_SPI2_CS 10U +#define GPIOG_ETH_RMII_TXEN 11U +#define GPIOG_PIN12 12U +#define GPIOG_ETH_RMII_TXD0 13U +#define GPIOG_ETH_RMII_TXD1 14U +#define GPIOG_PIN15 15U -#define GPIOH_OSC_IN 0 -#define GPIOH_OSC_OUT 1 -#define GPIOH_PIN2 2 -#define GPIOH_PIN3 3 -#define GPIOH_PIN4 4 -#define GPIOH_PIN5 5 -#define GPIOH_PIN6 6 -#define GPIOH_PIN7 7 -#define GPIOH_PIN8 8 -#define GPIOH_PIN9 9 -#define GPIOH_PIN10 10 -#define GPIOH_PIN11 11 -#define GPIOH_PIN12 12 -#define GPIOH_PIN13 13 -#define GPIOH_PIN14 14 -#define GPIOH_PIN15 15 +#define GPIOH_OSC_IN 0U +#define GPIOH_OSC_OUT 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +#define GPIOI_PIN0 0U +#define GPIOI_PIN1 1U +#define GPIOI_PIN2 2U +#define GPIOI_PIN3 3U +#define GPIOI_PIN4 4U +#define GPIOI_PIN5 5U +#define GPIOI_PIN6 6U +#define GPIOI_PIN7 7U +#define GPIOI_PIN8 8U +#define GPIOI_PIN9 9U +#define GPIOI_PIN10 10U +#define GPIOI_PIN11 11U +#define GPIOI_PIN12 12U +#define GPIOI_PIN13 13U +#define GPIOI_PIN14 14U +#define GPIOI_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON_WKUP PAL_LINE(GPIOA, 0U) +#define LINE_ETH_RMII_REF_CLK PAL_LINE(GPIOA, 1U) +#define LINE_ETH_RMII_MDIO PAL_LINE(GPIOA, 2U) +#define LINE_ETH_RMII_MDINT PAL_LINE(GPIOA, 3U) +#define LINE_ETH_RMII_CRS_DV PAL_LINE(GPIOA, 7U) +#define LINE_USB_HS_BUSON PAL_LINE(GPIOA, 8U) +#define LINE_OTG_FS_VBUS PAL_LINE(GPIOA, 9U) +#define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_JTAG_TMS PAL_LINE(GPIOA, 13U) +#define LINE_JTAG_TCK PAL_LINE(GPIOA, 14U) +#define LINE_JTAG_TDI PAL_LINE(GPIOA, 15U) + +#define LINE_USB_FS_BUSON PAL_LINE(GPIOB, 0U) +#define LINE_USB_HS_FAULT PAL_LINE(GPIOB, 1U) +#define LINE_BOOT1 PAL_LINE(GPIOB, 2U) +#define LINE_JTAG_TDO PAL_LINE(GPIOB, 3U) +#define LINE_JTAG_TRST PAL_LINE(GPIOB, 4U) +#define LINE_I2C1_SCL PAL_LINE(GPIOB, 8U) +#define LINE_I2C1_SDA PAL_LINE(GPIOB, 9U) +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 10U) +#define LINE_OTG_HS_ID PAL_LINE(GPIOB, 12U) +#define LINE_OTG_HS_VBUS PAL_LINE(GPIOB, 13U) +#define LINE_OTG_HS_DM PAL_LINE(GPIOB, 14U) +#define LINE_OTG_HS_DP PAL_LINE(GPIOB, 15U) + +#define LINE_ETH_RMII_MDC PAL_LINE(GPIOC, 1U) +#define LINE_SPI2_MISO PAL_LINE(GPIOC, 2U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOC, 3U) +#define LINE_ETH_RMII_RXD0 PAL_LINE(GPIOC, 4U) +#define LINE_ETH_RMII_RXD1 PAL_LINE(GPIOC, 5U) +#define LINE_USART6_TX PAL_LINE(GPIOC, 6U) +#define LINE_USART6_RX PAL_LINE(GPIOC, 7U) +#define LINE_SD_D0 PAL_LINE(GPIOC, 8U) +#define LINE_SD_D1 PAL_LINE(GPIOC, 9U) +#define LINE_SD_D2 PAL_LINE(GPIOC, 10U) +#define LINE_SD_D3 PAL_LINE(GPIOC, 11U) +#define LINE_SD_CLK PAL_LINE(GPIOC, 12U) +#define LINE_LED PAL_LINE(GPIOC, 13U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + +#define LINE_SD_CMD PAL_LINE(GPIOD, 2U) + + +#define LINE_USB_FS_FAULT PAL_LINE(GPIOF, 11U) + +#define LINE_SPI2_CS PAL_LINE(GPIOG, 10U) +#define LINE_ETH_RMII_TXEN PAL_LINE(GPIOG, 11U) +#define LINE_ETH_RMII_TXD0 PAL_LINE(GPIOG, 13U) +#define LINE_ETH_RMII_TXD1 PAL_LINE(GPIOG, 14U) + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) -#define GPIOI_PIN0 0 -#define GPIOI_PIN1 1 -#define GPIOI_PIN2 2 -#define GPIOI_PIN3 3 -#define GPIOI_PIN4 4 -#define GPIOI_PIN5 5 -#define GPIOI_PIN6 6 -#define GPIOI_PIN7 7 -#define GPIOI_PIN8 8 -#define GPIOI_PIN9 9 -#define GPIOI_PIN10 10 -#define GPIOI_PIN11 11 -#define GPIOI_PIN12 12 -#define GPIOI_PIN13 13 -#define GPIOI_PIN14 14 -#define GPIOI_PIN15 15 /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. * Please refer to the STM32 Reference Manual for details. */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) #define PIN_ODR_LOW(n) (0U << (n)) #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) /* * GPIOA setup: @@ -285,22 +345,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TMS) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TCK) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON_WKUP) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_REF_CLK) |\ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDIO) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDINT) |\ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_PIN5) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_CRS_DV) |\ - PIN_OSPEED_100M(GPIOA_USB_HS_BUSON) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_VBUS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TMS) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TCK) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TDI)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON_WKUP) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_REF_CLK) |\ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDIO) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDINT) |\ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_PIN5) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_CRS_DV) |\ + PIN_OSPEED_HIGH(GPIOA_USB_HS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TMS) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TCK) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TDI)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON_WKUP) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_REF_CLK) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_MDIO) |\ @@ -402,22 +462,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_VBUS) |\ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DM) | \ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DP)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_USB_FS_BUSON) | \ - PIN_OSPEED_100M(GPIOB_USB_HS_FAULT) | \ - PIN_OSPEED_100M(GPIOB_BOOT1) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TDO) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TRST) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ - PIN_OSPEED_100M(GPIOB_SPI2_SCK) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_ID) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_VBUS) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DM) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DP)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_USB_FS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOB_USB_HS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOB_BOOT1) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TDO) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TRST) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \ + PIN_OSPEED_HIGH(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_ID) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DM) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DP)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_USB_FS_BUSON) |\ PIN_PUPDR_FLOATING(GPIOB_USB_HS_FAULT) |\ PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \ @@ -519,22 +579,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_LED) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_MDC) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MISO) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MOSI) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD1) | \ - PIN_OSPEED_100M(GPIOC_USART6_TX) | \ - PIN_OSPEED_100M(GPIOC_USART6_RX) | \ - PIN_OSPEED_100M(GPIOC_SD_D0) | \ - PIN_OSPEED_100M(GPIOC_SD_D1) | \ - PIN_OSPEED_100M(GPIOC_SD_D2) | \ - PIN_OSPEED_100M(GPIOC_SD_D3) | \ - PIN_OSPEED_100M(GPIOC_SD_CLK) | \ - PIN_OSPEED_100M(GPIOC_LED) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_MDC) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MISO) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MOSI) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD1) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_TX) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_RX) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D0) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D1) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D2) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D3) | \ + PIN_OSPEED_HIGH(GPIOC_SD_CLK) | \ + PIN_OSPEED_HIGH(GPIOC_LED) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_MDC) |\ PIN_PUPDR_FLOATING(GPIOC_SPI2_MISO) | \ @@ -636,22 +696,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_SD_CMD) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_SD_CMD) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_FLOATING(GPIOD_SD_CMD) | \ @@ -753,22 +813,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -870,22 +930,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_USB_FS_FAULT) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_USB_FS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -987,22 +1047,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD0) |\ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD1) |\ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_SPI2_CS) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXEN) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD0) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD1) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_SPI2_CS) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXEN) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD0) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1104,22 +1164,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1221,22 +1281,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.h b/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.h index 48d7db81e..c2001d373 100644 --- a/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.h +++ b/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.h @@ -211,6 +211,66 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON_WKUP PAL_LINE(GPIOA, 0U) +#define LINE_ETH_RMII_REF_CLK PAL_LINE(GPIOA, 1U) +#define LINE_ETH_RMII_MDIO PAL_LINE(GPIOA, 2U) +#define LINE_ETH_RMII_MDINT PAL_LINE(GPIOA, 3U) +#define LINE_ETH_RMII_CRS_DV PAL_LINE(GPIOA, 7U) +#define LINE_USB_HS_BUSON PAL_LINE(GPIOA, 8U) +#define LINE_OTG_FS_VBUS PAL_LINE(GPIOA, 9U) +#define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_JTAG_TMS PAL_LINE(GPIOA, 13U) +#define LINE_JTAG_TCK PAL_LINE(GPIOA, 14U) +#define LINE_JTAG_TDI PAL_LINE(GPIOA, 15U) + +#define LINE_USB_FS_BUSON PAL_LINE(GPIOB, 0U) +#define LINE_USB_FS_FAULT PAL_LINE(GPIOB, 1U) +#define LINE_BOOT1 PAL_LINE(GPIOB, 2U) +#define LINE_JTAG_TDO PAL_LINE(GPIOB, 3U) +#define LINE_JTAG_TRST PAL_LINE(GPIOB, 4U) +#define LINE_I2C1_SCL PAL_LINE(GPIOB, 8U) +#define LINE_I2C1_SDA PAL_LINE(GPIOB, 9U) +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 10U) +#define LINE_OTG_HS_ID PAL_LINE(GPIOB, 12U) +#define LINE_OTG_HS_VBUS PAL_LINE(GPIOB, 13U) +#define LINE_OTG_HS_DM PAL_LINE(GPIOB, 14U) +#define LINE_OTG_HS_DP PAL_LINE(GPIOB, 15U) + +#define LINE_ETH_RMII_MDC PAL_LINE(GPIOC, 1U) +#define LINE_SPI2_MISO PAL_LINE(GPIOC, 2U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOC, 3U) +#define LINE_ETH_RMII_RXD0 PAL_LINE(GPIOC, 4U) +#define LINE_ETH_RMII_RXD1 PAL_LINE(GPIOC, 5U) +#define LINE_USART6_TX PAL_LINE(GPIOC, 6U) +#define LINE_USART6_RX PAL_LINE(GPIOC, 7U) +#define LINE_SD_D0 PAL_LINE(GPIOC, 8U) +#define LINE_SD_D1 PAL_LINE(GPIOC, 9U) +#define LINE_SD_D2 PAL_LINE(GPIOC, 10U) +#define LINE_SD_D3 PAL_LINE(GPIOC, 11U) +#define LINE_SD_CLK PAL_LINE(GPIOC, 12U) +#define LINE_LED PAL_LINE(GPIOC, 13U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + +#define LINE_SD_CMD PAL_LINE(GPIOD, 2U) + + +#define LINE_USB_HS_FAULT PAL_LINE(GPIOF, 11U) + +#define LINE_SPI2_CS PAL_LINE(GPIOG, 10U) +#define LINE_ETH_RMII_TXEN PAL_LINE(GPIOG, 11U) +#define LINE_ETH_RMII_TXD0 PAL_LINE(GPIOG, 13U) +#define LINE_ETH_RMII_TXD1 PAL_LINE(GPIOG, 14U) + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -224,10 +284,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -285,22 +345,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TMS) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TCK) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON_WKUP) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_REF_CLK) |\ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDIO) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDINT) |\ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_PIN5) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_CRS_DV) |\ - PIN_OSPEED_100M(GPIOA_USB_HS_BUSON) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_VBUS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TMS) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TCK) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TDI)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON_WKUP) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_REF_CLK) |\ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDIO) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDINT) |\ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_PIN5) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_CRS_DV) |\ + PIN_OSPEED_HIGH(GPIOA_USB_HS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TMS) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TCK) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TDI)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON_WKUP) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_REF_CLK) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_MDIO) |\ @@ -402,22 +462,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_VBUS) |\ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DM) | \ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DP)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_USB_FS_BUSON) | \ - PIN_OSPEED_100M(GPIOB_USB_FS_FAULT) | \ - PIN_OSPEED_100M(GPIOB_BOOT1) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TDO) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TRST) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ - PIN_OSPEED_100M(GPIOB_SPI2_SCK) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_ID) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_VBUS) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DM) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DP)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_USB_FS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOB_USB_FS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOB_BOOT1) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TDO) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TRST) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \ + PIN_OSPEED_HIGH(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_ID) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DM) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DP)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_USB_FS_BUSON) |\ PIN_PUPDR_FLOATING(GPIOB_USB_FS_FAULT) |\ PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \ @@ -519,22 +579,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_LED) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_MDC) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MISO) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MOSI) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD1) | \ - PIN_OSPEED_100M(GPIOC_USART6_TX) | \ - PIN_OSPEED_100M(GPIOC_USART6_RX) | \ - PIN_OSPEED_100M(GPIOC_SD_D0) | \ - PIN_OSPEED_100M(GPIOC_SD_D1) | \ - PIN_OSPEED_100M(GPIOC_SD_D2) | \ - PIN_OSPEED_100M(GPIOC_SD_D3) | \ - PIN_OSPEED_100M(GPIOC_SD_CLK) | \ - PIN_OSPEED_100M(GPIOC_LED) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_MDC) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MISO) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MOSI) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD1) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_TX) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_RX) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D0) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D1) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D2) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D3) | \ + PIN_OSPEED_HIGH(GPIOC_SD_CLK) | \ + PIN_OSPEED_HIGH(GPIOC_LED) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_MDC) |\ PIN_PUPDR_FLOATING(GPIOC_SPI2_MISO) | \ @@ -636,22 +696,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_SD_CMD) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_SD_CMD) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_FLOATING(GPIOD_SD_CMD) | \ @@ -753,22 +813,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -870,22 +930,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_USB_HS_FAULT) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_USB_HS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -987,22 +1047,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD0) |\ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD1) |\ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_SPI2_CS) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXEN) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD0) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD1) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_SPI2_CS) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXEN) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD0) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1104,22 +1164,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1221,22 +1281,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/OLIMEX_STM32_H407/board.h b/os/hal/boards/OLIMEX_STM32_H407/board.h index 1e2fb3b31..9685de7dd 100644 --- a/os/hal/boards/OLIMEX_STM32_H407/board.h +++ b/os/hal/boards/OLIMEX_STM32_H407/board.h @@ -211,6 +211,66 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON_WKUP PAL_LINE(GPIOA, 0U) +#define LINE_ETH_RMII_REF_CLK PAL_LINE(GPIOA, 1U) +#define LINE_ETH_RMII_MDIO PAL_LINE(GPIOA, 2U) +#define LINE_ETH_RMII_MDINT PAL_LINE(GPIOA, 3U) +#define LINE_ETH_RMII_CRS_DV PAL_LINE(GPIOA, 7U) +#define LINE_USB_HS_BUSON PAL_LINE(GPIOA, 8U) +#define LINE_OTG_FS_VBUS PAL_LINE(GPIOA, 9U) +#define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_JTAG_TMS PAL_LINE(GPIOA, 13U) +#define LINE_JTAG_TCK PAL_LINE(GPIOA, 14U) +#define LINE_JTAG_TDI PAL_LINE(GPIOA, 15U) + +#define LINE_USB_FS_BUSON PAL_LINE(GPIOB, 0U) +#define LINE_USB_HS_FAULT PAL_LINE(GPIOB, 1U) +#define LINE_BOOT1 PAL_LINE(GPIOB, 2U) +#define LINE_JTAG_TDO PAL_LINE(GPIOB, 3U) +#define LINE_JTAG_TRST PAL_LINE(GPIOB, 4U) +#define LINE_I2C1_SCL PAL_LINE(GPIOB, 8U) +#define LINE_I2C1_SDA PAL_LINE(GPIOB, 9U) +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 10U) +#define LINE_OTG_HS_ID PAL_LINE(GPIOB, 12U) +#define LINE_OTG_HS_VBUS PAL_LINE(GPIOB, 13U) +#define LINE_OTG_HS_DM PAL_LINE(GPIOB, 14U) +#define LINE_OTG_HS_DP PAL_LINE(GPIOB, 15U) + +#define LINE_ETH_RMII_MDC PAL_LINE(GPIOC, 1U) +#define LINE_SPI2_MISO PAL_LINE(GPIOC, 2U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOC, 3U) +#define LINE_ETH_RMII_RXD0 PAL_LINE(GPIOC, 4U) +#define LINE_ETH_RMII_RXD1 PAL_LINE(GPIOC, 5U) +#define LINE_USART6_TX PAL_LINE(GPIOC, 6U) +#define LINE_USART6_RX PAL_LINE(GPIOC, 7U) +#define LINE_SD_D0 PAL_LINE(GPIOC, 8U) +#define LINE_SD_D1 PAL_LINE(GPIOC, 9U) +#define LINE_SD_D2 PAL_LINE(GPIOC, 10U) +#define LINE_SD_D3 PAL_LINE(GPIOC, 11U) +#define LINE_SD_CLK PAL_LINE(GPIOC, 12U) +#define LINE_LED PAL_LINE(GPIOC, 13U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + +#define LINE_SD_CMD PAL_LINE(GPIOD, 2U) + + +#define LINE_USB_FS_FAULT PAL_LINE(GPIOF, 11U) + +#define LINE_SPI2_CS PAL_LINE(GPIOG, 10U) +#define LINE_ETH_RMII_TXEN PAL_LINE(GPIOG, 11U) +#define LINE_ETH_RMII_TXD0 PAL_LINE(GPIOG, 13U) +#define LINE_ETH_RMII_TXD1 PAL_LINE(GPIOG, 14U) + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -224,10 +284,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -285,22 +345,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TMS) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TCK) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON_WKUP) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_REF_CLK) |\ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDIO) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_MDINT) |\ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_PIN5) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_ETH_RMII_CRS_DV) |\ - PIN_OSPEED_100M(GPIOA_USB_HS_BUSON) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_VBUS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TMS) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TCK) | \ - PIN_OSPEED_100M(GPIOA_JTAG_TDI)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON_WKUP) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_REF_CLK) |\ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDIO) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDINT) |\ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_PIN5) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_ETH_RMII_CRS_DV) |\ + PIN_OSPEED_HIGH(GPIOA_USB_HS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TMS) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TCK) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TDI)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON_WKUP) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_REF_CLK) |\ PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_MDIO) |\ @@ -402,22 +462,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_VBUS) |\ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DM) | \ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DP)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_USB_FS_BUSON) | \ - PIN_OSPEED_100M(GPIOB_USB_HS_FAULT) | \ - PIN_OSPEED_100M(GPIOB_BOOT1) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TDO) | \ - PIN_OSPEED_100M(GPIOB_JTAG_TRST) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ - PIN_OSPEED_100M(GPIOB_SPI2_SCK) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_ID) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_VBUS) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DM) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DP)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_USB_FS_BUSON) | \ + PIN_OSPEED_HIGH(GPIOB_USB_HS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOB_BOOT1) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TDO) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TRST) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \ + PIN_OSPEED_HIGH(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_ID) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_VBUS) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DM) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DP)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_USB_FS_BUSON) |\ PIN_PUPDR_FLOATING(GPIOB_USB_HS_FAULT) |\ PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \ @@ -519,22 +579,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_LED) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_MDC) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MISO) | \ - PIN_OSPEED_100M(GPIOC_SPI2_MOSI) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD0) | \ - PIN_OSPEED_100M(GPIOC_ETH_RMII_RXD1) | \ - PIN_OSPEED_100M(GPIOC_USART6_TX) | \ - PIN_OSPEED_100M(GPIOC_USART6_RX) | \ - PIN_OSPEED_100M(GPIOC_SD_D0) | \ - PIN_OSPEED_100M(GPIOC_SD_D1) | \ - PIN_OSPEED_100M(GPIOC_SD_D2) | \ - PIN_OSPEED_100M(GPIOC_SD_D3) | \ - PIN_OSPEED_100M(GPIOC_SD_CLK) | \ - PIN_OSPEED_100M(GPIOC_LED) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_MDC) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MISO) | \ + PIN_OSPEED_HIGH(GPIOC_SPI2_MOSI) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD0) | \ + PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD1) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_TX) | \ + PIN_OSPEED_HIGH(GPIOC_USART6_RX) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D0) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D1) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D2) | \ + PIN_OSPEED_HIGH(GPIOC_SD_D3) | \ + PIN_OSPEED_HIGH(GPIOC_SD_CLK) | \ + PIN_OSPEED_HIGH(GPIOC_LED) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_MDC) |\ PIN_PUPDR_FLOATING(GPIOC_SPI2_MISO) | \ @@ -636,22 +696,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_SD_CMD) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_SD_CMD) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_FLOATING(GPIOD_SD_CMD) | \ @@ -753,22 +813,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -870,22 +930,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_USB_FS_FAULT) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_USB_FS_FAULT) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -987,22 +1047,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD0) |\ PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD1) |\ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_SPI2_CS) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXEN) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD0) | \ - PIN_OSPEED_100M(GPIOG_ETH_RMII_TXD1) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_SPI2_CS) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXEN) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD0) | \ + PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1104,22 +1164,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1221,22 +1281,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F030R8/board.h b/os/hal/boards/ST_NUCLEO_F030R8/board.h index e31aa8e51..21b481886 100644 --- a/os/hal/boards/ST_NUCLEO_F030R8/board.h +++ b/os/hal/boards/ST_NUCLEO_F030R8/board.h @@ -137,6 +137,23 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -150,9 +167,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -210,22 +228,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_40M(GPIOA_PIN0) | \ - PIN_OSPEED_40M(GPIOA_PIN1) | \ - PIN_OSPEED_10M(GPIOA_USART_TX) | \ - PIN_OSPEED_10M(GPIOA_USART_RX) | \ - PIN_OSPEED_40M(GPIOA_PIN4) | \ - PIN_OSPEED_10M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_40M(GPIOA_PIN6) | \ - PIN_OSPEED_40M(GPIOA_PIN7) | \ - PIN_OSPEED_40M(GPIOA_PIN8) | \ - PIN_OSPEED_40M(GPIOA_PIN9) | \ - PIN_OSPEED_40M(GPIOA_PIN10) | \ - PIN_OSPEED_40M(GPIOA_PIN11) | \ - PIN_OSPEED_40M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDIO) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_LOW(GPIOA_USART_TX) | \ + PIN_OSPEED_LOW(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_LOW(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -327,22 +345,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_40M(GPIOB_PIN0) | \ - PIN_OSPEED_40M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_SWO) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_40M(GPIOB_PIN5) | \ - PIN_OSPEED_40M(GPIOB_PIN6) | \ - PIN_OSPEED_40M(GPIOB_PIN7) | \ - PIN_OSPEED_40M(GPIOB_PIN8) | \ - PIN_OSPEED_40M(GPIOB_PIN9) | \ - PIN_OSPEED_40M(GPIOB_PIN10) | \ - PIN_OSPEED_40M(GPIOB_PIN11) | \ - PIN_OSPEED_40M(GPIOB_PIN12) | \ - PIN_OSPEED_40M(GPIOB_PIN13) | \ - PIN_OSPEED_40M(GPIOB_PIN14) | \ - PIN_OSPEED_40M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -444,22 +462,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_40M(GPIOC_PIN0) | \ - PIN_OSPEED_40M(GPIOC_PIN1) | \ - PIN_OSPEED_40M(GPIOC_PIN2) | \ - PIN_OSPEED_40M(GPIOC_PIN3) | \ - PIN_OSPEED_40M(GPIOC_PIN4) | \ - PIN_OSPEED_40M(GPIOC_PIN5) | \ - PIN_OSPEED_40M(GPIOC_PIN6) | \ - PIN_OSPEED_40M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_PIN8) | \ - PIN_OSPEED_40M(GPIOC_PIN9) | \ - PIN_OSPEED_40M(GPIOC_PIN10) | \ - PIN_OSPEED_40M(GPIOC_PIN11) | \ - PIN_OSPEED_40M(GPIOC_PIN12) | \ - PIN_OSPEED_40M(GPIOC_BUTTON) | \ - PIN_OSPEED_40M(GPIOC_PIN14) | \ - PIN_OSPEED_40M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -561,22 +579,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_40M(GPIOD_PIN0) | \ - PIN_OSPEED_40M(GPIOD_PIN1) | \ - PIN_OSPEED_40M(GPIOD_PIN2) | \ - PIN_OSPEED_40M(GPIOD_PIN3) | \ - PIN_OSPEED_40M(GPIOD_PIN4) | \ - PIN_OSPEED_40M(GPIOD_PIN5) | \ - PIN_OSPEED_40M(GPIOD_PIN6) | \ - PIN_OSPEED_40M(GPIOD_PIN7) | \ - PIN_OSPEED_40M(GPIOD_PIN8) | \ - PIN_OSPEED_40M(GPIOD_PIN9) | \ - PIN_OSPEED_40M(GPIOD_PIN10) | \ - PIN_OSPEED_40M(GPIOD_PIN11) | \ - PIN_OSPEED_40M(GPIOD_PIN12) | \ - PIN_OSPEED_40M(GPIOD_PIN13) | \ - PIN_OSPEED_40M(GPIOD_PIN14) | \ - PIN_OSPEED_40M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -678,22 +696,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_2M(GPIOF_OSC_IN) | \ - PIN_OSPEED_2M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F072RB/board.h b/os/hal/boards/ST_NUCLEO_F072RB/board.h index a906d4db8..d7a450543 100644 --- a/os/hal/boards/ST_NUCLEO_F072RB/board.h +++ b/os/hal/boards/ST_NUCLEO_F072RB/board.h @@ -154,6 +154,22 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -167,9 +183,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -227,22 +244,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_40M(GPIOA_PIN0) | \ - PIN_OSPEED_40M(GPIOA_PIN1) | \ - PIN_OSPEED_10M(GPIOA_USART_TX) | \ - PIN_OSPEED_10M(GPIOA_USART_RX) | \ - PIN_OSPEED_40M(GPIOA_PIN4) | \ - PIN_OSPEED_10M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_40M(GPIOA_PIN6) | \ - PIN_OSPEED_40M(GPIOA_PIN7) | \ - PIN_OSPEED_40M(GPIOA_PIN8) | \ - PIN_OSPEED_40M(GPIOA_PIN9) | \ - PIN_OSPEED_40M(GPIOA_PIN10) | \ - PIN_OSPEED_40M(GPIOA_PIN11) | \ - PIN_OSPEED_40M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDIO) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_LOW(GPIOA_USART_TX) | \ + PIN_OSPEED_LOW(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_LOW(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -344,22 +361,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_40M(GPIOB_PIN0) | \ - PIN_OSPEED_40M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_SWO) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_40M(GPIOB_PIN5) | \ - PIN_OSPEED_40M(GPIOB_PIN6) | \ - PIN_OSPEED_40M(GPIOB_PIN7) | \ - PIN_OSPEED_40M(GPIOB_PIN8) | \ - PIN_OSPEED_40M(GPIOB_PIN9) | \ - PIN_OSPEED_40M(GPIOB_PIN10) | \ - PIN_OSPEED_40M(GPIOB_PIN11) | \ - PIN_OSPEED_40M(GPIOB_PIN12) | \ - PIN_OSPEED_40M(GPIOB_PIN13) | \ - PIN_OSPEED_40M(GPIOB_PIN14) | \ - PIN_OSPEED_40M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -461,22 +478,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_40M(GPIOC_PIN0) | \ - PIN_OSPEED_40M(GPIOC_PIN1) | \ - PIN_OSPEED_40M(GPIOC_PIN2) | \ - PIN_OSPEED_40M(GPIOC_PIN3) | \ - PIN_OSPEED_40M(GPIOC_PIN4) | \ - PIN_OSPEED_40M(GPIOC_PIN5) | \ - PIN_OSPEED_40M(GPIOC_PIN6) | \ - PIN_OSPEED_40M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_PIN8) | \ - PIN_OSPEED_40M(GPIOC_PIN9) | \ - PIN_OSPEED_40M(GPIOC_PIN10) | \ - PIN_OSPEED_40M(GPIOC_PIN11) | \ - PIN_OSPEED_40M(GPIOC_PIN12) | \ - PIN_OSPEED_40M(GPIOC_BUTTON) | \ - PIN_OSPEED_40M(GPIOC_PIN14) | \ - PIN_OSPEED_40M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -578,22 +595,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_40M(GPIOD_PIN0) | \ - PIN_OSPEED_40M(GPIOD_PIN1) | \ - PIN_OSPEED_40M(GPIOD_PIN2) | \ - PIN_OSPEED_40M(GPIOD_PIN3) | \ - PIN_OSPEED_40M(GPIOD_PIN4) | \ - PIN_OSPEED_40M(GPIOD_PIN5) | \ - PIN_OSPEED_40M(GPIOD_PIN6) | \ - PIN_OSPEED_40M(GPIOD_PIN7) | \ - PIN_OSPEED_40M(GPIOD_PIN8) | \ - PIN_OSPEED_40M(GPIOD_PIN9) | \ - PIN_OSPEED_40M(GPIOD_PIN10) | \ - PIN_OSPEED_40M(GPIOD_PIN11) | \ - PIN_OSPEED_40M(GPIOD_PIN12) | \ - PIN_OSPEED_40M(GPIOD_PIN13) | \ - PIN_OSPEED_40M(GPIOD_PIN14) | \ - PIN_OSPEED_40M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -695,22 +712,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_40M(GPIOE_PIN0) | \ - PIN_OSPEED_40M(GPIOE_PIN1) | \ - PIN_OSPEED_40M(GPIOE_PIN2) | \ - PIN_OSPEED_40M(GPIOE_PIN3) | \ - PIN_OSPEED_40M(GPIOE_PIN4) | \ - PIN_OSPEED_40M(GPIOE_PIN5) | \ - PIN_OSPEED_40M(GPIOE_PIN6) | \ - PIN_OSPEED_40M(GPIOE_PIN7) | \ - PIN_OSPEED_40M(GPIOE_PIN8) | \ - PIN_OSPEED_40M(GPIOE_PIN9) | \ - PIN_OSPEED_40M(GPIOE_PIN10) | \ - PIN_OSPEED_40M(GPIOE_PIN11) | \ - PIN_OSPEED_40M(GPIOE_PIN12) | \ - PIN_OSPEED_40M(GPIOE_PIN13) | \ - PIN_OSPEED_40M(GPIOE_PIN14) | \ - PIN_OSPEED_40M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -812,22 +829,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_40M(GPIOF_PIN0) | \ - PIN_OSPEED_40M(GPIOF_PIN1) | \ - PIN_OSPEED_40M(GPIOF_PIN2) | \ - PIN_OSPEED_40M(GPIOF_PIN3) | \ - PIN_OSPEED_40M(GPIOF_PIN4) | \ - PIN_OSPEED_40M(GPIOF_PIN5) | \ - PIN_OSPEED_40M(GPIOF_PIN6) | \ - PIN_OSPEED_40M(GPIOF_PIN7) | \ - PIN_OSPEED_40M(GPIOF_PIN8) | \ - PIN_OSPEED_40M(GPIOF_PIN9) | \ - PIN_OSPEED_40M(GPIOF_PIN10) | \ - PIN_OSPEED_40M(GPIOF_PIN11) | \ - PIN_OSPEED_40M(GPIOF_PIN12) | \ - PIN_OSPEED_40M(GPIOF_PIN13) | \ - PIN_OSPEED_40M(GPIOF_PIN14) | \ - PIN_OSPEED_40M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F091RC/board.h b/os/hal/boards/ST_NUCLEO_F091RC/board.h index 2a7660e9c..e63074f6b 100644 --- a/os/hal/boards/ST_NUCLEO_F091RC/board.h +++ b/os/hal/boards/ST_NUCLEO_F091RC/board.h @@ -154,6 +154,22 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -167,9 +183,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -227,22 +244,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_40M(GPIOA_PIN0) | \ - PIN_OSPEED_40M(GPIOA_PIN1) | \ - PIN_OSPEED_10M(GPIOA_USART_TX) | \ - PIN_OSPEED_10M(GPIOA_USART_RX) | \ - PIN_OSPEED_40M(GPIOA_PIN4) | \ - PIN_OSPEED_10M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_40M(GPIOA_PIN6) | \ - PIN_OSPEED_40M(GPIOA_PIN7) | \ - PIN_OSPEED_40M(GPIOA_PIN8) | \ - PIN_OSPEED_40M(GPIOA_PIN9) | \ - PIN_OSPEED_40M(GPIOA_PIN10) | \ - PIN_OSPEED_40M(GPIOA_PIN11) | \ - PIN_OSPEED_40M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDIO) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_LOW(GPIOA_USART_TX) | \ + PIN_OSPEED_LOW(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_LOW(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -344,22 +361,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_40M(GPIOB_PIN0) | \ - PIN_OSPEED_40M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_SWO) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_40M(GPIOB_PIN5) | \ - PIN_OSPEED_40M(GPIOB_PIN6) | \ - PIN_OSPEED_40M(GPIOB_PIN7) | \ - PIN_OSPEED_40M(GPIOB_PIN8) | \ - PIN_OSPEED_40M(GPIOB_PIN9) | \ - PIN_OSPEED_40M(GPIOB_PIN10) | \ - PIN_OSPEED_40M(GPIOB_PIN11) | \ - PIN_OSPEED_40M(GPIOB_PIN12) | \ - PIN_OSPEED_40M(GPIOB_PIN13) | \ - PIN_OSPEED_40M(GPIOB_PIN14) | \ - PIN_OSPEED_40M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -461,22 +478,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_40M(GPIOC_PIN0) | \ - PIN_OSPEED_40M(GPIOC_PIN1) | \ - PIN_OSPEED_40M(GPIOC_PIN2) | \ - PIN_OSPEED_40M(GPIOC_PIN3) | \ - PIN_OSPEED_40M(GPIOC_PIN4) | \ - PIN_OSPEED_40M(GPIOC_PIN5) | \ - PIN_OSPEED_40M(GPIOC_PIN6) | \ - PIN_OSPEED_40M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_PIN8) | \ - PIN_OSPEED_40M(GPIOC_PIN9) | \ - PIN_OSPEED_40M(GPIOC_PIN10) | \ - PIN_OSPEED_40M(GPIOC_PIN11) | \ - PIN_OSPEED_40M(GPIOC_PIN12) | \ - PIN_OSPEED_40M(GPIOC_BUTTON) | \ - PIN_OSPEED_40M(GPIOC_PIN14) | \ - PIN_OSPEED_40M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -578,22 +595,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_40M(GPIOD_PIN0) | \ - PIN_OSPEED_40M(GPIOD_PIN1) | \ - PIN_OSPEED_40M(GPIOD_PIN2) | \ - PIN_OSPEED_40M(GPIOD_PIN3) | \ - PIN_OSPEED_40M(GPIOD_PIN4) | \ - PIN_OSPEED_40M(GPIOD_PIN5) | \ - PIN_OSPEED_40M(GPIOD_PIN6) | \ - PIN_OSPEED_40M(GPIOD_PIN7) | \ - PIN_OSPEED_40M(GPIOD_PIN8) | \ - PIN_OSPEED_40M(GPIOD_PIN9) | \ - PIN_OSPEED_40M(GPIOD_PIN10) | \ - PIN_OSPEED_40M(GPIOD_PIN11) | \ - PIN_OSPEED_40M(GPIOD_PIN12) | \ - PIN_OSPEED_40M(GPIOD_PIN13) | \ - PIN_OSPEED_40M(GPIOD_PIN14) | \ - PIN_OSPEED_40M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -695,22 +712,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_40M(GPIOE_PIN0) | \ - PIN_OSPEED_40M(GPIOE_PIN1) | \ - PIN_OSPEED_40M(GPIOE_PIN2) | \ - PIN_OSPEED_40M(GPIOE_PIN3) | \ - PIN_OSPEED_40M(GPIOE_PIN4) | \ - PIN_OSPEED_40M(GPIOE_PIN5) | \ - PIN_OSPEED_40M(GPIOE_PIN6) | \ - PIN_OSPEED_40M(GPIOE_PIN7) | \ - PIN_OSPEED_40M(GPIOE_PIN8) | \ - PIN_OSPEED_40M(GPIOE_PIN9) | \ - PIN_OSPEED_40M(GPIOE_PIN10) | \ - PIN_OSPEED_40M(GPIOE_PIN11) | \ - PIN_OSPEED_40M(GPIOE_PIN12) | \ - PIN_OSPEED_40M(GPIOE_PIN13) | \ - PIN_OSPEED_40M(GPIOE_PIN14) | \ - PIN_OSPEED_40M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -812,22 +829,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_40M(GPIOF_PIN0) | \ - PIN_OSPEED_40M(GPIOF_PIN1) | \ - PIN_OSPEED_40M(GPIOF_PIN2) | \ - PIN_OSPEED_40M(GPIOF_PIN3) | \ - PIN_OSPEED_40M(GPIOF_PIN4) | \ - PIN_OSPEED_40M(GPIOF_PIN5) | \ - PIN_OSPEED_40M(GPIOF_PIN6) | \ - PIN_OSPEED_40M(GPIOF_PIN7) | \ - PIN_OSPEED_40M(GPIOF_PIN8) | \ - PIN_OSPEED_40M(GPIOF_PIN9) | \ - PIN_OSPEED_40M(GPIOF_PIN10) | \ - PIN_OSPEED_40M(GPIOF_PIN11) | \ - PIN_OSPEED_40M(GPIOF_PIN12) | \ - PIN_OSPEED_40M(GPIOF_PIN13) | \ - PIN_OSPEED_40M(GPIOF_PIN14) | \ - PIN_OSPEED_40M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F302R8/board.h b/os/hal/boards/ST_NUCLEO_F302R8/board.h index 308320656..8b4575cc2 100644 --- a/os/hal/boards/ST_NUCLEO_F302R8/board.h +++ b/os/hal/boards/ST_NUCLEO_F302R8/board.h @@ -152,6 +152,22 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOB, 13U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -165,10 +181,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -226,22 +242,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_50M(GPIOA_USART_TX) | \ - PIN_OSPEED_50M(GPIOA_USART_RX) | \ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_50M(GPIOA_PIN5) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_PIN7) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_PIN9) | \ - PIN_OSPEED_100M(GPIOA_PIN10) | \ - PIN_OSPEED_100M(GPIOA_PIN11) | \ - PIN_OSPEED_100M(GPIOA_PIN12) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_LOW(GPIOA_USART_TX) | \ + PIN_OSPEED_LOW(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_LOW(GPIOA_PIN5) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -343,22 +359,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_LED_GREEN) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_PIN9) | \ - PIN_OSPEED_100M(GPIOB_PIN10) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_LED_GREEN) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -460,22 +476,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_PIN7) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_PIN10) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_PIN12) | \ - PIN_OSPEED_100M(GPIOC_BUTTON) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -577,22 +593,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -694,22 +710,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -811,22 +827,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F334R8/board.h b/os/hal/boards/ST_NUCLEO_F334R8/board.h index bd5a5f2de..1b2ad624f 100644 --- a/os/hal/boards/ST_NUCLEO_F334R8/board.h +++ b/os/hal/boards/ST_NUCLEO_F334R8/board.h @@ -152,6 +152,22 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -165,10 +181,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -226,22 +242,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_50M(GPIOA_USART_TX) | \ - PIN_OSPEED_50M(GPIOA_USART_RX) | \ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_50M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_PIN7) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_PIN9) | \ - PIN_OSPEED_100M(GPIOA_PIN10) | \ - PIN_OSPEED_100M(GPIOA_PIN11) | \ - PIN_OSPEED_100M(GPIOA_PIN12) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_LOW(GPIOA_USART_TX) | \ + PIN_OSPEED_LOW(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_LOW(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -343,22 +359,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_PIN9) | \ - PIN_OSPEED_100M(GPIOB_PIN10) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -460,22 +476,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_PIN7) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_PIN10) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_PIN12) | \ - PIN_OSPEED_100M(GPIOC_BUTTON) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -577,22 +593,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -694,22 +710,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -811,22 +827,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F401RE/board.h b/os/hal/boards/ST_NUCLEO_F401RE/board.h index 413eb4461..23d67a479 100644 --- a/os/hal/boards/ST_NUCLEO_F401RE/board.h +++ b/os/hal/boards/ST_NUCLEO_F401RE/board.h @@ -207,6 +207,29 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -220,10 +243,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -281,22 +304,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_50M(GPIOA_USART_TX) | \ - PIN_OSPEED_50M(GPIOA_USART_RX) | \ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_50M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_PIN7) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_PIN9) | \ - PIN_OSPEED_100M(GPIOA_PIN10) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_TX) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_MEDIUM(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -398,22 +421,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_PIN9) | \ - PIN_OSPEED_100M(GPIOB_PIN10) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -515,22 +538,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_PIN7) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_PIN10) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_PIN12) | \ - PIN_OSPEED_100M(GPIOC_BUTTON) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -632,22 +655,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -749,22 +772,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -866,22 +889,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -983,22 +1006,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_PIN11) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_PIN13) | \ - PIN_OSPEED_100M(GPIOG_PIN14) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_PIN10) | \ + PIN_OSPEED_HIGH(GPIOG_PIN11) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_PIN13) | \ + PIN_OSPEED_HIGH(GPIOG_PIN14) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1100,22 +1123,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1217,22 +1240,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_F411RE/board.h b/os/hal/boards/ST_NUCLEO_F411RE/board.h index c1f15fb6e..1f2df53c9 100644 --- a/os/hal/boards/ST_NUCLEO_F411RE/board.h +++ b/os/hal/boards/ST_NUCLEO_F411RE/board.h @@ -207,6 +207,29 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -220,10 +243,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -281,22 +304,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_50M(GPIOA_USART_TX) | \ - PIN_OSPEED_50M(GPIOA_USART_RX) | \ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_50M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_PIN7) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_PIN9) | \ - PIN_OSPEED_100M(GPIOA_PIN10) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_TX) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_MEDIUM(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -398,22 +421,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_PIN9) | \ - PIN_OSPEED_100M(GPIOB_PIN10) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -515,22 +538,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_PIN0) | \ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_PIN7) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_PIN10) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_PIN12) | \ - PIN_OSPEED_100M(GPIOC_BUTTON) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -632,22 +655,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_PIN4) | \ - PIN_OSPEED_100M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_PIN12) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_PIN14) | \ - PIN_OSPEED_100M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -749,22 +772,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_PIN3) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -866,22 +889,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -983,22 +1006,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_PIN11) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_PIN13) | \ - PIN_OSPEED_100M(GPIOG_PIN14) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_PIN10) | \ + PIN_OSPEED_HIGH(GPIOG_PIN11) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_PIN13) | \ + PIN_OSPEED_HIGH(GPIOG_PIN14) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1100,22 +1123,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1217,22 +1240,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_L053R8/board.h b/os/hal/boards/ST_NUCLEO_L053R8/board.h index 2312591c5..863160d17 100644 --- a/os/hal/boards/ST_NUCLEO_L053R8/board.h +++ b/os/hal/boards/ST_NUCLEO_L053R8/board.h @@ -137,6 +137,23 @@ #define GPIOH_PIN14 14U #define GPIOH_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -150,10 +167,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) diff --git a/os/hal/boards/ST_NUCLEO_L152RE/board.h b/os/hal/boards/ST_NUCLEO_L152RE/board.h index d9e9d27af..e0c881a38 100644 --- a/os/hal/boards/ST_NUCLEO_L152RE/board.h +++ b/os/hal/boards/ST_NUCLEO_L152RE/board.h @@ -185,6 +185,26 @@ #define GPIOH_PIN14 14U #define GPIOH_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -198,10 +218,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_400K(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_2M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -259,22 +279,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_40M(GPIOA_PIN0) | \ - PIN_OSPEED_40M(GPIOA_PIN1) | \ - PIN_OSPEED_10M(GPIOA_USART_TX) | \ - PIN_OSPEED_10M(GPIOA_USART_RX) | \ - PIN_OSPEED_40M(GPIOA_PIN4) | \ - PIN_OSPEED_10M(GPIOA_LED_GREEN) | \ - PIN_OSPEED_40M(GPIOA_PIN6) | \ - PIN_OSPEED_40M(GPIOA_PIN7) | \ - PIN_OSPEED_40M(GPIOA_PIN8) | \ - PIN_OSPEED_40M(GPIOA_PIN9) | \ - PIN_OSPEED_40M(GPIOA_PIN10) | \ - PIN_OSPEED_40M(GPIOA_PIN11) | \ - PIN_OSPEED_40M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDIO) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_TX) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_MEDIUM(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -376,22 +396,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_40M(GPIOB_PIN0) | \ - PIN_OSPEED_40M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_SWO) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_40M(GPIOB_PIN5) | \ - PIN_OSPEED_40M(GPIOB_PIN6) | \ - PIN_OSPEED_40M(GPIOB_PIN7) | \ - PIN_OSPEED_40M(GPIOB_PIN8) | \ - PIN_OSPEED_40M(GPIOB_PIN9) | \ - PIN_OSPEED_40M(GPIOB_PIN10) | \ - PIN_OSPEED_40M(GPIOB_PIN11) | \ - PIN_OSPEED_40M(GPIOB_PIN12) | \ - PIN_OSPEED_40M(GPIOB_PIN13) | \ - PIN_OSPEED_40M(GPIOB_PIN14) | \ - PIN_OSPEED_40M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -493,22 +513,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_40M(GPIOC_PIN0) | \ - PIN_OSPEED_40M(GPIOC_PIN1) | \ - PIN_OSPEED_40M(GPIOC_PIN2) | \ - PIN_OSPEED_40M(GPIOC_PIN3) | \ - PIN_OSPEED_40M(GPIOC_PIN4) | \ - PIN_OSPEED_40M(GPIOC_PIN5) | \ - PIN_OSPEED_40M(GPIOC_PIN6) | \ - PIN_OSPEED_40M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_PIN8) | \ - PIN_OSPEED_40M(GPIOC_PIN9) | \ - PIN_OSPEED_40M(GPIOC_PIN10) | \ - PIN_OSPEED_40M(GPIOC_PIN11) | \ - PIN_OSPEED_40M(GPIOC_PIN12) | \ - PIN_OSPEED_40M(GPIOC_BUTTON) | \ - PIN_OSPEED_40M(GPIOC_PIN14) | \ - PIN_OSPEED_40M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -610,22 +630,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_400K(GPIOD_PIN0) | \ - PIN_OSPEED_400K(GPIOD_PIN1) | \ - PIN_OSPEED_400K(GPIOD_PIN2) | \ - PIN_OSPEED_400K(GPIOD_PIN3) | \ - PIN_OSPEED_400K(GPIOD_PIN4) | \ - PIN_OSPEED_400K(GPIOD_PIN5) | \ - PIN_OSPEED_400K(GPIOD_PIN6) | \ - PIN_OSPEED_400K(GPIOD_PIN7) | \ - PIN_OSPEED_400K(GPIOD_PIN8) | \ - PIN_OSPEED_400K(GPIOD_PIN9) | \ - PIN_OSPEED_400K(GPIOD_PIN10) | \ - PIN_OSPEED_400K(GPIOD_PIN11) | \ - PIN_OSPEED_400K(GPIOD_PIN12) | \ - PIN_OSPEED_400K(GPIOD_PIN13) | \ - PIN_OSPEED_400K(GPIOD_PIN14) | \ - PIN_OSPEED_400K(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -727,22 +747,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_400K(GPIOE_PIN0) | \ - PIN_OSPEED_400K(GPIOE_PIN1) | \ - PIN_OSPEED_400K(GPIOE_PIN2) | \ - PIN_OSPEED_400K(GPIOE_PIN3) | \ - PIN_OSPEED_400K(GPIOE_PIN4) | \ - PIN_OSPEED_400K(GPIOE_PIN5) | \ - PIN_OSPEED_400K(GPIOE_PIN6) | \ - PIN_OSPEED_400K(GPIOE_PIN7) | \ - PIN_OSPEED_400K(GPIOE_PIN8) | \ - PIN_OSPEED_400K(GPIOE_PIN9) | \ - PIN_OSPEED_400K(GPIOE_PIN10) | \ - PIN_OSPEED_400K(GPIOE_PIN11) | \ - PIN_OSPEED_400K(GPIOE_PIN12) | \ - PIN_OSPEED_400K(GPIOE_PIN13) | \ - PIN_OSPEED_400K(GPIOE_PIN14) | \ - PIN_OSPEED_400K(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -844,22 +864,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_400K(GPIOF_PIN0) | \ - PIN_OSPEED_400K(GPIOF_PIN1) | \ - PIN_OSPEED_400K(GPIOF_PIN2) | \ - PIN_OSPEED_400K(GPIOF_PIN3) | \ - PIN_OSPEED_400K(GPIOF_PIN4) | \ - PIN_OSPEED_400K(GPIOF_PIN5) | \ - PIN_OSPEED_400K(GPIOF_PIN6) | \ - PIN_OSPEED_400K(GPIOF_PIN7) | \ - PIN_OSPEED_400K(GPIOF_PIN8) | \ - PIN_OSPEED_400K(GPIOF_PIN9) | \ - PIN_OSPEED_400K(GPIOF_PIN10) | \ - PIN_OSPEED_400K(GPIOF_PIN11) | \ - PIN_OSPEED_400K(GPIOF_PIN12) | \ - PIN_OSPEED_400K(GPIOF_PIN13) | \ - PIN_OSPEED_400K(GPIOF_PIN14) | \ - PIN_OSPEED_400K(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -961,22 +981,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_400K(GPIOG_PIN0) | \ - PIN_OSPEED_400K(GPIOG_PIN1) | \ - PIN_OSPEED_400K(GPIOG_PIN2) | \ - PIN_OSPEED_400K(GPIOG_PIN3) | \ - PIN_OSPEED_400K(GPIOG_PIN4) | \ - PIN_OSPEED_400K(GPIOG_PIN5) | \ - PIN_OSPEED_400K(GPIOG_PIN6) | \ - PIN_OSPEED_400K(GPIOG_PIN7) | \ - PIN_OSPEED_400K(GPIOG_PIN8) | \ - PIN_OSPEED_400K(GPIOG_PIN9) | \ - PIN_OSPEED_400K(GPIOG_PIN10) | \ - PIN_OSPEED_400K(GPIOG_PIN11) | \ - PIN_OSPEED_400K(GPIOG_PIN12) | \ - PIN_OSPEED_400K(GPIOG_PIN13) | \ - PIN_OSPEED_400K(GPIOG_PIN14) | \ - PIN_OSPEED_400K(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1078,22 +1098,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_40M(GPIOH_OSC_IN) | \ - PIN_OSPEED_40M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_400K(GPIOH_PIN2) | \ - PIN_OSPEED_400K(GPIOH_PIN3) | \ - PIN_OSPEED_400K(GPIOH_PIN4) | \ - PIN_OSPEED_400K(GPIOH_PIN5) | \ - PIN_OSPEED_400K(GPIOH_PIN6) | \ - PIN_OSPEED_400K(GPIOH_PIN7) | \ - PIN_OSPEED_400K(GPIOH_PIN8) | \ - PIN_OSPEED_400K(GPIOH_PIN9) | \ - PIN_OSPEED_400K(GPIOH_PIN10) | \ - PIN_OSPEED_400K(GPIOH_PIN11) | \ - PIN_OSPEED_400K(GPIOH_PIN12) | \ - PIN_OSPEED_400K(GPIOH_PIN13) | \ - PIN_OSPEED_400K(GPIOH_PIN14) | \ - PIN_OSPEED_400K(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ diff --git a/os/hal/boards/ST_NUCLEO_L476RG/board.h b/os/hal/boards/ST_NUCLEO_L476RG/board.h index f22f44c83..934707904 100644 --- a/os/hal/boards/ST_NUCLEO_L476RG/board.h +++ b/os/hal/boards/ST_NUCLEO_L476RG/board.h @@ -190,6 +190,26 @@ #define GPIOH_PIN14 14U #define GPIOH_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_USART_TX PAL_LINE(GPIOA, 2U) +#define LINE_USART_RX PAL_LINE(GPIOA, 3U) +#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) + +#define LINE_BUTTON PAL_LINE(GPIOC, 13U) + + + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -203,10 +223,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_LS(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_MS(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_FS(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_HS(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -264,22 +284,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HS(GPIOA_PIN0) | \ - PIN_OSPEED_HS(GPIOA_PIN1) | \ - PIN_OSPEED_FS(GPIOA_USART_TX) | \ - PIN_OSPEED_FS(GPIOA_USART_RX) | \ - PIN_OSPEED_HS(GPIOA_PIN4) | \ - PIN_OSPEED_HS(GPIOA_LED_GREEN) | \ - PIN_OSPEED_HS(GPIOA_PIN6) | \ - PIN_OSPEED_HS(GPIOA_PIN7) | \ - PIN_OSPEED_HS(GPIOA_PIN8) | \ - PIN_OSPEED_HS(GPIOA_PIN9) | \ - PIN_OSPEED_HS(GPIOA_PIN10) | \ - PIN_OSPEED_HS(GPIOA_PIN11) | \ - PIN_OSPEED_HS(GPIOA_PIN12) | \ - PIN_OSPEED_HS(GPIOA_SWDIO) | \ - PIN_OSPEED_HS(GPIOA_SWCLK) | \ - PIN_OSPEED_HS(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_TX) | \ + PIN_OSPEED_MEDIUM(GPIOA_USART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_LED_GREEN) | \ + PIN_OSPEED_HIGH(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_PIN7) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_PIN9) | \ + PIN_OSPEED_HIGH(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_HIGH(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_FLOATING(GPIOA_USART_TX) | \ @@ -381,22 +401,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HS(GPIOB_PIN0) | \ - PIN_OSPEED_HS(GPIOB_PIN1) | \ - PIN_OSPEED_HS(GPIOB_PIN2) | \ - PIN_OSPEED_HS(GPIOB_SWO) | \ - PIN_OSPEED_HS(GPIOB_PIN4) | \ - PIN_OSPEED_HS(GPIOB_PIN5) | \ - PIN_OSPEED_HS(GPIOB_PIN6) | \ - PIN_OSPEED_HS(GPIOB_PIN7) | \ - PIN_OSPEED_HS(GPIOB_PIN8) | \ - PIN_OSPEED_HS(GPIOB_PIN9) | \ - PIN_OSPEED_HS(GPIOB_PIN10) | \ - PIN_OSPEED_HS(GPIOB_PIN11) | \ - PIN_OSPEED_HS(GPIOB_PIN12) | \ - PIN_OSPEED_HS(GPIOB_PIN13) | \ - PIN_OSPEED_HS(GPIOB_PIN14) | \ - PIN_OSPEED_HS(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -498,22 +518,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HS(GPIOC_PIN0) | \ - PIN_OSPEED_HS(GPIOC_PIN1) | \ - PIN_OSPEED_HS(GPIOC_PIN2) | \ - PIN_OSPEED_HS(GPIOC_PIN3) | \ - PIN_OSPEED_HS(GPIOC_PIN4) | \ - PIN_OSPEED_HS(GPIOC_PIN5) | \ - PIN_OSPEED_HS(GPIOC_PIN6) | \ - PIN_OSPEED_HS(GPIOC_PIN7) | \ - PIN_OSPEED_HS(GPIOC_PIN8) | \ - PIN_OSPEED_HS(GPIOC_PIN9) | \ - PIN_OSPEED_HS(GPIOC_PIN10) | \ - PIN_OSPEED_HS(GPIOC_PIN11) | \ - PIN_OSPEED_HS(GPIOC_PIN12) | \ - PIN_OSPEED_HS(GPIOC_BUTTON) | \ - PIN_OSPEED_HS(GPIOC_PIN14) | \ - PIN_OSPEED_HS(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -615,22 +635,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HS(GPIOD_PIN0) | \ - PIN_OSPEED_HS(GPIOD_PIN1) | \ - PIN_OSPEED_HS(GPIOD_PIN2) | \ - PIN_OSPEED_HS(GPIOD_PIN3) | \ - PIN_OSPEED_HS(GPIOD_PIN4) | \ - PIN_OSPEED_HS(GPIOD_PIN5) | \ - PIN_OSPEED_HS(GPIOD_PIN6) | \ - PIN_OSPEED_HS(GPIOD_PIN7) | \ - PIN_OSPEED_HS(GPIOD_PIN8) | \ - PIN_OSPEED_HS(GPIOD_PIN9) | \ - PIN_OSPEED_HS(GPIOD_PIN10) | \ - PIN_OSPEED_HS(GPIOD_PIN11) | \ - PIN_OSPEED_HS(GPIOD_PIN12) | \ - PIN_OSPEED_HS(GPIOD_PIN13) | \ - PIN_OSPEED_HS(GPIOD_PIN14) | \ - PIN_OSPEED_HS(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -732,22 +752,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HS(GPIOE_PIN0) | \ - PIN_OSPEED_HS(GPIOE_PIN1) | \ - PIN_OSPEED_HS(GPIOE_PIN2) | \ - PIN_OSPEED_HS(GPIOE_PIN3) | \ - PIN_OSPEED_HS(GPIOE_PIN4) | \ - PIN_OSPEED_HS(GPIOE_PIN5) | \ - PIN_OSPEED_HS(GPIOE_PIN6) | \ - PIN_OSPEED_HS(GPIOE_PIN7) | \ - PIN_OSPEED_HS(GPIOE_PIN8) | \ - PIN_OSPEED_HS(GPIOE_PIN9) | \ - PIN_OSPEED_HS(GPIOE_PIN10) | \ - PIN_OSPEED_HS(GPIOE_PIN11) | \ - PIN_OSPEED_HS(GPIOE_PIN12) | \ - PIN_OSPEED_HS(GPIOE_PIN13) | \ - PIN_OSPEED_HS(GPIOE_PIN14) | \ - PIN_OSPEED_HS(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -849,22 +869,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HS(GPIOF_PIN0) | \ - PIN_OSPEED_HS(GPIOF_PIN1) | \ - PIN_OSPEED_HS(GPIOF_PIN2) | \ - PIN_OSPEED_HS(GPIOF_PIN3) | \ - PIN_OSPEED_HS(GPIOF_PIN4) | \ - PIN_OSPEED_HS(GPIOF_PIN5) | \ - PIN_OSPEED_HS(GPIOF_PIN6) | \ - PIN_OSPEED_HS(GPIOF_PIN7) | \ - PIN_OSPEED_HS(GPIOF_PIN8) | \ - PIN_OSPEED_HS(GPIOF_PIN9) | \ - PIN_OSPEED_HS(GPIOF_PIN10) | \ - PIN_OSPEED_HS(GPIOF_PIN11) | \ - PIN_OSPEED_HS(GPIOF_PIN12) | \ - PIN_OSPEED_HS(GPIOF_PIN13) | \ - PIN_OSPEED_HS(GPIOF_PIN14) | \ - PIN_OSPEED_HS(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ @@ -966,22 +986,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_LS(GPIOG_PIN0) | \ - PIN_OSPEED_LS(GPIOG_PIN1) | \ - PIN_OSPEED_LS(GPIOG_PIN2) | \ - PIN_OSPEED_LS(GPIOG_PIN3) | \ - PIN_OSPEED_LS(GPIOG_PIN4) | \ - PIN_OSPEED_LS(GPIOG_PIN5) | \ - PIN_OSPEED_LS(GPIOG_PIN6) | \ - PIN_OSPEED_LS(GPIOG_PIN7) | \ - PIN_OSPEED_LS(GPIOG_PIN8) | \ - PIN_OSPEED_LS(GPIOG_PIN9) | \ - PIN_OSPEED_LS(GPIOG_PIN10) | \ - PIN_OSPEED_LS(GPIOG_PIN11) | \ - PIN_OSPEED_LS(GPIOG_PIN12) | \ - PIN_OSPEED_LS(GPIOG_PIN13) | \ - PIN_OSPEED_LS(GPIOG_PIN14) | \ - PIN_OSPEED_LS(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1083,22 +1103,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HS(GPIOH_OSC_IN) | \ - PIN_OSPEED_HS(GPIOH_OSC_OUT) | \ - PIN_OSPEED_LS(GPIOH_PIN2) | \ - PIN_OSPEED_LS(GPIOH_PIN3) | \ - PIN_OSPEED_LS(GPIOH_PIN4) | \ - PIN_OSPEED_LS(GPIOH_PIN5) | \ - PIN_OSPEED_LS(GPIOH_PIN6) | \ - PIN_OSPEED_LS(GPIOH_PIN7) | \ - PIN_OSPEED_LS(GPIOH_PIN8) | \ - PIN_OSPEED_LS(GPIOH_PIN9) | \ - PIN_OSPEED_LS(GPIOH_PIN10) | \ - PIN_OSPEED_LS(GPIOH_PIN11) | \ - PIN_OSPEED_LS(GPIOH_PIN12) | \ - PIN_OSPEED_LS(GPIOH_PIN13) | \ - PIN_OSPEED_LS(GPIOH_PIN14) | \ - PIN_OSPEED_LS(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ diff --git a/os/hal/boards/ST_STM32373C_EVAL/board.h b/os/hal/boards/ST_STM32373C_EVAL/board.h index f248da22e..2ad70ec84 100644 --- a/os/hal/boards/ST_STM32373C_EVAL/board.h +++ b/os/hal/boards/ST_STM32373C_EVAL/board.h @@ -150,6 +150,64 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_WKUP_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_LDR_OUT PAL_LINE(GPIOA, 1U) +#define LINE_KEY_BUTTON PAL_LINE(GPIOA, 2U) +#define LINE_COMP2_OUT PAL_LINE(GPIOA, 7U) +#define LINE_I2C2_SMB PAL_LINE(GPIOA, 8U) +#define LINE_I2C2_SCL PAL_LINE(GPIOA, 9U) +#define LINE_I2C2_SDA PAL_LINE(GPIOA, 10U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) +#define LINE_JTDI PAL_LINE(GPIOA, 15U) + +#define LINE_MIC_IN PAL_LINE(GPIOB, 0U) +#define LINE_ADC_POT_IN PAL_LINE(GPIOB, 1U) +#define LINE_SWO PAL_LINE(GPIOB, 3U) +#define LINE_JTRST PAL_LINE(GPIOB, 4U) +#define LINE_I2C1_SCL PAL_LINE(GPIOB, 6U) +#define LINE_I2C1_SDA PAL_LINE(GPIOB, 7U) + +#define LINE_LED1 PAL_LINE(GPIOC, 0U) +#define LINE_LED2 PAL_LINE(GPIOC, 1U) +#define LINE_LED3 PAL_LINE(GPIOC, 2U) +#define LINE_LED4 PAL_LINE(GPIOC, 3U) +#define LINE_USB_DISCONNECT PAL_LINE(GPIOC, 5U) +#define LINE_SPI3_SCK PAL_LINE(GPIOC, 10U) +#define LINE_SPI3_MISO PAL_LINE(GPIOC, 11U) +#define LINE_SPI3_MOSI PAL_LINE(GPIOC, 12U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + +#define LINE_CAN_RX PAL_LINE(GPIOD, 0U) +#define LINE_CAN_TX PAL_LINE(GPIOD, 1U) +#define LINE_LCD_CS PAL_LINE(GPIOD, 2U) +#define LINE_USART2_CTS PAL_LINE(GPIOD, 3U) +#define LINE_USART2_RST PAL_LINE(GPIOD, 4U) +#define LINE_USART2_TX PAL_LINE(GPIOD, 5U) +#define LINE_USART2_RX PAL_LINE(GPIOD, 6U) +#define LINE_AUDIO_RST PAL_LINE(GPIOD, 11U) + +#define LINE_SD_CS PAL_LINE(GPIOE, 2U) +#define LINE_SD_DETECT PAL_LINE(GPIOE, 3U) +#define LINE_JOY_SEL PAL_LINE(GPIOE, 6U) +#define LINE_RTD_IN PAL_LINE(GPIOE, 7U) +#define LINE_PRESSUREP PAL_LINE(GPIOE, 8U) +#define LINE_PRESSUREN PAL_LINE(GPIOE, 9U) +#define LINE_PRESSURE_TEPM PAL_LINE(GPIOE, 14U) + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) +#define LINE_JOY_DOWN PAL_LINE(GPIOF, 2U) +#define LINE_JOY_LEFT PAL_LINE(GPIOF, 4U) +#define LINE_JOY_RIGHT PAL_LINE(GPIOF, 9U) +#define LINE_JOY_UP PAL_LINE(GPIOF, 10U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -163,10 +221,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -224,22 +282,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_WKUP_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_LDR_OUT) | \ - PIN_OSPEED_2M(GPIOA_KEY_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_PIN5) | \ - PIN_OSPEED_2M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_COMP2_OUT) | \ - PIN_OSPEED_2M(GPIOA_I2C2_SMB) | \ - PIN_OSPEED_100M(GPIOA_I2C2_SCL) | \ - PIN_OSPEED_100M(GPIOA_I2C2_SDA) | \ - PIN_OSPEED_100M(GPIOA_USB_DM) | \ - PIN_OSPEED_2M(GPIOA_USB_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_JTDI)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_WKUP_BUTTON) |\ + PIN_OSPEED_VERYLOW(GPIOA_LDR_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOA_KEY_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_HIGH(GPIOA_COMP2_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOA_I2C2_SMB) | \ + PIN_OSPEED_HIGH(GPIOA_I2C2_SCL) | \ + PIN_OSPEED_HIGH(GPIOA_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_JTDI)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_WKUP_BUTTON) |\ PIN_PUPDR_FLOATING(GPIOA_LDR_OUT) | \ PIN_PUPDR_FLOATING(GPIOA_KEY_BUTTON) | \ @@ -341,22 +399,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_MIC_IN) | \ - PIN_OSPEED_2M(GPIOB_ADC_POT_IN) | \ - PIN_OSPEED_2M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_JTRST) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_PIN13) | \ - PIN_OSPEED_2M(GPIOB_PIN14) | \ - PIN_OSPEED_2M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_MIC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOB_ADC_POT_IN) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_JTRST) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_MIC_IN) | \ PIN_PUPDR_FLOATING(GPIOB_ADC_POT_IN) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -458,22 +516,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_LED1) | \ - PIN_OSPEED_100M(GPIOC_LED2) | \ - PIN_OSPEED_100M(GPIOC_LED3) | \ - PIN_OSPEED_100M(GPIOC_LED4) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_USB_DISCONNECT) |\ - PIN_OSPEED_2M(GPIOC_PIN6) | \ - PIN_OSPEED_2M(GPIOC_PIN7) | \ - PIN_OSPEED_2M(GPIOC_PIN8) | \ - PIN_OSPEED_2M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_SPI3_SCK) | \ - PIN_OSPEED_100M(GPIOC_SPI3_MISO) | \ - PIN_OSPEED_100M(GPIOC_SPI3_MOSI) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_LED1) | \ + PIN_OSPEED_HIGH(GPIOC_LED2) | \ + PIN_OSPEED_HIGH(GPIOC_LED3) | \ + PIN_OSPEED_HIGH(GPIOC_LED4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_USB_DISCONNECT) |\ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_SPI3_SCK) | \ + PIN_OSPEED_HIGH(GPIOC_SPI3_MISO) | \ + PIN_OSPEED_HIGH(GPIOC_SPI3_MOSI) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_LED1) | \ PIN_PUPDR_FLOATING(GPIOC_LED2) | \ PIN_PUPDR_FLOATING(GPIOC_LED3) | \ @@ -575,22 +633,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_CAN_RX) | \ - PIN_OSPEED_100M(GPIOD_CAN_TX) | \ - PIN_OSPEED_100M(GPIOD_LCD_CS) | \ - PIN_OSPEED_100M(GPIOD_USART2_CTS) | \ - PIN_OSPEED_100M(GPIOD_USART2_RST) | \ - PIN_OSPEED_100M(GPIOD_USART2_TX) | \ - PIN_OSPEED_100M(GPIOD_USART2_RX) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_AUDIO_RST) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_CAN_RX) | \ + PIN_OSPEED_HIGH(GPIOD_CAN_TX) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_CS) | \ + PIN_OSPEED_HIGH(GPIOD_USART2_CTS) | \ + PIN_OSPEED_HIGH(GPIOD_USART2_RST) | \ + PIN_OSPEED_HIGH(GPIOD_USART2_TX) | \ + PIN_OSPEED_HIGH(GPIOD_USART2_RX) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_AUDIO_RST) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_CAN_RX) | \ PIN_PUPDR_FLOATING(GPIOD_CAN_TX) | \ PIN_PUPDR_FLOATING(GPIOD_LCD_CS) | \ @@ -692,22 +750,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PRESSURE_TEPM) |\ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_2M(GPIOE_PIN0) | \ - PIN_OSPEED_2M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_SD_CS) | \ - PIN_OSPEED_100M(GPIOE_SD_DETECT) | \ - PIN_OSPEED_2M(GPIOE_PIN4) | \ - PIN_OSPEED_2M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_JOY_SEL) | \ - PIN_OSPEED_2M(GPIOE_RTD_IN) | \ - PIN_OSPEED_100M(GPIOE_PRESSUREP) | \ - PIN_OSPEED_100M(GPIOE_PRESSUREN) | \ - PIN_OSPEED_2M(GPIOE_PIN10) | \ - PIN_OSPEED_2M(GPIOE_PIN11) | \ - PIN_OSPEED_2M(GPIOE_PIN12) | \ - PIN_OSPEED_2M(GPIOE_PIN13) | \ - PIN_OSPEED_2M(GPIOE_PRESSURE_TEPM) | \ - PIN_OSPEED_2M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_SD_CS) | \ + PIN_OSPEED_HIGH(GPIOE_SD_DETECT) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_JOY_SEL) | \ + PIN_OSPEED_VERYLOW(GPIOE_RTD_IN) | \ + PIN_OSPEED_HIGH(GPIOE_PRESSUREP) | \ + PIN_OSPEED_HIGH(GPIOE_PRESSUREN) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PRESSURE_TEPM) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_FLOATING(GPIOE_SD_CS) | \ @@ -809,22 +867,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_OSC_IN) | \ - PIN_OSPEED_100M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOF_JOY_DOWN) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_JOY_LEFT) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_JOY_RIGHT) | \ - PIN_OSPEED_100M(GPIOF_JOY_UP) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOF_JOY_DOWN) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_JOY_LEFT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_JOY_RIGHT) | \ + PIN_OSPEED_HIGH(GPIOF_JOY_UP) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ PIN_PUPDR_PULLDOWN(GPIOF_JOY_DOWN) | \ diff --git a/os/hal/boards/ST_STM32F072B_DISCOVERY/board.h b/os/hal/boards/ST_STM32F072B_DISCOVERY/board.h index aa132cda2..9e5c58c20 100644 --- a/os/hal/boards/ST_STM32F072B_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F072B_DISCOVERY/board.h @@ -154,6 +154,32 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -167,13 +193,14 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8U) * 4U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) /* * GPIOA setup: @@ -227,22 +254,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN1) | \ - PIN_OSPEED_2M(GPIOA_PIN2) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_2M(GPIOA_PIN5) | \ - PIN_OSPEED_2M(GPIOA_PIN6) | \ - PIN_OSPEED_2M(GPIOA_PIN7) | \ - PIN_OSPEED_2M(GPIOA_PIN8) | \ - PIN_OSPEED_2M(GPIOA_PIN9) | \ - PIN_OSPEED_2M(GPIOA_PIN10) | \ - PIN_OSPEED_2M(GPIOA_USB_DM) | \ - PIN_OSPEED_2M(GPIOA_USB_DP) | \ - PIN_OSPEED_40M(GPIOA_SWDIO) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ @@ -344,22 +371,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_PIN0) | \ - PIN_OSPEED_2M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_PIN3) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_2M(GPIOB_PIN6) | \ - PIN_OSPEED_2M(GPIOB_PIN7) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_SPI2_SCK) | \ - PIN_OSPEED_2M(GPIOB_SPI2_MISO) | \ - PIN_OSPEED_2M(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -461,22 +488,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_40M(GPIOC_MEMS_CS) | \ - PIN_OSPEED_2M(GPIOC_PIN1) | \ - PIN_OSPEED_2M(GPIOC_PIN2) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_2M(GPIOC_PIN5) | \ - PIN_OSPEED_40M(GPIOC_LED_RED) | \ - PIN_OSPEED_40M(GPIOC_LED_BLUE) | \ - PIN_OSPEED_40M(GPIOC_LED_ORANGE) | \ - PIN_OSPEED_40M(GPIOC_LED_GREEN) | \ - PIN_OSPEED_2M(GPIOC_PIN10) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_40M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_40M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -578,22 +605,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_2M(GPIOD_PIN0) | \ - PIN_OSPEED_2M(GPIOD_PIN1) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_2M(GPIOD_PIN3) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_2M(GPIOD_PIN6) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_2M(GPIOD_PIN11) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -695,22 +722,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_2M(GPIOE_PIN0) | \ - PIN_OSPEED_2M(GPIOE_PIN1) | \ - PIN_OSPEED_2M(GPIOE_PIN2) | \ - PIN_OSPEED_2M(GPIOE_PIN3) | \ - PIN_OSPEED_2M(GPIOE_PIN4) | \ - PIN_OSPEED_2M(GPIOE_PIN5) | \ - PIN_OSPEED_2M(GPIOE_PIN6) | \ - PIN_OSPEED_2M(GPIOE_PIN7) | \ - PIN_OSPEED_2M(GPIOE_PIN8) | \ - PIN_OSPEED_2M(GPIOE_PIN9) | \ - PIN_OSPEED_2M(GPIOE_PIN10) | \ - PIN_OSPEED_2M(GPIOE_PIN11) | \ - PIN_OSPEED_2M(GPIOE_PIN12) | \ - PIN_OSPEED_2M(GPIOE_PIN13) | \ - PIN_OSPEED_2M(GPIOE_PIN14) | \ - PIN_OSPEED_2M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -812,22 +839,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_2M(GPIOF_OSC_IN) | \ - PIN_OSPEED_2M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_STM32F0_DISCOVERY/board.h b/os/hal/boards/ST_STM32F0_DISCOVERY/board.h index 62e0742c1..5be7b19b5 100644 --- a/os/hal/boards/ST_STM32F0_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F0_DISCOVERY/board.h @@ -137,6 +137,23 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_SWDAT PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + + +#define LINE_LED4 PAL_LINE(GPIOC, 8U) +#define LINE_LED3 PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -150,9 +167,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -210,22 +228,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDAT) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN1) | \ - PIN_OSPEED_2M(GPIOA_PIN2) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_2M(GPIOA_PIN5) | \ - PIN_OSPEED_2M(GPIOA_PIN6) | \ - PIN_OSPEED_2M(GPIOA_PIN7) | \ - PIN_OSPEED_2M(GPIOA_PIN8) | \ - PIN_OSPEED_2M(GPIOA_PIN9) | \ - PIN_OSPEED_2M(GPIOA_PIN10) | \ - PIN_OSPEED_2M(GPIOA_PIN11) | \ - PIN_OSPEED_2M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDAT) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_SWDAT) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ @@ -327,22 +345,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_PIN0) | \ - PIN_OSPEED_2M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_PIN3) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_2M(GPIOB_PIN6) | \ - PIN_OSPEED_2M(GPIOB_PIN7) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_PIN13) | \ - PIN_OSPEED_2M(GPIOB_PIN14) | \ - PIN_OSPEED_2M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -444,22 +462,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_2M(GPIOC_PIN0) | \ - PIN_OSPEED_2M(GPIOC_PIN1) | \ - PIN_OSPEED_2M(GPIOC_PIN2) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_2M(GPIOC_PIN5) | \ - PIN_OSPEED_2M(GPIOC_PIN6) | \ - PIN_OSPEED_2M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_LED4) | \ - PIN_OSPEED_40M(GPIOC_LED3) | \ - PIN_OSPEED_2M(GPIOC_PIN10) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_40M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_40M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_LED4) | \ + PIN_OSPEED_HIGH(GPIOC_LED3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -561,22 +579,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_2M(GPIOD_PIN0) | \ - PIN_OSPEED_2M(GPIOD_PIN1) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_2M(GPIOD_PIN3) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_2M(GPIOD_PIN6) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_2M(GPIOD_PIN11) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -678,22 +696,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_2M(GPIOF_OSC_IN) | \ - PIN_OSPEED_2M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_STM32F3_DISCOVERY/board.h b/os/hal/boards/ST_STM32F3_DISCOVERY/board.h index f0ab43a18..7d07aa95b 100644 --- a/os/hal/boards/ST_STM32F3_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F3_DISCOVERY/board.h @@ -153,6 +153,44 @@ #define GPIOF_PIN14 14U #define GPIOF_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_SPI1_SCK PAL_LINE(GPIOA, 5U) +#define LINE_SPI1_MISO PAL_LINE(GPIOA, 6U) +#define LINE_SPI1_MOSI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) +#define LINE_I2C1_SCL PAL_LINE(GPIOB, 6U) +#define LINE_I2C1_SDA PAL_LINE(GPIOB, 7U) + +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + +#define LINE_L3GD20_INT1 PAL_LINE(GPIOE, 0U) +#define LINE_L3GD20_INT2 PAL_LINE(GPIOE, 1U) +#define LINE_LSM303_DRDY PAL_LINE(GPIOE, 2U) +#define LINE_SPI1_CS PAL_LINE(GPIOE, 3U) +#define LINE_LSM303_INT1 PAL_LINE(GPIOE, 4U) +#define LINE_LSM303_INT2 PAL_LINE(GPIOE, 5U) +#define LINE_LED4_BLUE PAL_LINE(GPIOE, 8U) +#define LINE_LED3_RED PAL_LINE(GPIOE, 9U) +#define LINE_LED5_ORANGE PAL_LINE(GPIOE, 10U) +#define LINE_LED7_GREEN PAL_LINE(GPIOE, 11U) +#define LINE_LED9_BLUE PAL_LINE(GPIOE, 12U) +#define LINE_LED10_RED PAL_LINE(GPIOE, 13U) +#define LINE_LED8_ORANGE PAL_LINE(GPIOE, 14U) +#define LINE_LED6_GREEN PAL_LINE(GPIOE, 15U) + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -166,10 +204,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -227,22 +265,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN1) | \ - PIN_OSPEED_2M(GPIOA_PIN2) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_SPI1_SCK) | \ - PIN_OSPEED_100M(GPIOA_SPI1_MISO) | \ - PIN_OSPEED_100M(GPIOA_SPI1_MOSI) | \ - PIN_OSPEED_2M(GPIOA_PIN8) | \ - PIN_OSPEED_2M(GPIOA_PIN9) | \ - PIN_OSPEED_2M(GPIOA_PIN10) | \ - PIN_OSPEED_100M(GPIOA_USB_DM) | \ - PIN_OSPEED_2M(GPIOA_USB_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_2M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_HIGH(GPIOA_SPI1_SCK) | \ + PIN_OSPEED_HIGH(GPIOA_SPI1_MISO) | \ + PIN_OSPEED_HIGH(GPIOA_SPI1_MOSI) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ @@ -344,22 +382,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_PIN0) | \ - PIN_OSPEED_2M(GPIOB_PIN1) | \ - PIN_OSPEED_2M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_2M(GPIOB_PIN4) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SCL) | \ - PIN_OSPEED_100M(GPIOB_I2C1_SDA) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_PIN13) | \ - PIN_OSPEED_2M(GPIOB_PIN14) | \ - PIN_OSPEED_2M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -461,22 +499,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_2M(GPIOC_PIN0) | \ - PIN_OSPEED_2M(GPIOC_PIN1) | \ - PIN_OSPEED_2M(GPIOC_PIN2) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_2M(GPIOC_PIN5) | \ - PIN_OSPEED_2M(GPIOC_PIN6) | \ - PIN_OSPEED_2M(GPIOC_PIN7) | \ - PIN_OSPEED_2M(GPIOC_PIN8) | \ - PIN_OSPEED_2M(GPIOC_PIN9) | \ - PIN_OSPEED_2M(GPIOC_PIN10) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -578,22 +616,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_2M(GPIOD_PIN0) | \ - PIN_OSPEED_2M(GPIOD_PIN1) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_2M(GPIOD_PIN3) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_2M(GPIOD_PIN6) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_2M(GPIOD_PIN11) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -695,22 +733,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_LED10_RED) | \ PIN_OTYPE_PUSHPULL(GPIOE_LED8_ORANGE) |\ PIN_OTYPE_PUSHPULL(GPIOE_LED6_GREEN)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_2M(GPIOE_L3GD20_INT1) | \ - PIN_OSPEED_2M(GPIOE_L3GD20_INT2) | \ - PIN_OSPEED_2M(GPIOE_LSM303_DRDY) | \ - PIN_OSPEED_100M(GPIOE_SPI1_CS) | \ - PIN_OSPEED_2M(GPIOE_LSM303_INT1) | \ - PIN_OSPEED_2M(GPIOE_LSM303_INT2) | \ - PIN_OSPEED_2M(GPIOE_PIN6) | \ - PIN_OSPEED_2M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_LED4_BLUE) | \ - PIN_OSPEED_100M(GPIOE_LED3_RED) | \ - PIN_OSPEED_100M(GPIOE_LED5_ORANGE) | \ - PIN_OSPEED_100M(GPIOE_LED7_GREEN) | \ - PIN_OSPEED_100M(GPIOE_LED9_BLUE) | \ - PIN_OSPEED_100M(GPIOE_LED10_RED) | \ - PIN_OSPEED_100M(GPIOE_LED8_ORANGE) | \ - PIN_OSPEED_100M(GPIOE_LED6_GREEN)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT1) |\ + PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT2) |\ + PIN_OSPEED_VERYLOW(GPIOE_LSM303_DRDY) |\ + PIN_OSPEED_HIGH(GPIOE_SPI1_CS) | \ + PIN_OSPEED_VERYLOW(GPIOE_LSM303_INT1) |\ + PIN_OSPEED_VERYLOW(GPIOE_LSM303_INT2) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_LED4_BLUE) | \ + PIN_OSPEED_HIGH(GPIOE_LED3_RED) | \ + PIN_OSPEED_HIGH(GPIOE_LED5_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOE_LED7_GREEN) | \ + PIN_OSPEED_HIGH(GPIOE_LED9_BLUE) | \ + PIN_OSPEED_HIGH(GPIOE_LED10_RED) | \ + PIN_OSPEED_HIGH(GPIOE_LED8_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOE_LED6_GREEN)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT1) | \ PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT2) | \ PIN_PUPDR_PULLUP(GPIOE_LSM303_DRDY) | \ @@ -812,22 +850,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_OSC_IN) | \ - PIN_OSPEED_100M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ diff --git a/os/hal/boards/ST_STM32F429I_DISCOVERY/board.h b/os/hal/boards/ST_STM32F429I_DISCOVERY/board.h index a61509aa5..cdb01a32d 100644 --- a/os/hal/boards/ST_STM32F429I_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F429I_DISCOVERY/board.h @@ -27,7 +27,6 @@ #define BOARD_ST_STM32F429I_DISCOVERY #define BOARD_NAME "STMicroelectronics STM32F429I-Discovery" - /* * Board oscillators-related settings. * NOTE: LSE not fitted. @@ -207,6 +206,111 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_MEMS_INT1 PAL_LINE(GPIOA, 1U) +#define LINE_MEMS_INT2 PAL_LINE(GPIOA, 2U) +#define LINE_LCD_B5 PAL_LINE(GPIOA, 3U) +#define LINE_LCD_VSYNC PAL_LINE(GPIOA, 4U) +#define LINE_LCD_G2 PAL_LINE(GPIOA, 6U) +#define LINE_ACP_RST PAL_LINE(GPIOA, 7U) +#define LINE_I2C3_SCL PAL_LINE(GPIOA, 8U) +#define LINE_UART_TX PAL_LINE(GPIOA, 9U) +#define LINE_UART_RX PAL_LINE(GPIOA, 10U) +#define LINE_LCD_R4 PAL_LINE(GPIOA, 11U) +#define LINE_LCD_R5 PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) +#define LINE_TP_INT PAL_LINE(GPIOA, 15U) + +#define LINE_LCD_R3 PAL_LINE(GPIOB, 0U) +#define LINE_LCD_R6 PAL_LINE(GPIOB, 1U) +#define LINE_BOOT1 PAL_LINE(GPIOB, 2U) +#define LINE_SWO PAL_LINE(GPIOB, 3U) +#define LINE_FMC_SDCKE1 PAL_LINE(GPIOB, 5U) +#define LINE_FMC_SDNE1 PAL_LINE(GPIOB, 6U) +#define LINE_LCD_B6 PAL_LINE(GPIOB, 8U) +#define LINE_LCD_B7 PAL_LINE(GPIOB, 9U) +#define LINE_LCD_G4 PAL_LINE(GPIOB, 10U) +#define LINE_LCD_G5 PAL_LINE(GPIOB, 11U) +#define LINE_OTG_HS_ID PAL_LINE(GPIOB, 12U) +#define LINE_OTG_HS_VBUS PAL_LINE(GPIOB, 13U) +#define LINE_OTG_HS_DM PAL_LINE(GPIOB, 14U) +#define LINE_OTG_HS_DP PAL_LINE(GPIOB, 15U) + +#define LINE_FMC_SDNWE PAL_LINE(GPIOC, 0U) +#define LINE_SPI5_MEMS_CS PAL_LINE(GPIOC, 1U) +#define LINE_SPI5_LCD_CS PAL_LINE(GPIOC, 2U) +#define LINE_OTG_HS_PSO PAL_LINE(GPIOC, 4U) +#define LINE_OTG_HS_OC PAL_LINE(GPIOC, 5U) +#define LINE_LCD_HSYNC PAL_LINE(GPIOC, 6U) +#define LINE_LCD_G6 PAL_LINE(GPIOC, 7U) +#define LINE_I2C3_SDA PAL_LINE(GPIOC, 9U) +#define LINE_LCD_R2 PAL_LINE(GPIOC, 10U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + +#define LINE_FMC_D2 PAL_LINE(GPIOD, 0U) +#define LINE_FMC_D3 PAL_LINE(GPIOD, 1U) +#define LINE_LCD_G7 PAL_LINE(GPIOD, 3U) +#define LINE_LCD_B2 PAL_LINE(GPIOD, 6U) +#define LINE_FMC_D13 PAL_LINE(GPIOD, 8U) +#define LINE_FMC_D14 PAL_LINE(GPIOD, 9U) +#define LINE_FMC_D15 PAL_LINE(GPIOD, 10U) +#define LINE_LCD_TE PAL_LINE(GPIOD, 11U) +#define LINE_LCD_RDX PAL_LINE(GPIOD, 12U) +#define LINE_LCD_WRX PAL_LINE(GPIOD, 13U) +#define LINE_FMC_D0 PAL_LINE(GPIOD, 14U) +#define LINE_FMC_D1 PAL_LINE(GPIOD, 15U) + +#define LINE_FMC_NBL0 PAL_LINE(GPIOE, 0U) +#define LINE_FMC_NBL1 PAL_LINE(GPIOE, 1U) +#define LINE_FMC_D4 PAL_LINE(GPIOE, 7U) +#define LINE_FMC_D5 PAL_LINE(GPIOE, 8U) +#define LINE_FMC_D6 PAL_LINE(GPIOE, 9U) +#define LINE_FMC_D7 PAL_LINE(GPIOE, 10U) +#define LINE_FMC_D8 PAL_LINE(GPIOE, 11U) +#define LINE_FMC_D9 PAL_LINE(GPIOE, 12U) +#define LINE_FMC_D10 PAL_LINE(GPIOE, 13U) +#define LINE_FMC_D11 PAL_LINE(GPIOE, 14U) +#define LINE_FMC_D12 PAL_LINE(GPIOE, 15U) + +#define LINE_FMC_A0 PAL_LINE(GPIOF, 0U) +#define LINE_FMC_A1 PAL_LINE(GPIOF, 1U) +#define LINE_FMC_A2 PAL_LINE(GPIOF, 2U) +#define LINE_FMC_A3 PAL_LINE(GPIOF, 3U) +#define LINE_FMC_A4 PAL_LINE(GPIOF, 4U) +#define LINE_FMC_A5 PAL_LINE(GPIOF, 5U) +#define LINE_LCD_DCX PAL_LINE(GPIOF, 7U) +#define LINE_SPI5_MISO PAL_LINE(GPIOF, 8U) +#define LINE_SPI5_MOSI PAL_LINE(GPIOF, 9U) +#define LINE_LCD_DE PAL_LINE(GPIOF, 10U) +#define LINE_FMC_SDNRAS PAL_LINE(GPIOF, 11U) +#define LINE_FMC_A6 PAL_LINE(GPIOF, 12U) +#define LINE_FMC_A7 PAL_LINE(GPIOF, 13U) +#define LINE_FMC_A8 PAL_LINE(GPIOF, 14U) +#define LINE_FMC_A9 PAL_LINE(GPIOF, 15U) + +#define LINE_FMC_A10 PAL_LINE(GPIOG, 0U) +#define LINE_FMC_A11 PAL_LINE(GPIOG, 1U) +#define LINE_FMC_BA0 PAL_LINE(GPIOG, 4U) +#define LINE_FMC_BA1 PAL_LINE(GPIOG, 5U) +#define LINE_LCD_R7 PAL_LINE(GPIOG, 6U) +#define LINE_LCD_CLK PAL_LINE(GPIOG, 7U) +#define LINE_FMC_SDCLK PAL_LINE(GPIOG, 8U) +#define LINE_LCD_G3 PAL_LINE(GPIOG, 10U) +#define LINE_LCD_B3 PAL_LINE(GPIOG, 11U) +#define LINE_LCD_B4 PAL_LINE(GPIOG, 12U) +#define LINE_LED3_GREEN PAL_LINE(GPIOG, 13U) +#define LINE_LED4_RED PAL_LINE(GPIOG, 14U) +#define LINE_FMC_SDNCAS PAL_LINE(GPIOG, 15U) + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -220,10 +324,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -281,22 +385,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_TP_INT)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_MEMS_INT1) | \ - PIN_OSPEED_2M(GPIOA_MEMS_INT2) | \ - PIN_OSPEED_100M(GPIOA_LCD_B5) | \ - PIN_OSPEED_100M(GPIOA_LCD_VSYNC) | \ - PIN_OSPEED_2M(GPIOA_PIN5) | \ - PIN_OSPEED_100M(GPIOA_LCD_G2) | \ - PIN_OSPEED_2M(GPIOA_ACP_RST) | \ - PIN_OSPEED_100M(GPIOA_I2C3_SCL) | \ - PIN_OSPEED_2M(GPIOA_UART_TX) | \ - PIN_OSPEED_2M(GPIOA_UART_RX) | \ - PIN_OSPEED_100M(GPIOA_LCD_R4) | \ - PIN_OSPEED_100M(GPIOA_LCD_R5) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_2M(GPIOA_TP_INT)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_MEMS_INT1) | \ + PIN_OSPEED_VERYLOW(GPIOA_MEMS_INT2) | \ + PIN_OSPEED_HIGH(GPIOA_LCD_B5) | \ + PIN_OSPEED_HIGH(GPIOA_LCD_VSYNC) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_HIGH(GPIOA_LCD_G2) | \ + PIN_OSPEED_VERYLOW(GPIOA_ACP_RST) | \ + PIN_OSPEED_HIGH(GPIOA_I2C3_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOA_UART_TX) | \ + PIN_OSPEED_VERYLOW(GPIOA_UART_RX) | \ + PIN_OSPEED_HIGH(GPIOA_LCD_R4) | \ + PIN_OSPEED_HIGH(GPIOA_LCD_R5) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_TP_INT)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_FLOATING(GPIOA_MEMS_INT1) | \ PIN_PUPDR_FLOATING(GPIOA_MEMS_INT2) | \ @@ -398,22 +502,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_VBUS) |\ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DM) | \ PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DP)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_LCD_R3) | \ - PIN_OSPEED_100M(GPIOB_LCD_R6) | \ - PIN_OSPEED_100M(GPIOB_BOOT1) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_2M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_FMC_SDCKE1) | \ - PIN_OSPEED_100M(GPIOB_FMC_SDNE1) | \ - PIN_OSPEED_2M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_LCD_B6) | \ - PIN_OSPEED_100M(GPIOB_LCD_B7) | \ - PIN_OSPEED_100M(GPIOB_LCD_G4) | \ - PIN_OSPEED_100M(GPIOB_LCD_G5) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_ID) | \ - PIN_OSPEED_2M(GPIOB_OTG_HS_VBUS) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DM) | \ - PIN_OSPEED_100M(GPIOB_OTG_HS_DP)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_LCD_R3) | \ + PIN_OSPEED_HIGH(GPIOB_LCD_R6) | \ + PIN_OSPEED_HIGH(GPIOB_BOOT1) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_FMC_SDCKE1) | \ + PIN_OSPEED_HIGH(GPIOB_FMC_SDNE1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_LCD_B6) | \ + PIN_OSPEED_HIGH(GPIOB_LCD_B7) | \ + PIN_OSPEED_HIGH(GPIOB_LCD_G4) | \ + PIN_OSPEED_HIGH(GPIOB_LCD_G5) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_ID) | \ + PIN_OSPEED_VERYLOW(GPIOB_OTG_HS_VBUS) |\ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DM) | \ + PIN_OSPEED_HIGH(GPIOB_OTG_HS_DP)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_LCD_R3) | \ PIN_PUPDR_FLOATING(GPIOB_LCD_R6) | \ PIN_PUPDR_PULLUP(GPIOB_BOOT1) | \ @@ -515,22 +619,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_FMC_SDNWE) | \ - PIN_OSPEED_100M(GPIOC_SPI5_MEMS_CS) | \ - PIN_OSPEED_100M(GPIOC_SPI5_LCD_CS) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_OTG_HS_PSO) | \ - PIN_OSPEED_100M(GPIOC_OTG_HS_OC) | \ - PIN_OSPEED_100M(GPIOC_LCD_HSYNC) | \ - PIN_OSPEED_100M(GPIOC_LCD_G6) | \ - PIN_OSPEED_2M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_I2C3_SDA) | \ - PIN_OSPEED_100M(GPIOC_LCD_R2) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_FMC_SDNWE) | \ + PIN_OSPEED_HIGH(GPIOC_SPI5_MEMS_CS) | \ + PIN_OSPEED_HIGH(GPIOC_SPI5_LCD_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_OTG_HS_PSO) | \ + PIN_OSPEED_HIGH(GPIOC_OTG_HS_OC) | \ + PIN_OSPEED_HIGH(GPIOC_LCD_HSYNC) | \ + PIN_OSPEED_HIGH(GPIOC_LCD_G6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_I2C3_SDA) | \ + PIN_OSPEED_HIGH(GPIOC_LCD_R2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_FMC_SDNWE) | \ PIN_PUPDR_FLOATING(GPIOC_SPI5_MEMS_CS) |\ PIN_PUPDR_FLOATING(GPIOC_SPI5_LCD_CS) |\ @@ -632,22 +736,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_LCD_WRX) | \ PIN_OTYPE_PUSHPULL(GPIOD_FMC_D0) | \ PIN_OTYPE_PUSHPULL(GPIOD_FMC_D1)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_FMC_D2) | \ - PIN_OSPEED_100M(GPIOD_FMC_D3) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_LCD_G7) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_100M(GPIOD_LCD_B2) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_FMC_D13) | \ - PIN_OSPEED_100M(GPIOD_FMC_D14) | \ - PIN_OSPEED_100M(GPIOD_FMC_D15) | \ - PIN_OSPEED_100M(GPIOD_LCD_TE) | \ - PIN_OSPEED_100M(GPIOD_LCD_RDX) | \ - PIN_OSPEED_100M(GPIOD_LCD_WRX) | \ - PIN_OSPEED_100M(GPIOD_FMC_D0) | \ - PIN_OSPEED_100M(GPIOD_FMC_D1)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_FMC_D2) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_G7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_B2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D13) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D14) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D15) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_TE) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_RDX) | \ + PIN_OSPEED_HIGH(GPIOD_LCD_WRX) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D0) | \ + PIN_OSPEED_HIGH(GPIOD_FMC_D1)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_FMC_D2) | \ PIN_PUPDR_FLOATING(GPIOD_FMC_D3) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -749,22 +853,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_FMC_D10) | \ PIN_OTYPE_PUSHPULL(GPIOE_FMC_D11) | \ PIN_OTYPE_PUSHPULL(GPIOE_FMC_D12)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_FMC_NBL0) | \ - PIN_OSPEED_100M(GPIOE_FMC_NBL1) | \ - PIN_OSPEED_2M(GPIOE_PIN2) | \ - PIN_OSPEED_2M(GPIOE_PIN3) | \ - PIN_OSPEED_2M(GPIOE_PIN4) | \ - PIN_OSPEED_2M(GPIOE_PIN5) | \ - PIN_OSPEED_2M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_FMC_D4) | \ - PIN_OSPEED_100M(GPIOE_FMC_D5) | \ - PIN_OSPEED_100M(GPIOE_FMC_D6) | \ - PIN_OSPEED_100M(GPIOE_FMC_D7) | \ - PIN_OSPEED_100M(GPIOE_FMC_D8) | \ - PIN_OSPEED_100M(GPIOE_FMC_D9) | \ - PIN_OSPEED_100M(GPIOE_FMC_D10) | \ - PIN_OSPEED_100M(GPIOE_FMC_D11) | \ - PIN_OSPEED_100M(GPIOE_FMC_D12)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_FMC_NBL0) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_NBL1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D4) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D5) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D6) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D7) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D8) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D9) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D10) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D11) | \ + PIN_OSPEED_HIGH(GPIOE_FMC_D12)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_FMC_NBL0) | \ PIN_PUPDR_FLOATING(GPIOE_FMC_NBL1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -866,22 +970,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_FMC_A7) | \ PIN_OTYPE_PUSHPULL(GPIOF_FMC_A8) | \ PIN_OTYPE_PUSHPULL(GPIOF_FMC_A9)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_FMC_A0) | \ - PIN_OSPEED_100M(GPIOF_FMC_A1) | \ - PIN_OSPEED_100M(GPIOF_FMC_A2) | \ - PIN_OSPEED_100M(GPIOF_FMC_A3) | \ - PIN_OSPEED_100M(GPIOF_FMC_A4) | \ - PIN_OSPEED_100M(GPIOF_FMC_A5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_LCD_DCX) | \ - PIN_OSPEED_100M(GPIOF_SPI5_MISO) | \ - PIN_OSPEED_100M(GPIOF_SPI5_MOSI) | \ - PIN_OSPEED_100M(GPIOF_LCD_DE) | \ - PIN_OSPEED_100M(GPIOF_FMC_SDNRAS) | \ - PIN_OSPEED_100M(GPIOF_FMC_A6) | \ - PIN_OSPEED_100M(GPIOF_FMC_A7) | \ - PIN_OSPEED_100M(GPIOF_FMC_A8) | \ - PIN_OSPEED_100M(GPIOF_FMC_A9)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_FMC_A0) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A1) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A2) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A3) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A4) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_LCD_DCX) | \ + PIN_OSPEED_HIGH(GPIOF_SPI5_MISO) | \ + PIN_OSPEED_HIGH(GPIOF_SPI5_MOSI) | \ + PIN_OSPEED_HIGH(GPIOF_LCD_DE) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_SDNRAS) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A6) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A7) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A8) | \ + PIN_OSPEED_HIGH(GPIOF_FMC_A9)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_FMC_A0) | \ PIN_PUPDR_FLOATING(GPIOF_FMC_A1) | \ PIN_PUPDR_FLOATING(GPIOF_FMC_A2) | \ @@ -983,22 +1087,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_LED3_GREEN) | \ PIN_OTYPE_PUSHPULL(GPIOG_LED4_RED) | \ PIN_OTYPE_PUSHPULL(GPIOG_FMC_SDNCAS)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_FMC_A10) | \ - PIN_OSPEED_100M(GPIOG_FMC_A11) | \ - PIN_OSPEED_2M(GPIOG_PIN2) | \ - PIN_OSPEED_2M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_FMC_BA0) | \ - PIN_OSPEED_100M(GPIOG_FMC_BA1) | \ - PIN_OSPEED_100M(GPIOG_LCD_R7) | \ - PIN_OSPEED_100M(GPIOG_LCD_CLK) | \ - PIN_OSPEED_100M(GPIOG_FMC_SDCLK) | \ - PIN_OSPEED_2M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_LCD_G3) | \ - PIN_OSPEED_100M(GPIOG_LCD_B3) | \ - PIN_OSPEED_100M(GPIOG_LCD_B4) | \ - PIN_OSPEED_100M(GPIOG_LED3_GREEN) | \ - PIN_OSPEED_100M(GPIOG_LED4_RED) | \ - PIN_OSPEED_100M(GPIOG_FMC_SDNCAS)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_FMC_A10) | \ + PIN_OSPEED_HIGH(GPIOG_FMC_A11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_FMC_BA0) | \ + PIN_OSPEED_HIGH(GPIOG_FMC_BA1) | \ + PIN_OSPEED_HIGH(GPIOG_LCD_R7) | \ + PIN_OSPEED_HIGH(GPIOG_LCD_CLK) | \ + PIN_OSPEED_HIGH(GPIOG_FMC_SDCLK) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_LCD_G3) | \ + PIN_OSPEED_HIGH(GPIOG_LCD_B3) | \ + PIN_OSPEED_HIGH(GPIOG_LCD_B4) | \ + PIN_OSPEED_HIGH(GPIOG_LED3_GREEN) | \ + PIN_OSPEED_HIGH(GPIOG_LED4_RED) | \ + PIN_OSPEED_HIGH(GPIOG_FMC_SDNCAS)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_FMC_A10) | \ PIN_PUPDR_FLOATING(GPIOG_FMC_A11) | \ PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ @@ -1100,22 +1204,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOH_PIN2) | \ - PIN_OSPEED_2M(GPIOH_PIN3) | \ - PIN_OSPEED_2M(GPIOH_PIN4) | \ - PIN_OSPEED_2M(GPIOH_PIN5) | \ - PIN_OSPEED_2M(GPIOH_PIN6) | \ - PIN_OSPEED_2M(GPIOH_PIN7) | \ - PIN_OSPEED_2M(GPIOH_PIN8) | \ - PIN_OSPEED_2M(GPIOH_PIN9) | \ - PIN_OSPEED_2M(GPIOH_PIN10) | \ - PIN_OSPEED_2M(GPIOH_PIN11) | \ - PIN_OSPEED_2M(GPIOH_PIN12) | \ - PIN_OSPEED_2M(GPIOH_PIN13) | \ - PIN_OSPEED_2M(GPIOH_PIN14) | \ - PIN_OSPEED_2M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ @@ -1217,22 +1321,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_2M(GPIOI_PIN0) | \ - PIN_OSPEED_2M(GPIOI_PIN1) | \ - PIN_OSPEED_2M(GPIOI_PIN2) | \ - PIN_OSPEED_2M(GPIOI_PIN3) | \ - PIN_OSPEED_2M(GPIOI_PIN4) | \ - PIN_OSPEED_2M(GPIOI_PIN5) | \ - PIN_OSPEED_2M(GPIOI_PIN6) | \ - PIN_OSPEED_2M(GPIOI_PIN7) | \ - PIN_OSPEED_2M(GPIOI_PIN8) | \ - PIN_OSPEED_2M(GPIOI_PIN9) | \ - PIN_OSPEED_2M(GPIOI_PIN10) | \ - PIN_OSPEED_2M(GPIOI_PIN11) | \ - PIN_OSPEED_2M(GPIOI_PIN12) | \ - PIN_OSPEED_2M(GPIOI_PIN13) | \ - PIN_OSPEED_2M(GPIOI_PIN14) | \ - PIN_OSPEED_2M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOI_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \ PIN_PUPDR_PULLUP(GPIOI_PIN1) | \ PIN_PUPDR_PULLUP(GPIOI_PIN2) | \ diff --git a/os/hal/boards/ST_STM32F4_DISCOVERY/board.h b/os/hal/boards/ST_STM32F4_DISCOVERY/board.h index bd0d1916d..b11bdc61c 100644 --- a/os/hal/boards/ST_STM32F4_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F4_DISCOVERY/board.h @@ -27,7 +27,6 @@ #define BOARD_ST_STM32F4_DISCOVERY #define BOARD_NAME "STMicroelectronics STM32F4-Discovery" - /* * Board oscillators-related settings. * NOTE: LSE not fitted. @@ -207,6 +206,49 @@ #define GPIOI_PIN14 14U #define GPIOI_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_LRCK PAL_LINE(GPIOA, 4U) +#define LINE_SPC PAL_LINE(GPIOA, 5U) +#define LINE_SDO PAL_LINE(GPIOA, 6U) +#define LINE_SDI PAL_LINE(GPIOA, 7U) +#define LINE_VBUS_FS PAL_LINE(GPIOA, 9U) +#define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U) +#define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U) +#define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SWO PAL_LINE(GPIOB, 3U) +#define LINE_SCL PAL_LINE(GPIOB, 6U) +#define LINE_SDA PAL_LINE(GPIOB, 9U) +#define LINE_CLK_IN PAL_LINE(GPIOB, 10U) + +#define LINE_OTG_FS_POWER_ON PAL_LINE(GPIOC, 0U) +#define LINE_PDM_OUT PAL_LINE(GPIOC, 3U) +#define LINE_MCLK PAL_LINE(GPIOC, 7U) +#define LINE_SCLK PAL_LINE(GPIOC, 10U) +#define LINE_SDIN PAL_LINE(GPIOC, 12U) + +#define LINE_RESET PAL_LINE(GPIOD, 4U) +#define LINE_OVER_CURRENT PAL_LINE(GPIOD, 5U) +#define LINE_LED4 PAL_LINE(GPIOD, 12U) +#define LINE_LED3 PAL_LINE(GPIOD, 13U) +#define LINE_LED5 PAL_LINE(GPIOD, 14U) +#define LINE_LED6 PAL_LINE(GPIOD, 15U) + +#define LINE_INT1 PAL_LINE(GPIOE, 0U) +#define LINE_INT2 PAL_LINE(GPIOE, 1U) +#define LINE_CS_SPI PAL_LINE(GPIOE, 3U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -220,10 +262,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -281,22 +323,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_100M(GPIOA_PIN2) | \ - PIN_OSPEED_100M(GPIOA_PIN3) | \ - PIN_OSPEED_100M(GPIOA_LRCK) | \ - PIN_OSPEED_50M(GPIOA_SPC) | \ - PIN_OSPEED_50M(GPIOA_SDO) | \ - PIN_OSPEED_50M(GPIOA_SDI) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_VBUS_FS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_HIGH(GPIOA_PIN2) | \ + PIN_OSPEED_HIGH(GPIOA_PIN3) | \ + PIN_OSPEED_HIGH(GPIOA_LRCK) | \ + PIN_OSPEED_MEDIUM(GPIOA_SPC) | \ + PIN_OSPEED_MEDIUM(GPIOA_SDO) | \ + PIN_OSPEED_MEDIUM(GPIOA_SDI) | \ + PIN_OSPEED_HIGH(GPIOA_PIN8) | \ + PIN_OSPEED_HIGH(GPIOA_VBUS_FS) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \ + PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ @@ -398,22 +440,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_SCL) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_SDA) | \ - PIN_OSPEED_100M(GPIOB_CLK_IN) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_SWO) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_HIGH(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_SCL) | \ + PIN_OSPEED_HIGH(GPIOB_PIN7) | \ + PIN_OSPEED_HIGH(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_SDA) | \ + PIN_OSPEED_HIGH(GPIOB_CLK_IN) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ @@ -515,22 +557,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PDM_OUT) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_MCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_SCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_SDIN) | \ - PIN_OSPEED_100M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_OTG_FS_POWER_ON) |\ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PDM_OUT) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_MCLK) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_SCLK) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_SDIN) | \ + PIN_OSPEED_HIGH(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -632,22 +674,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_LED3) | \ PIN_OTYPE_PUSHPULL(GPIOD_LED5) | \ PIN_OTYPE_PUSHPULL(GPIOD_LED6)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_RESET) | \ - PIN_OSPEED_100M(GPIOD_OVER_CURRENT) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_LED4) | \ - PIN_OSPEED_100M(GPIOD_LED3) | \ - PIN_OSPEED_100M(GPIOD_LED5) | \ - PIN_OSPEED_100M(GPIOD_LED6)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_RESET) | \ + PIN_OSPEED_HIGH(GPIOD_OVER_CURRENT) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_LED4) | \ + PIN_OSPEED_HIGH(GPIOD_LED3) | \ + PIN_OSPEED_HIGH(GPIOD_LED5) | \ + PIN_OSPEED_HIGH(GPIOD_LED6)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -749,22 +791,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_INT1) | \ - PIN_OSPEED_100M(GPIOE_INT2) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_CS_SPI) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_INT1) | \ + PIN_OSPEED_HIGH(GPIOE_INT2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_CS_SPI) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_INT1) | \ PIN_PUPDR_FLOATING(GPIOE_INT2) | \ PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ @@ -866,22 +908,22 @@ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \ + PIN_OSPEED_HIGH(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ @@ -983,22 +1025,22 @@ PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_PIN11) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_PIN13) | \ - PIN_OSPEED_100M(GPIOG_PIN14) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \ + PIN_OSPEED_HIGH(GPIOG_PIN1) | \ + PIN_OSPEED_HIGH(GPIOG_PIN2) | \ + PIN_OSPEED_HIGH(GPIOG_PIN3) | \ + PIN_OSPEED_HIGH(GPIOG_PIN4) | \ + PIN_OSPEED_HIGH(GPIOG_PIN5) | \ + PIN_OSPEED_HIGH(GPIOG_PIN6) | \ + PIN_OSPEED_HIGH(GPIOG_PIN7) | \ + PIN_OSPEED_HIGH(GPIOG_PIN8) | \ + PIN_OSPEED_HIGH(GPIOG_PIN9) | \ + PIN_OSPEED_HIGH(GPIOG_PIN10) | \ + PIN_OSPEED_HIGH(GPIOG_PIN11) | \ + PIN_OSPEED_HIGH(GPIOG_PIN12) | \ + PIN_OSPEED_HIGH(GPIOG_PIN13) | \ + PIN_OSPEED_HIGH(GPIOG_PIN14) | \ + PIN_OSPEED_HIGH(GPIOG_PIN15)) #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ @@ -1100,22 +1142,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_HIGH(GPIOH_PIN2) | \ + PIN_OSPEED_HIGH(GPIOH_PIN3) | \ + PIN_OSPEED_HIGH(GPIOH_PIN4) | \ + PIN_OSPEED_HIGH(GPIOH_PIN5) | \ + PIN_OSPEED_HIGH(GPIOH_PIN6) | \ + PIN_OSPEED_HIGH(GPIOH_PIN7) | \ + PIN_OSPEED_HIGH(GPIOH_PIN8) | \ + PIN_OSPEED_HIGH(GPIOH_PIN9) | \ + PIN_OSPEED_HIGH(GPIOH_PIN10) | \ + PIN_OSPEED_HIGH(GPIOH_PIN11) | \ + PIN_OSPEED_HIGH(GPIOH_PIN12) | \ + PIN_OSPEED_HIGH(GPIOH_PIN13) | \ + PIN_OSPEED_HIGH(GPIOH_PIN14) | \ + PIN_OSPEED_HIGH(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ @@ -1217,22 +1259,22 @@ PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) +#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \ + PIN_OSPEED_HIGH(GPIOI_PIN1) | \ + PIN_OSPEED_HIGH(GPIOI_PIN2) | \ + PIN_OSPEED_HIGH(GPIOI_PIN3) | \ + PIN_OSPEED_HIGH(GPIOI_PIN4) | \ + PIN_OSPEED_HIGH(GPIOI_PIN5) | \ + PIN_OSPEED_HIGH(GPIOI_PIN6) | \ + PIN_OSPEED_HIGH(GPIOI_PIN7) | \ + PIN_OSPEED_HIGH(GPIOI_PIN8) | \ + PIN_OSPEED_HIGH(GPIOI_PIN9) | \ + PIN_OSPEED_HIGH(GPIOI_PIN10) | \ + PIN_OSPEED_HIGH(GPIOI_PIN11) | \ + PIN_OSPEED_HIGH(GPIOI_PIN12) | \ + PIN_OSPEED_HIGH(GPIOI_PIN13) | \ + PIN_OSPEED_HIGH(GPIOI_PIN14) | \ + PIN_OSPEED_HIGH(GPIOI_PIN15)) #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ diff --git a/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h b/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h index c7a4ac1f6..7a4bb5c82 100644 --- a/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32F746G_DISCOVERY/board.h @@ -447,9 +447,9 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) diff --git a/os/hal/boards/ST_STM32L_DISCOVERY/board.h b/os/hal/boards/ST_STM32L_DISCOVERY/board.h index ccad0145c..2e14c862b 100644 --- a/os/hal/boards/ST_STM32L_DISCOVERY/board.h +++ b/os/hal/boards/ST_STM32L_DISCOVERY/board.h @@ -151,6 +151,28 @@ #define GPIOH_PIN14 14U #define GPIOH_PIN15 15U +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_JTAG_TMS PAL_LINE(GPIOA, 13U) +#define LINE_JTAG_TCK PAL_LINE(GPIOA, 14U) +#define LINE_JTAG_TDI PAL_LINE(GPIOA, 15U) + +#define LINE_BOOT1 PAL_LINE(GPIOB, 2U) +#define LINE_JTAG_TDO PAL_LINE(GPIOB, 3U) +#define LINE_JTAG_TRST PAL_LINE(GPIOB, 4U) +#define LINE_LED4 PAL_LINE(GPIOB, 6U) +#define LINE_LED3 PAL_LINE(GPIOB, 7U) + +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOH, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U) + /* * I/O ports initial setup, this configuration is established soon after reset * in the initialization code. @@ -164,10 +186,10 @@ #define PIN_ODR_HIGH(n) (1U << (n)) #define PIN_OTYPE_PUSHPULL(n) (0U << (n)) #define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_400K(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_2M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) @@ -225,22 +247,22 @@ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TMS) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TCK) | \ PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_400K(GPIOA_BUTTON) | \ - PIN_OSPEED_400K(GPIOA_PIN1) | \ - PIN_OSPEED_400K(GPIOA_PIN2) | \ - PIN_OSPEED_400K(GPIOA_PIN3) | \ - PIN_OSPEED_400K(GPIOA_PIN4) | \ - PIN_OSPEED_400K(GPIOA_PIN5) | \ - PIN_OSPEED_400K(GPIOA_PIN6) | \ - PIN_OSPEED_400K(GPIOA_PIN7) | \ - PIN_OSPEED_400K(GPIOA_PIN8) | \ - PIN_OSPEED_400K(GPIOA_PIN9) | \ - PIN_OSPEED_400K(GPIOA_PIN10) | \ - PIN_OSPEED_400K(GPIOA_PIN11) | \ - PIN_OSPEED_400K(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_JTAG_TMS) | \ - PIN_OSPEED_40M(GPIOA_JTAG_TCK) | \ - PIN_OSPEED_40M(GPIOA_JTAG_TDI)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TMS) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TCK) | \ + PIN_OSPEED_HIGH(GPIOA_JTAG_TDI)) #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ @@ -342,22 +364,22 @@ PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_400K(GPIOB_PIN0) | \ - PIN_OSPEED_400K(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_BOOT1) | \ - PIN_OSPEED_40M(GPIOB_JTAG_TDO) | \ - PIN_OSPEED_40M(GPIOB_JTAG_TRST) | \ - PIN_OSPEED_400K(GPIOB_PIN5) | \ - PIN_OSPEED_40M(GPIOB_LED4) | \ - PIN_OSPEED_40M(GPIOB_LED3) | \ - PIN_OSPEED_400K(GPIOB_PIN8) | \ - PIN_OSPEED_400K(GPIOB_PIN9) | \ - PIN_OSPEED_400K(GPIOB_PIN10) | \ - PIN_OSPEED_400K(GPIOB_PIN11) | \ - PIN_OSPEED_400K(GPIOB_PIN12) | \ - PIN_OSPEED_400K(GPIOB_PIN13) | \ - PIN_OSPEED_400K(GPIOB_PIN14) | \ - PIN_OSPEED_400K(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_BOOT1) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TDO) | \ + PIN_OSPEED_HIGH(GPIOB_JTAG_TRST) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_LED4) | \ + PIN_OSPEED_HIGH(GPIOB_LED3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \ @@ -459,22 +481,22 @@ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_400K(GPIOC_PIN0) | \ - PIN_OSPEED_400K(GPIOC_PIN1) | \ - PIN_OSPEED_400K(GPIOC_PIN2) | \ - PIN_OSPEED_400K(GPIOC_PIN3) | \ - PIN_OSPEED_400K(GPIOC_PIN4) | \ - PIN_OSPEED_400K(GPIOC_PIN5) | \ - PIN_OSPEED_400K(GPIOC_PIN6) | \ - PIN_OSPEED_400K(GPIOC_PIN7) | \ - PIN_OSPEED_400K(GPIOC_PIN8) | \ - PIN_OSPEED_400K(GPIOC_PIN9) | \ - PIN_OSPEED_400K(GPIOC_PIN10) | \ - PIN_OSPEED_400K(GPIOC_PIN11) | \ - PIN_OSPEED_400K(GPIOC_PIN12) | \ - PIN_OSPEED_400K(GPIOC_PIN13) | \ - PIN_OSPEED_40M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_40M(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ @@ -576,22 +598,22 @@ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_400K(GPIOD_PIN0) | \ - PIN_OSPEED_400K(GPIOD_PIN1) | \ - PIN_OSPEED_400K(GPIOD_PIN2) | \ - PIN_OSPEED_400K(GPIOD_PIN3) | \ - PIN_OSPEED_400K(GPIOD_PIN4) | \ - PIN_OSPEED_400K(GPIOD_PIN5) | \ - PIN_OSPEED_400K(GPIOD_PIN6) | \ - PIN_OSPEED_400K(GPIOD_PIN7) | \ - PIN_OSPEED_400K(GPIOD_PIN8) | \ - PIN_OSPEED_400K(GPIOD_PIN9) | \ - PIN_OSPEED_400K(GPIOD_PIN10) | \ - PIN_OSPEED_400K(GPIOD_PIN11) | \ - PIN_OSPEED_400K(GPIOD_PIN12) | \ - PIN_OSPEED_400K(GPIOD_PIN13) | \ - PIN_OSPEED_400K(GPIOD_PIN14) | \ - PIN_OSPEED_400K(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ @@ -693,22 +715,22 @@ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_400K(GPIOE_PIN0) | \ - PIN_OSPEED_400K(GPIOE_PIN1) | \ - PIN_OSPEED_400K(GPIOE_PIN2) | \ - PIN_OSPEED_400K(GPIOE_PIN3) | \ - PIN_OSPEED_400K(GPIOE_PIN4) | \ - PIN_OSPEED_400K(GPIOE_PIN5) | \ - PIN_OSPEED_400K(GPIOE_PIN6) | \ - PIN_OSPEED_400K(GPIOE_PIN7) | \ - PIN_OSPEED_400K(GPIOE_PIN8) | \ - PIN_OSPEED_400K(GPIOE_PIN9) | \ - PIN_OSPEED_400K(GPIOE_PIN10) | \ - PIN_OSPEED_400K(GPIOE_PIN11) | \ - PIN_OSPEED_400K(GPIOE_PIN12) | \ - PIN_OSPEED_400K(GPIOE_PIN13) | \ - PIN_OSPEED_400K(GPIOE_PIN14) | \ - PIN_OSPEED_400K(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ @@ -810,22 +832,22 @@ PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_40M(GPIOH_OSC_IN) | \ - PIN_OSPEED_40M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_400K(GPIOH_PIN2) | \ - PIN_OSPEED_400K(GPIOH_PIN3) | \ - PIN_OSPEED_400K(GPIOH_PIN4) | \ - PIN_OSPEED_400K(GPIOH_PIN5) | \ - PIN_OSPEED_400K(GPIOH_PIN6) | \ - PIN_OSPEED_400K(GPIOH_PIN7) | \ - PIN_OSPEED_400K(GPIOH_PIN8) | \ - PIN_OSPEED_400K(GPIOH_PIN9) | \ - PIN_OSPEED_400K(GPIOH_PIN10) | \ - PIN_OSPEED_400K(GPIOH_PIN11) | \ - PIN_OSPEED_400K(GPIOH_PIN12) | \ - PIN_OSPEED_400K(GPIOH_PIN13) | \ - PIN_OSPEED_400K(GPIOH_PIN14) | \ - PIN_OSPEED_400K(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \ + PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ -- cgit v1.2.3