Loading...
Searching...
No Matches
periph_conf.h File Reference

Peripheral MCU configuration for the STM32F769I-DISCO board. More...

Detailed Description

Peripheral MCU configuration for the STM32F769I-DISCO board.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m
Luis A. Ruiz luisa.nosp@m.n00@.nosp@m.hotma.nosp@m.il.c.nosp@m.om

Definition in file periph_conf.h.

#include "periph_cpu.h"
#include "clk_conf.h"
#include "cfg_rtt_default.h"
#include "cfg_timer_tim2.h"
#include "mii.h"
#include "usbdev_synopsys_dwc2.h"
+ Include dependency graph for periph_conf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define CONFIG_BOARD_HAS_LSE   1
 
#define CONFIG_BOARD_HAS_HSE   1
 
#define CONFIG_CLOCK_HSE   MHZ(25)
 

DMA streams configuration

#define DMA_0_ISR   isr_dma2_stream7
 
#define DMA_1_ISR   isr_dma1_stream7
 
#define DMA_2_ISR   isr_dma2_stream6
 
#define DMA_3_ISR   isr_dma2_stream0
 
#define DMA_4_ISR   isr_dma1_stream3
 
#define DMA_5_ISR   isr_dma1_stream4
 
#define DMA_6_ISR   isr_dma2_stream5
 
#define DMA_NUMOF   ARRAY_SIZE(dma_config)
 
static const dma_conf_t dma_config []
 

I2C configuration

Device Bus SCL SDA Usage
I2C_DEV(0) I2C1 PB8 (Arduino D15) PB9 (Arduino D14) Arduino connector
I2C_DEV(1) I2C4 PD12 PB7 Touch panel, audio codec

I2C4 connects the FT6x06 touch panel controller (INT on PI13) and the WM8994 audio codec (address 0x1a).

#define I2C_0_ISR   isr_i2c1_er
 
#define I2C_1_ISR   isr_i2c4_er
 
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 

UART configuration

Device UART RX TX Usage
UART_DEV(0) USART1 PA10 PA9 ST-LINK virtual COM port
UART_DEV(1) UART5 PD2 PC12 Wi-Fi connector CN2
UART_DEV(2) USART6 PC7 (Arduino D0) PC6 (Arduino D1) Arduino connector CN13
#define UART_0_ISR   (isr_usart1)
 
#define UART_1_ISR   (isr_uart5)
 
#define UART_2_ISR   (isr_usart6)
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

SPI configuration

Device Bus SCK MISO MOSI
SPI_DEV(0) SPI2 PA12 (Arduino D13) PB14 (Arduino D12) PB15 (Arduino D11)

The Arduino D10 pin (PA11) is the usual chip select GPIO. Note that SCK is shared with the LED LD3, which therefore flickers during SPI transfers.

#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
static const spi_conf_t spi_config []
 

ADC configuration

ADC lines for the Arduino connector pins A0-A5, plus the internal VBAT channel.

Line Pin Channel
ADC_LINE(0) PA6 ADC1_IN6
ADC_LINE(1) PA4 ADC1_IN4
ADC_LINE(2) PC2 ADC1_IN12
ADC_LINE(3) PF10 ADC3_IN8
ADC_LINE(4) PF8 ADC3_IN6
ADC_LINE(5) PF9 ADC3_IN7
ADC_LINE(6) - VBAT
#define VBAT_ADC   ADC_LINE(6)
 VBAT ADC line.
 
#define ADC_CLK_MAX   MHZ(36)
 Max ADC clock (36 MHz for the F7)
 
#define ADC_NUMOF   ARRAY_SIZE(adc_config)
 
static const adc_conf_t adc_config []
 

DAC configuration

DAC channel 1 (DAC_OUT1) is available on PA4, the Arduino A1 pin.

#define DAC_NUMOF   ARRAY_SIZE(dac_config)
 
static const dac_conf_t dac_config []
 

FMC configuration

#define FMC_BANK_NUMOF   ARRAY_SIZE(fmc_bank_config)
 Number of configured FMC banks.
 
static const fmc_conf_t fmc_config
 FMC controller configuration.
 
static const fmc_bank_conf_t fmc_bank_config []
 FMC Bank configuration.
 

