Connecting and Controlling SPI E-Paper Display with BPI-R3

Hello everyone, I’m working on a project to control an SPI-based e-paper display using a BPI-R3 board. I’m using a Waveshare 1.64inch e-Paper module, and the BPI-R3 is running OpenWRT( 23.05.4). I have some questions and would greatly appreciate the community’s help:

  1. Hardware Connection:

    • Which pins on the BPI-R3 should be used for SPI communication? (19,21,23 and 24,26)
    • I want to use a GPIO pin to receive a button press signal while SPI communication is ongoing. This button will be used to control screen refresh. How should I connect this?
    • Are there any considerations or potential conflicts when using SPI and GPIO simultaneously?
    • How should I connect the e-paper display pins to the BPI-R3?
    • Is a level shifter circuit necessary?
  2. Software Configuration:

    • How do I enable SPI functionality on the BPI-R3? Do I need to modify the device tree?
    • Are there any recommended Linux SPI drivers or libraries I should use?

I found a post mentioning that “SPI is fully supported” on the BPI-R3, but I’m still unsure how to implement it:

For reference, here are the datasheets for the e-paper display:

If any additional information is needed, please let me know, and I’ll provide it promptly. Thank you in advance for your help!

1 Like

I’m looking at a schematic for the BPI-R3 , and I’m confused about the multiple functions listed for each pin. For example, pin 21 is labeled as SPI-MISO on the chip, but the connection line shows GPIO13/JTAG_JIMS/SPIC_MISO. Additionally, there’s an arrow pointing to it labeled GPIO_8.

  1. Why are there multiple functions listed for a single pin?
  2. How do I know which function the pin is actually using?
  3. What’s the difference between the label on the chip and the labels on the connection line?
  4. How does the GPIO numbering work (GPIO13 vs GPIO_8)?
  5. How do I choose which function to use for a particular pin?

Any explanations or resources to help me understand this would be greatly appreciated. Thank you!

spi should work on mainline without thinking of the pins as the right should be already mapped and spi1 is enabled.

Deeper digging is only necessary if you want to use other functions which are defined in pinctrl driver, mapped to a name and referenced in dts.

But have not used an spi device yet on the bpi boards. Afaik you have to add a node with drivers compatible and properties to dts if there is already a linux driver (like it’s done for spi nand/nor as overlay) or you need to do low-level spi access (maybe requires a spidev).

You’ve been a great help, thank you

I don’t see any devices like /dev/spidev. in my system. Should I check if my pins are correctly connected? Will such devices appear once the connections are correct?

I have not done much with spi,but afair you have to add a dts node (with compatibles listed in spidev driver) and driver to get spidev.

Thank you so much for your explanation!