SPI Config STM32F4 Embest BB

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
chelox
Posts: 17
Joined: Tue Jan 22, 2013 8:24 pm

SPI Config STM32F4 Embest BB

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SPI Config STM32F4 Embest BB

Post 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
Post Reply