Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can it be using DMA if the HAL_SPI_Transmit_DMA function is not used? #7

Closed
rtek1000 opened this issue Jun 27, 2023 · 1 comment

Comments

@rtek1000
Copy link

Hi,

void ili9341_spi_write_command(ili9341_t *lcd,
    ili9341_spi_slave_t spi_slave, uint8_t command)
{
  __SLAVE_SELECT(lcd, spi_slave);

  HAL_GPIO_WritePin(lcd->data_command_port, lcd->data_command_pin, __GPIO_PIN_CLR__);
  HAL_SPI_Transmit(lcd->spi_hal, &command, sizeof(command), __SPI_MAX_DELAY__);

  __SLAVE_RELEASE(lcd, spi_slave);
}

void ili9341_spi_write_data(ili9341_t *lcd,
    ili9341_spi_slave_t spi_slave, uint16_t data_sz, uint8_t data[])
{
  __SLAVE_SELECT(lcd, spi_slave);

  HAL_GPIO_WritePin(lcd->data_command_port, lcd->data_command_pin, __GPIO_PIN_SET__);
  HAL_SPI_Transmit(lcd->spi_hal, data, data_sz, __SPI_MAX_DELAY__);

  __SLAVE_RELEASE(lcd, spi_slave);
}

Reference: https://visualgdb.com/tutorials/arm/stm32/spi/

@ardnew
Copy link
Owner

ardnew commented Jun 29, 2023 via email

@ardnew ardnew closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants