IMPORTANT The touchscreen has a maximum frequency of 2MHz, which is probably slower than you want your TFT SPI clock. So in the routine that reads touch coordinates (ili9341_touch_pressed_t ili9341_touch_coordinate(ili9341_t *,uint16_t *,uint16_t *) in ILI9341/ili9341.c), make sure to adjust the lines that modify the SPI clock so that your baud rate is less than 2MHz before communicating with the touchscreen (e.g. MODIFY_REG(lcd->spi_hal->Instance->CR1, SPI_CR1_BR, SPI_BAUDRATEPRESCALER_128)), and then restored to whatever setting you use here immedaitely afterwards. See the comments in that source file for both locations.

If using the touchscreen, you will probably want to set Hardware NSSP=Disabled (slave/chip-select) in favor of a software implementation, since you will need one signal for the TFT and a separate one for the touchscreen. Any two unused GPIO digital output pins will work.

Add a Memory->Peripheral DMA TX request for your SPI device with PeriphInc=Disabled, MemInc=Enabled, PeriphDataAlignment=Byte, MemDataAlignment=Byte, Mode=Normal.

IMPORTANT If using FreeRTOS, you will need to raise the DMA interrupt priority to something logically higher (numerically lower) than the FreeRTOS idle thread priority. For example, if FreeRTOS priority is set to 3 and SPI DMA TX is configured as DMA1 channel 4, set DMA IRQ priority to 2 with HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 2, 0).

Other than SPI pins, we need to select three more pins as output. I have selectedPB6 for CS, PC7 for RESET, and PA9 for DC. You are free to choose any other pins also, whatever suits the requirement