PWM configuration

Device Timer Channel Pin Arduino
PWM_DEV(0) TIM10 0 PF6 CN13 D3
PWM_DEV(1) TIM3 0 PC8 CN13 D5
PWM_DEV(2) TIM11 0 PF7 CN13 D6
PWM_DEV(3) TIM12 0 PH6 CN9 D9
PWM_DEV(3) TIM12 1 PB15 CN9 D11
PWM_DEV(4) TIM1 0 PA11 CN9 D10
#define PWM_NUMOF   ARRAY_SIZE(pwm_config)
 
static const pwm_conf_t pwm_config []
 

SDIO/SDMMC configuration

The on-board microSD card slot (CN5) is connected to SDMMC2, with the card detect signal on PI15 (active low)

#define SDMMC_CONFIG_NUMOF   1
 Number of configured SDIO/SDMMC peripherals.
 
static const sdmmc_conf_t sdmmc_config []
 SDIO/SDMMC static configuration struct.
 

USB OTG HS configuration with ULPI PHY

The only user USB port of the board (CN15) is connected to the USB OTG HS peripheral through an external ULPI PHY.

#define DWC2_USB_OTG_HS_ENABLED
 Enable the high speed USB OTG peripheral.
 
#define USBDEV_NUMOF   ARRAY_SIZE(dwc2_usb_otg_fshs_config)
 Number of available USB OTG peripherals.
 
static const dwc2_usb_otg_fshs_config_t dwc2_usb_otg_fshs_config []
 USB OTG HS configuration with ULPI PHY.
 

Ethernet configuration

RMII interface to the on-board LAN8742A PHY at address 0.

static const eth_conf_t eth_config
 

Macro Definition Documentation

◆ ADC_CLK_MAX

#define ADC_CLK_MAX   MHZ(36)

Max ADC clock (36 MHz for the F7)

Definition at line 240 of file periph_conf.h.

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Definition at line 241 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_HSE

#define CONFIG_BOARD_HAS_HSE   1

Definition at line 26 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_LSE

#define CONFIG_BOARD_HAS_LSE   1

Definition at line 21 of file periph_conf.h.

◆ CONFIG_CLOCK_HSE

#define CONFIG_CLOCK_HSE   MHZ(25)

Definition at line 31 of file periph_conf.h.

◆ DAC_NUMOF

#define DAC_NUMOF   ARRAY_SIZE(dac_config)

Definition at line 254 of file periph_conf.h.

◆ DMA_0_ISR

#define DMA_0_ISR   isr_dma2_stream7

Definition at line 62 of file periph_conf.h.

◆ DMA_1_ISR

#define DMA_1_ISR   isr_dma1_stream7

Definition at line 63 of file periph_conf.h.

◆ DMA_2_ISR

#define DMA_2_ISR   isr_dma2_stream6

Definition at line 64 of file periph_conf.h.

◆ DMA_3_ISR

#define DMA_3_ISR   isr_dma2_stream0

Definition at line 65 of file periph_conf.h.

◆ DMA_4_ISR

#define DMA_4_ISR   isr_dma1_stream3

Definition at line 66 of file periph_conf.h.

◆ DMA_5_ISR

#define DMA_5_ISR   isr_dma1_stream4

Definition at line 67 of file periph_conf.h.

◆ DMA_6_ISR

#define DMA_6_ISR   isr_dma2_stream5

Definition at line 68 of file periph_conf.h.

◆ DMA_NUMOF

#define DMA_NUMOF   ARRAY_SIZE(dma_config)

Definition at line 70 of file periph_conf.h.

◆ DWC2_USB_OTG_HS_ENABLED

#define DWC2_USB_OTG_HS_ENABLED

Enable the high speed USB OTG peripheral.

Definition at line 537 of file periph_conf.h.

◆ FMC_BANK_NUMOF

#define FMC_BANK_NUMOF   ARRAY_SIZE(fmc_bank_config)

Number of configured FMC banks.

Definition at line 405 of file periph_conf.h.

◆ I2C_0_ISR

#define I2C_0_ISR   isr_i2c1_er

Definition at line 111 of file periph_conf.h.

◆ I2C_1_ISR

