AnsweredAssumed Answered

Mixing HAL and LL for STM32F446

Question asked by Cezar Chirila on Apr 22, 2018
Latest reply on Apr 22, 2018 by Cezar Chirila

Hi there!

 

I have a bit of code, which was initialized using CubeMX and now I want to use a mix of HAL and LL (use LL for transmitting, use HAL for everything else). 

 

Currently I have tried to generate CubeMX code and just add manually the stm32f4xx_ll_spi.c/h files, then I include the header where I need. I want to replace this function:

 

void spi_write(uint8_t data) {
   HAL_SPI_Transmit(SPI_PORT,&data,1,HAL_MAX_DELAY);
}

With this one:

void ST7735_write(uint8_t data) {
   LL_SPI_TransmitData8 (&hspi2, data);
   while (!LL_SPI_IsActiveFlag_TXE(&hspi2))
   {
      ;
   }
}

But it does not work. I also get an error regarding hspi2, because it is of type "SPI_HandleTypeDef" and not "SPI_TypeDef". Does anyone have any idea what I am missing? Thank you!

Outcomes