AnsweredAssumed Answered

STM32f103c8cb HAL library with SPI over DMA

Question asked by Rafal Pospieski on May 28, 2017
Latest reply on May 30, 2017 by ChrisH


I`m trying to send data from memory to SPI using DMA for LCD TFT purposes. To speed up the drawing I would like to send the same half-word x times (fill the rectange with the same color for example). At this point I`m able to send correcty the data to defined SPI port from particular memory adress (without memory incrase since I would like to send the same data over and over again) . The issue is that the DMA  command only allows me to send 8bit data and I need to use 16 bits (half-word).


The question - is there any possibility to send half-word (without memory increase by DMA) to SPI  (instead of 8bits only)?


LCD_WriteReg(0x0020, 0 );//set x coordinate do TFT
LCD_WriteReg(0x0021, 0 );//set z coordinate do TFT

SendIndex(0x0022);//send data

uint16_t i;
for (i=0;i<30;i++)
HAL_SPI_Transmit_DMA(&hspi1, (uint8_t*)&color, 1024*5);            //<===== Eight bits only, I need 16 bits
while(HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY);




best regards