#define I2C_1_ISR   isr_i2c4_er

Definition at line 112 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 113 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 483 of file periph_conf.h.

◆ SDMMC_CONFIG_NUMOF

#define SDMMC_CONFIG_NUMOF   1

Number of configured SDIO/SDMMC peripherals.

Definition at line 522 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 209 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   (isr_usart1)

Definition at line 171 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   (isr_uart5)

Definition at line 172 of file periph_conf.h.

◆ UART_2_ISR

#define UART_2_ISR   (isr_usart6)

Definition at line 173 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 174 of file periph_conf.h.

◆ USBDEV_NUMOF

#define USBDEV_NUMOF   ARRAY_SIZE(dwc2_usb_otg_fshs_config)

Number of available USB OTG peripherals.

Definition at line 569 of file periph_conf.h.

◆ VBAT_ADC

#define VBAT_ADC   ADC_LINE(6)

VBAT ADC line.

Definition at line 239 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
{ GPIO_PIN(PORT_A, 6), 0, 6 },
{ GPIO_PIN(PORT_A, 4), 0, 4 },
{ GPIO_PIN(PORT_C, 2), 0, 12 },
{ GPIO_PIN(PORT_F, 10), 2, 8 },
{ GPIO_PIN(PORT_F, 8), 2, 6 },
{ GPIO_PIN(PORT_F, 9), 2, 7 },
{ GPIO_UNDEF, 0, 18 },
}
@ PORT_C
port C
Definition periph_cpu.h:45
@ PORT_F
port F
Definition periph_cpu.h:48
@ PORT_A
port A
Definition periph_cpu.h:43
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:42
#define GPIO_UNDEF
Definition of a fitting UNDEF value.

Definition at line 229 of file periph_conf.h.

◆ dac_config

const dac_conf_t dac_config[]
static
Initial value:
= {
{ GPIO_PIN(PORT_A, 4), .chan = 0 },
}

Definition at line 250 of file periph_conf.h.

◆ dma_config

const dma_conf_t dma_config[]
static
Initial value:
= {
{ .stream = 15 },
{ .stream = 7 },
{ .stream = 14 },
{ .stream = 8 },
{ .stream = 3 },
{ .stream = 4 },
{ .stream = 13 },
}

Definition at line 52 of file periph_conf.h.

◆ dwc2_usb_otg_fshs_config

const dwc2_usb_otg_fshs_config_t dwc2_usb_otg_fshs_config[]
static
Initial value:
= {
{
.periph = USB_OTG_HS_PERIPH_BASE,
.type = DWC2_USB_OTG_HS,
.rcc_mask = RCC_AHB1ENR_OTGHSEN,
.irqn = OTG_HS_IRQn,
.ahb = AHB1,
.ulpi_af = GPIO_AF10,
.ulpi_clk = GPIO_PIN(PORT_A, 5),
.ulpi_d0 = GPIO_PIN(PORT_A, 3),
.ulpi_d1 = GPIO_PIN(PORT_B, 0),
.ulpi_d2 = GPIO_PIN(PORT_B, 1),
.ulpi_d3 = GPIO_PIN(PORT_B, 10),
.ulpi_d4 = GPIO_PIN(PORT_B, 11),
.ulpi_d5 = GPIO_PIN(PORT_B, 12),
.ulpi_d6 = GPIO_PIN(PORT_B, 13),
.ulpi_d7 = GPIO_PIN(PORT_B, 5),
.ulpi_dir = GPIO_PIN(PORT_I, 11),
.ulpi_stp = GPIO_PIN(PORT_C, 0),
.ulpi_nxt = GPIO_PIN(PORT_H, 4),
}
}
@ PORT_B
port B
Definition periph_cpu.h:44
@ PORT_H
port H
Definition periph_cpu.h:48
@ GPIO_AF10
use alternate function 10
Definition cpu_gpio.h:109
@ DWC2_USB_OTG_PHY_ULPI
ULPI for external HS PHY.
@ DWC2_USB_OTG_HS
High speed peripheral.

USB OTG HS configuration with ULPI PHY.

Definition at line 542 of file periph_conf.h.

◆ eth_config

