-1

It possible to set 2 pins high with GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) like this:

GPIO_SetBis(GPIOA,PA1|PA2)  

The online stm32f10 peripheral library (here) said:

This parameter can be any combination of GPIO_Pin_x where x can be (0..15)

But inside the GPIO_SetBits function there is:

assert_param(IS_GPIO_PIN(GPIO_Pin));  

It refers to a simple macro that exams each input as sigle pin:

(((PIN) == GPIO_Pin_0) || \ ... 
Tarick Welling
  • 3,119
  • 3
  • 19
  • 44
ahmadjn
  • 1
  • 1

2 Answers2

0

Of cource it is possible. But you must write a new function,which has three paremeter.You can write easily when you analaysis GPIO_SetBits functions. It will be just similar.

0

If you are talking about STM32 standard library provided by STM, then its not possible, see what standard library says ..

void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GPIO_PIN(GPIO_Pin));

  GPIOx->BSRRL = GPIO_Pin;
}

So it takes GPIOx and GPIO Pin as parameters and assign GPIO_Pin to GPIOx-->BSRRL register...

However you can always make your own function to do the task for you .

Tarick Welling
  • 3,119
  • 3
  • 19
  • 44
Dheeraj Kumar
  • 377
  • 2
  • 13