Skip to main content
ACan.1
Associate II
May 1, 2020
Question

Usage of HAL_SPI_Transmit

  • May 1, 2020
  • 1 reply
  • 563 views

Hi,

normally i use HAL_SPI_Transmit

   HAL_GPIO_WritePin(Port, Pin, GPIO_PIN_RESET);

HAL_SPI_Transmit(...)

   HAL_GPIO_WritePin(Port, Pin, GPIO_PIN_SET);

Is it possible to use it like following;

   HAL_GPIO_WritePin(Port, Pin, GPIO_PIN_RESET);

HAL_SPI_Transmit(...buffer1..)

HAL_SPI_Transmit(..buffer2..)

   HAL_GPIO_WritePin(Port, Pin, GPIO_PIN_SET);

Thank you

Note: The reason I need to use it like that is that, I need to call it in a function, which takes buffer1 and buffer2 as parameter; function(.., uint8* buffer1, uint8 buffer2, )

This topic has been closed for replies.

1 reply

TDK
Super User
May 2, 2020

Yes it is. This is a very common usage pattern to manually set the CS pin as needed.

"If you feel a post has answered your question, please click ""Accept as Solution""."