Page 1 of 1

SPI Config STM32F4 Embest BB

Posted: Sun Mar 20, 2016 12:51 am
by chelox
Hi!

We need to configurate SPI bus with the following ports:
PB14 ---> CS
PB10 ---> SSCK
PC2-----> MISO
PC3---->MOSI

In the spi example we have the next struct config:
static const SPIConfig hs_spicfg = {
NULL,
GPIOB,
14,
0
};

My doubt is that in the second field of the configuration struct has only one port(GPIOB) but I have to use two ports (GPIOB and GPIOC). How can I creat the struct configuration with my requeriments?

Thanks!

Re: SPI Config STM32F4 Embest BB

Posted: Sun Mar 20, 2016 9:21 am
by Giovanni
Hi,

The SPI configuration is not involved with setting up the GPIO pins, you have to use the PAL driver in order to configure them (palSetPadMode or palSetLineMode). In the first two fields you are just telling the driver which pin to use as CS but it must have been already configured.

Giovanni