.suc_uart = USART3, .suc_rcc_reg = &RCC->APB1ENR, .suc_rcc_dev = RCC_APB1ENR_USART3EN, .suc_pin_tx = MCU_GPIO_PORTD(8), /* PD8 */ .suc_pin_rx = MCU_GPIO_PORTD(9), /* PD9 */ .suc_pin_rts = -1, .suc_pin_cts = -1, .suc_pin_af = GPIO_AF7_USART3, .suc_irqn = USART3_IRQn, } }; #endif #if MYNEWT_VAL(SPI_0_SLAVE) || MYNEWT_VAL(SPI_0_MASTER) struct stm32_hal_spi_cfg spi0_cfg = { .sck_pin = MCU_GPIO_PORTA(5), /* D13 on CN7 */ .miso_pin = MCU_GPIO_PORTA(6), /* D12 on CN7 */ .mosi_pin = MCU_GPIO_PORTA(7), /* D11 on CN7 */ .ss_pin = MCU_GPIO_PORTD(14), /* D10 on CN7 */ .irq_prio = 2, }; #endif #if MYNEWT_VAL(I2C_0) /* * The PB8 and PB9 pins are connected through jumpers in the board to * both ADC_IN and I2C pins. To enable I2C functionality SB147/SB157 need * to be removed (they are the default connections) and SB138/SB143 need * to be shorted. */ static struct stm32_hal_i2c_cfg i2c_cfg0 = {
* and is handled outside the SPI routines. */ static const struct stm32_hal_spi_cfg os_bsp_spi0m_cfg = { .sck_pin = MCU_GPIO_PORTB(3), .mosi_pin = MCU_GPIO_PORTB(5), .miso_pin = MCU_GPIO_PORTB(4), .irq_prio = 2, }; #endif #if MYNEWT_VAL(SPI_0_SLAVE) static const struct stm32_hal_spi_cfg os_bsp_spi0s_cfg = { .sck_pin = MCU_GPIO_PORTB(3), .mosi_pin = MCU_GPIO_PORTB(5), .miso_pin = MCU_GPIO_PORTB(4), .ss_pin = MCU_GPIO_PORTA(4), .irq_prio = 2, }; #endif static const struct hal_bsp_mem_dump dump_cfg[] = { [0] = { .hbmd_start = &_ram_start, .hbmd_size = RAM_SIZE }, [1] = { .hbmd_start = &_ccram_start, .hbmd_size = CCRAM_SIZE } };
#if MYNEWT_VAL(I2C_0) static struct stm32f4_hal_i2c_cfg i2c_cfg0 = { .hic_i2c = I2C1, .hic_rcc_reg = &RCC->APB1ENR, .hic_rcc_dev = RCC_APB1ENR_I2C1EN, .hic_pin_sda = MCU_GPIO_PORTB(9), /* PB9 */ .hic_pin_scl = MCU_GPIO_PORTB(8), /* PB8 */ .hic_pin_af = GPIO_AF4_I2C1, .hic_10bit = 0, .hic_speed = 100000 /* 100kHz */ }; #endif #if MYNEWT_VAL(SPI_0_SLAVE) || MYNEWT_VAL(SPI_0_MASTER) struct stm32f4_hal_spi_cfg spi0_cfg = { .ss_pin = MCU_GPIO_PORTA(4), /* PA4 */ .sck_pin = MCU_GPIO_PORTA(5), /* PA5 */ .miso_pin = MCU_GPIO_PORTA(6), /* PA6 */ .mosi_pin = MCU_GPIO_PORTB(5), /* PB5 */ .irq_prio = 2 }; #endif #if MYNEWT_VAL(UART_0) static const struct stm32f4_uart_cfg uart_cfg0 = { .suc_uart = USART6, .suc_rcc_reg = &RCC->APB2ENR, .suc_rcc_dev = RCC_APB2ENR_USART6EN, .suc_pin_tx = MCU_GPIO_PORTC(6), /* PC6 */ .suc_pin_rx = MCU_GPIO_PORTC(7), /* PC7 */ .suc_pin_rts = -1, .suc_pin_cts = -1,