This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use SPIM to send data to panel, but uint8_t only send 255 byte at a time.

Hi, I try to send data through SPIM to my panel(Sharp Memory LCM), and I success get the picture (only part of the picture).

image description

The reason why is that function can only support uint8_t, max length 255 byte, but this panel need to send at least 2Kbyte at a time.

(Using function nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length)))

Are there any way to send 2K size data through SPI at a time?

Thx for ur kindly help.

Update 1(2016/05/14): I use nrf_drv_spi_transfer() function, send data repeatedly until all data transfer, but it's too lag to display...I will keep study it.

image description

Update 2(2016/05/16): I decided not to use DMA and just replace all tx_buf_length with uint16_t on nrf_drv_spi.c & nrf_drv_spi.h and u can run this panel. nrf_drv_spi.c nrf_drv_spi.h

Parents
  • Yes you can do it.

    1. Control the SS pin manually by configuring it as a GPIO output and and setting it high initially.
    2. Break your data into 255 byte chunks
    3. Before sending data set SS low.
    4. Call nrf_drv_spi_transfer() for first chunk
    5. Wait for SPI event handler to know when transfer is complete
    6. Repeat 4-5 until all data is transferred, then set SS high.
Reply
  • Yes you can do it.

    1. Control the SS pin manually by configuring it as a GPIO output and and setting it high initially.
    2. Break your data into 255 byte chunks
    3. Before sending data set SS low.
    4. Call nrf_drv_spi_transfer() for first chunk
    5. Wait for SPI event handler to know when transfer is complete
    6. Repeat 4-5 until all data is transferred, then set SS high.
Children
Related