const eth_conf_t eth_config
static
Initial value:
= {
.mode = RMII,
.dma = 3,
.dma_chan = 8,
.phy_addr = 0x00,
.pins = {
}
}
@ PORT_G
port G
Definition periph_cpu.h:49
@ RMII
Configuration for RMII.
Definition cpu_eth.h:33
#define MII_BMCR_FULL_DPLX
Set for full duplex.
Definition mii.h:65
#define MII_BMCR_SPEED_100
Set speed to 100 Mbps.
Definition mii.h:69

Definition at line 263 of file periph_conf.h.

◆ fmc_bank_config

const fmc_bank_conf_t fmc_bank_config[]
static

FMC Bank configuration.

The board has a 128-Mbit SDRAM: MT48LC4M32B2B5-6A, or IS42S32400F-6BL from MB1225 revision B03 on. It is organized in 4 banks of 1M x 32 bits each and connected to bank 5 at address 0xc0000000. The CAS latency and timings are the ones used by ST's board support package (BSP) for this board.

Definition at line 368 of file periph_conf.h.

◆ fmc_config

const fmc_conf_t fmc_config
static

FMC controller configuration.

Definition at line 290 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = I2C1,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 8),
.sda_pin = GPIO_PIN(PORT_B, 9),
.scl_af = GPIO_AF4,
.sda_af = GPIO_AF4,
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C1EN,
.rcc_sw_mask = RCC_DCKCFGR2_I2C1SEL_1,
.irqn = I2C1_ER_IRQn,
},
{
.dev = I2C4,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_D, 12),
.sda_pin = GPIO_PIN(PORT_B, 7),
.scl_af = GPIO_AF4,
.sda_af = GPIO_AF11,
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C4EN,
.rcc_sw_mask = RCC_DCKCFGR2_I2C4SEL_1,
.irqn = I2C4_ER_IRQn,
},
}
@ PORT_D
port D
Definition periph_cpu.h:46
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:274
@ GPIO_AF4
use alternate function 4
Definition cpu_gpio.h:102
@ GPIO_AF11
use alternate function 11
Definition cpu_gpio.h:110
@ APB1
Advanced Peripheral Bus 1.
Definition periph_cpu.h:75

Definition at line 85 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static

Definition at line 421 of file periph_conf.h.

◆ sdmmc_config

const sdmmc_conf_t sdmmc_config[]
static
Initial value:
= {
{
.dev = SDMMC2,
.bus = APB2,
.rcc_mask = RCC_APB2ENR_SDMMC2EN,
.cd = GPIO_PIN(PORT_I, 15),
.cd_active = 0,
.cd_mode = GPIO_IN_PU,
.clk = { GPIO_PIN(PORT_D, 6), GPIO_AF11 },
.cmd = { GPIO_PIN(PORT_D, 7), GPIO_AF11 },
.dat0 = { GPIO_PIN(PORT_G, 9), GPIO_AF11 },
.dat1 = { GPIO_PIN(PORT_G, 10), GPIO_AF11 },
.dat2 = { GPIO_PIN(PORT_B, 3), GPIO_AF10 },
.dat3 = { GPIO_PIN(PORT_B, 4), GPIO_AF10 },
.irqn = SDMMC2_IRQn,
},
}
@ APB2
Advanced Peripheral Bus 2.
Definition periph_cpu.h:76

SDIO/SDMMC static configuration struct.

Definition at line 497 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.dev = SPI2,
.mosi_pin = GPIO_PIN(PORT_B, 15),
.miso_pin = GPIO_PIN(PORT_B, 14),
.sclk_pin = GPIO_PIN(PORT_A, 12),
.cs_pin = SPI_CS_UNDEF,
.mosi_af = GPIO_AF5,
.miso_af = GPIO_AF5,
.sclk_af = GPIO_AF5,
.cs_af = GPIO_AF5,
.rccmask = RCC_APB1ENR_SPI2EN,
.apbbus = APB1,
},
}
@ GPIO_AF5
use alternate function 5
Definition cpu_gpio.h:103
#define SPI_CS_UNDEF
Define value for unused CS line.
Definition periph_cpu.h:359

Definition at line 188 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static

Definition at line 126 of file periph_conf.h.