2019-08-19 17:16:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* boards/arm/stm32h7/nucleo-h743zi/include/board.h
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
2021-08-16 10:36:24 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
2021-08-16 10:36:24 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
2021-08-16 10:36:24 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
2019-08-19 17:16:08 +02:00
|
|
|
****************************************************************************/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
#ifndef __BOARDS_ARM_STM32H7_NUCLEO_H743ZI_INCLUDE_BOARD_H
|
|
|
|
#define __BOARDS_ARM_STM32H7_NUCLEO_H743ZI_INCLUDE_BOARD_H
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/****************************************************************************
|
2018-06-17 00:59:34 +02:00
|
|
|
* Included Files
|
2019-08-19 17:16:08 +02:00
|
|
|
****************************************************************************/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
2019-09-29 17:31:47 +02:00
|
|
|
/* Do not include STM32 H7 header files here */
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/****************************************************************************
|
2018-06-17 00:59:34 +02:00
|
|
|
* Pre-processor Definitions
|
2019-08-19 17:16:08 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Clocking *****************************************************************/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
/* The Nucleo-144 board provides the following clock sources:
|
|
|
|
*
|
2019-03-03 13:22:37 +01:00
|
|
|
* MCO: 8 MHz from MCO output of ST-LINK is used as input clock (default)
|
2018-06-17 00:59:34 +02:00
|
|
|
* X2: 32.768 KHz crystal for LSE
|
|
|
|
* X3: HSE crystal oscillator (not provided)
|
|
|
|
*
|
|
|
|
* So we have these clock source available within the STM32
|
|
|
|
*
|
|
|
|
* HSI: 16 MHz RC factory-trimmed
|
|
|
|
* LSI: 32 KHz RC
|
|
|
|
* HSE: 8 MHz from MCO output of ST-LINK
|
|
|
|
* LSE: 32.768 kHz
|
|
|
|
*/
|
|
|
|
|
2019-03-03 13:22:37 +01:00
|
|
|
#define STM32_BOARD_XTAL 8000000ul /* ST-LINK MCO */
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#define STM32_HSI_FREQUENCY 16000000ul
|
|
|
|
#define STM32_LSI_FREQUENCY 32000
|
|
|
|
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
|
|
|
|
#define STM32_LSE_FREQUENCY 32768
|
|
|
|
|
|
|
|
/* Main PLL Configuration.
|
|
|
|
*
|
|
|
|
* PLL source is HSE = 8,000,000
|
|
|
|
*
|
|
|
|
* To use HSE, configure the solder bridges on the board:
|
|
|
|
*
|
|
|
|
* - SB148, SB8 and SB9 OFF
|
|
|
|
* - SB112 and SB149 ON
|
|
|
|
*
|
2021-04-06 12:13:09 +02:00
|
|
|
* When STM32_HSE_FREQUENCY / PLLM <= 2MHz VCOL must be selected.
|
|
|
|
* VCOH otherwise.
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
|
|
|
* PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
|
|
|
|
* Subject to:
|
|
|
|
*
|
|
|
|
* 1 <= PLLM <= 63
|
|
|
|
* 4 <= PLLN <= 512
|
|
|
|
* 150 MHz <= PLL_VCOL <= 420MHz
|
|
|
|
* 192 MHz <= PLL_VCOH <= 836MHz
|
|
|
|
*
|
|
|
|
* SYSCLK = PLL_VCO / PLLP
|
|
|
|
* CPUCLK = SYSCLK / D1CPRE
|
|
|
|
* Subject to
|
|
|
|
*
|
|
|
|
* PLLP1 = {2, 4, 6, 8, ..., 128}
|
|
|
|
* PLLP2,3 = {2, 3, 4, ..., 128}
|
|
|
|
* CPUCLK <= 400 MHz
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define STM32_BOARD_USEHSE
|
|
|
|
#define STM32_HSEBYP_ENABLE
|
|
|
|
|
|
|
|
#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR
|
|
|
|
*
|
|
|
|
* PLL1_VCO = (8,000,000 / 2) * 200 = 800 MHz
|
|
|
|
*
|
2019-03-10 14:24:58 +01:00
|
|
|
* PLL1P = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz
|
|
|
|
* PLL1Q = PLL1_VCO/4 = 800 MHz / 4 = 200 MHz
|
|
|
|
* PLL1R = PLL1_VCO/8 = 800 MHz / 8 = 100 MHz
|
2018-10-28 13:43:08 +01:00
|
|
|
*/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
|
|
|
|
RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \
|
2018-10-28 13:43:08 +01:00
|
|
|
RCC_PLLCFGR_DIVP1EN | \
|
|
|
|
RCC_PLLCFGR_DIVQ1EN | \
|
|
|
|
RCC_PLLCFGR_DIVR1EN)
|
2018-06-17 00:59:34 +02:00
|
|
|
#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2)
|
|
|
|
#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(200)
|
|
|
|
#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2)
|
|
|
|
#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4)
|
|
|
|
#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8)
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 200)
|
|
|
|
#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2)
|
|
|
|
#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4)
|
|
|
|
#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8)
|
|
|
|
|
2018-07-08 20:28:14 +02:00
|
|
|
/* PLL2 */
|
|
|
|
|
2019-06-13 21:51:12 +02:00
|
|
|
#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
|
|
|
|
RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \
|
|
|
|
RCC_PLLCFGR_DIVP2EN)
|
|
|
|
#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2)
|
|
|
|
#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(200)
|
|
|
|
#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(40)
|
|
|
|
#define STM32_PLLCFG_PLL2Q 0
|
|
|
|
#define STM32_PLLCFG_PLL2R 0
|
|
|
|
|
|
|
|
#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 200)
|
|
|
|
#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_PLL2Q_FREQUENCY
|
|
|
|
#define STM32_PLL2R_FREQUENCY
|
2018-07-08 20:28:14 +02:00
|
|
|
|
|
|
|
/* PLL3 */
|
|
|
|
|
|
|
|
#define STM32_PLLCFG_PLL3CFG 0
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_PLLCFG_PLL3M 0
|
|
|
|
#define STM32_PLLCFG_PLL3N 0
|
|
|
|
#define STM32_PLLCFG_PLL3P 0
|
|
|
|
#define STM32_PLLCFG_PLL3Q 0
|
|
|
|
#define STM32_PLLCFG_PLL3R 0
|
|
|
|
|
|
|
|
#define STM32_VCO3_FREQUENCY
|
|
|
|
#define STM32_PLL3P_FREQUENCY
|
|
|
|
#define STM32_PLL3Q_FREQUENCY
|
|
|
|
#define STM32_PLL3R_FREQUENCY
|
|
|
|
|
2018-10-28 13:55:20 +01:00
|
|
|
/* SYSCLK = PLL1P = 400 MHz
|
2018-10-28 13:43:08 +01:00
|
|
|
* CPUCLK = SYSCLK / 1 = 400 MHz
|
|
|
|
*/
|
|
|
|
|
2019-03-03 13:22:37 +01:00
|
|
|
#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK)
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY)
|
2018-06-17 00:59:34 +02:00
|
|
|
#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1)
|
|
|
|
|
|
|
|
/* Configure Clock Assignments */
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* AHB clock (HCLK) is SYSCLK/2 (200 MHz max)
|
|
|
|
* HCLK1 = HCLK2 = HCLK3 = HCLK4
|
2018-06-17 00:59:34 +02:00
|
|
|
*/
|
|
|
|
|
2018-07-08 20:28:14 +02:00
|
|
|
#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */
|
2018-06-17 00:59:34 +02:00
|
|
|
#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */
|
|
|
|
#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2018-07-08 20:28:14 +02:00
|
|
|
#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */
|
|
|
|
#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4)
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* APB2 clock (PCLK2) is HCLK/4 (54 MHz) */
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd4 /* PCLK2 = HCLK / 4 */
|
2018-07-08 20:28:14 +02:00
|
|
|
#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/4)
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* APB3 clock (PCLK3) is HCLK/4 (54 MHz) */
|
|
|
|
|
|
|
|
#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd4 /* PCLK3 = HCLK / 4 */
|
|
|
|
#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/4)
|
|
|
|
|
|
|
|
/* APB4 clock (PCLK4) is HCLK/4 (54 MHz) */
|
2018-07-08 20:28:14 +02:00
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd4 /* PCLK4 = HCLK / 4 */
|
2018-07-08 20:28:14 +02:00
|
|
|
#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/4)
|
2018-06-17 00:59:34 +02:00
|
|
|
|
2019-05-05 23:37:04 +02:00
|
|
|
/* Timer clock frequencies */
|
|
|
|
|
|
|
|
/* Timers driven from APB1 will be twice PCLK1 */
|
|
|
|
|
|
|
|
#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
|
|
|
|
|
|
|
/* Timers driven from APB2 will be twice PCLK2 */
|
|
|
|
|
|
|
|
#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
|
|
|
#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
|
|
|
#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
|
|
|
#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
|
|
|
#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* Kernel Clock Configuration
|
|
|
|
*
|
|
|
|
* Note: look at Table 54 in ST Manual
|
|
|
|
*/
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* I2C123 clock source - HSI */
|
2018-09-16 17:58:25 +02:00
|
|
|
|
|
|
|
#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI
|
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* I2C4 clock source - HSI */
|
|
|
|
|
2019-08-02 15:09:52 +02:00
|
|
|
#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2019-03-10 14:24:58 +01:00
|
|
|
/* SPI123 clock source - PLL1Q */
|
2018-10-28 13:43:08 +01:00
|
|
|
|
|
|
|
#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL1
|
|
|
|
|
|
|
|
/* SPI45 clock source - APB (PCLK2?) */
|
|
|
|
|
|
|
|
#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_APB
|
|
|
|
|
|
|
|
/* SPI6 clock source - APB (PCLK4) */
|
|
|
|
|
2019-08-02 15:09:52 +02:00
|
|
|
#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PCLK4
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2019-03-10 14:24:58 +01:00
|
|
|
/* USB 1 and 2 clock source - HSI48 */
|
|
|
|
|
2019-06-13 21:51:12 +02:00
|
|
|
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_HSI48
|
|
|
|
|
|
|
|
/* ADC 1 2 3 clock source - pll2_pclk */
|
|
|
|
|
|
|
|
#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
|
2019-03-10 14:24:58 +01:00
|
|
|
|
2018-06-17 00:59:34 +02:00
|
|
|
/* FLASH wait states
|
|
|
|
*
|
|
|
|
* ------------ ---------- -----------
|
|
|
|
* Vcore MAX ACLK WAIT STATES
|
|
|
|
* ------------ ---------- -----------
|
|
|
|
* 1.15-1.26 V 70 MHz 0
|
|
|
|
* (VOS1 level) 140 MHz 1
|
|
|
|
* 210 MHz 2
|
|
|
|
* 1.05-1.15 V 55 MHz 0
|
|
|
|
* (VOS2 level) 110 MHz 1
|
|
|
|
* 165 MHz 2
|
|
|
|
* 220 MHz 3
|
|
|
|
* 0.95-1.05 V 45 MHz 0
|
|
|
|
* (VOS3 level) 90 MHz 1
|
|
|
|
* 135 MHz 2
|
|
|
|
* 180 MHz 3
|
|
|
|
* 225 MHz 4
|
|
|
|
* ------------ ---------- -----------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BOARD_FLASH_WAITSTATES 4
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* SDMMC definitions ********************************************************/
|
2019-04-30 15:11:25 +02:00
|
|
|
|
|
|
|
/* Init 400kHz, PLL1Q/(2*250) */
|
|
|
|
|
|
|
|
#define STM32_SDMMC_INIT_CLKDIV (250 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
|
|
|
|
2021-04-06 12:13:09 +02:00
|
|
|
/* Just set these to 25 MHz for now,
|
|
|
|
* PLL1Q/(2*4), for default speed 12.5MB/s
|
|
|
|
*/
|
2019-04-30 15:11:25 +02:00
|
|
|
|
|
|
|
#define STM32_SDMMC_MMCXFR_CLKDIV (4 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
|
|
|
#define STM32_SDMMC_SDXFR_CLKDIV (4 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
|
|
|
|
|
|
|
#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* Ethernet definitions *****************************************************/
|
2019-04-30 16:43:39 +02:00
|
|
|
|
|
|
|
#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 /* PG13 */
|
|
|
|
#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1 /* PB 13 */
|
|
|
|
#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_2
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* LED definitions **********************************************************/
|
|
|
|
|
2021-04-06 12:13:09 +02:00
|
|
|
/* The Nucleo-144 board has numerous LEDs but only three, LD1 a Green LED,
|
|
|
|
* LD2 a Blue LED and LD3 a Red LED, that can be controlled by software.
|
|
|
|
* The following definitions assume the default Solder Bridges are installed.
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
2021-04-06 12:13:09 +02:00
|
|
|
* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
|
|
|
|
* any way.
|
2018-06-17 00:59:34 +02:00
|
|
|
* The following definitions are used to access individual LEDs.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* LED index values for use with board_userled() */
|
|
|
|
|
|
|
|
#define BOARD_LED1 0
|
|
|
|
#define BOARD_LED2 1
|
|
|
|
#define BOARD_LED3 2
|
|
|
|
#define BOARD_NLEDS 3
|
|
|
|
|
|
|
|
#define BOARD_LED_GREEN BOARD_LED1
|
|
|
|
#define BOARD_LED_BLUE BOARD_LED2
|
|
|
|
#define BOARD_LED_RED BOARD_LED3
|
|
|
|
|
|
|
|
/* LED bits for use with board_userled_all() */
|
|
|
|
|
|
|
|
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
|
|
|
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
|
|
|
#define BOARD_LED3_BIT (1 << BOARD_LED3)
|
|
|
|
|
|
|
|
/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in
|
2021-04-06 12:13:09 +02:00
|
|
|
* include/board.h and src/stm32_leds.c.
|
|
|
|
* The LEDs are used to encode OS-related events as follows:
|
2018-06-17 00:59:34 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* SYMBOL Meaning LED state
|
|
|
|
* Red Green Blue
|
2021-04-06 12:13:09 +02:00
|
|
|
* ---------------------- -------------------------- ------ ------ ---
|
|
|
|
*/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
|
|
|
#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */
|
|
|
|
#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */
|
|
|
|
#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */
|
|
|
|
#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */
|
|
|
|
#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */
|
|
|
|
#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */
|
|
|
|
#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */
|
|
|
|
#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */
|
|
|
|
|
|
|
|
/* Thus if the Green LED is statically on, NuttX has successfully booted and
|
|
|
|
* is, apparently, running normally. If the Red LED is flashing at
|
|
|
|
* approximately 2Hz, then a fatal error has been detected and the system
|
|
|
|
* has halted.
|
|
|
|
*/
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* Button definitions *******************************************************/
|
|
|
|
|
2018-06-17 00:59:34 +02:00
|
|
|
/* The NUCLEO board supports one button: Pushbutton B1, labeled "User", is
|
2019-08-19 17:16:08 +02:00
|
|
|
* connected to GPIO PI11.
|
|
|
|
* A high value will be sensed when the button is depressed.
|
2018-06-17 00:59:34 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define BUTTON_USER 0
|
|
|
|
#define NUM_BUTTONS 1
|
|
|
|
#define BUTTON_USER_BIT (1 << BUTTON_USER)
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* Alternate function pin selections ****************************************/
|
|
|
|
|
2018-06-17 00:59:34 +02:00
|
|
|
/* USART3 (Nucleo Virtual Console) */
|
|
|
|
|
|
|
|
#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */
|
|
|
|
#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */
|
|
|
|
|
2021-04-14 18:28:26 +02:00
|
|
|
#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_0
|
|
|
|
#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_1
|
|
|
|
|
2018-06-17 00:59:34 +02:00
|
|
|
/* USART6 (Arduino Serial Shield) */
|
|
|
|
|
|
|
|
#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */
|
|
|
|
#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */
|
|
|
|
|
2021-04-14 18:28:26 +02:00
|
|
|
#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1
|
|
|
|
#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_0
|
|
|
|
|
2019-04-28 14:36:55 +02:00
|
|
|
/* I2C1 Use Nucleo I2C1 pins */
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2019-04-28 14:36:55 +02:00
|
|
|
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 - D15 */
|
|
|
|
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 - D14 */
|
|
|
|
|
|
|
|
/* I2C2 Use Nucleo I2C2 pins */
|
|
|
|
|
|
|
|
#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 - D69 */
|
|
|
|
#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 - D68 */
|
|
|
|
#define GPIO_I2C2_SMBA GPIO_I2C2_SMBA_2 /* PF2 - D70 */
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2018-10-28 13:43:08 +01:00
|
|
|
/* SPI3 */
|
|
|
|
|
|
|
|
#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 /* PB4 */
|
|
|
|
#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_4 /* PB5 */
|
|
|
|
#define GPIO_SPI3_SCK GPIO_SPI3_SCK_1 /* PB3 */
|
|
|
|
#define GPIO_SPI3_NSS GPIO_SPI3_NSS_2 /* PA4 */
|
2018-09-16 17:58:25 +02:00
|
|
|
|
2019-06-03 13:51:00 +02:00
|
|
|
/* TIM1 */
|
|
|
|
|
|
|
|
#define GPIO_TIM1_CH1OUT GPIO_TIM1_CH1OUT_2 /* PE9 - D6 */
|
|
|
|
#define GPIO_TIM1_CH1NOUT GPIO_TIM1_CH1NOUT_3 /* PE8 - D42 */
|
|
|
|
#define GPIO_TIM1_CH2OUT GPIO_TIM1_CH2OUT_2 /* PE11 - D5 */
|
|
|
|
#define GPIO_TIM1_CH2NOUT GPIO_TIM1_CH2NOUT_3 /* PE10 - D40 */
|
|
|
|
#define GPIO_TIM1_CH3OUT GPIO_TIM1_CH3OUT_2 /* PE13 - D3 */
|
|
|
|
#define GPIO_TIM1_CH3NOUT GPIO_TIM1_CH3NOUT_3 /* PE12 - D39 */
|
|
|
|
#define GPIO_TIM1_CH4OUT GPIO_TIM1_CH4OUT_2 /* PE14 - D38 */
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/* DMA **********************************************************************/
|
2019-03-03 13:22:37 +01:00
|
|
|
|
|
|
|
#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_0 /* DMA1 */
|
|
|
|
#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_0 /* DMA1 */
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/****************************************************************************
|
2018-06-17 00:59:34 +02:00
|
|
|
* Public Data
|
2019-08-19 17:16:08 +02:00
|
|
|
****************************************************************************/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2019-08-19 17:16:08 +02:00
|
|
|
/****************************************************************************
|
2018-06-17 00:59:34 +02:00
|
|
|
* Public Function Prototypes
|
2019-08-19 17:16:08 +02:00
|
|
|
****************************************************************************/
|
2018-06-17 00:59:34 +02:00
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
2020-01-31 19:07:39 +01:00
|
|
|
#endif /* __BOARDS_ARM_STM32H7_NUCLEO_H743ZI_INCLUDE_BOARD_H */
|