[riot-notifications] [RIOT-OS/RIOT] E-paper driver samr21 using spi (#11756)

talalong notifications at github.com
Tue Jul 2 15:17:46 CEST 2019


@dylad Thanks for your answer.
I did make some changes that you pointed at. But the display still does nothing.
So my questions are:
These steps are to make spi transfer, are they correct?
Did I miss the initialization for e-paper display, so that's why I counld't interact with it?

```
#define DISPLAY_REFRESH           0x12
int main(void)
{
    spi_t bus = SPI_DEV(1);
    spi_cs_t cs = (spi_cs_t)GPIO_PIN(PA, 14);
    spi_mode_t mode = SPI_MODE_1;
    spi_clk_t clk = SPI_CLK_10MHZ;
    gpio_t dc = (gpio_t)GPIO_PIN(PB,2);
    gpio_t reset = (gpio_t)GPIO_PIN(PA,16);
    gpio_t busy = (gpio_t)GPIO_PIN(PA,8);

    /* initialization */
    spi_init_cs(bus,cs);
    if(gpio_init(dc,GPIO_OUT)<0){puts("initialization of pin DC failed!");}
    if(gpio_init(reset,GPIO_OUT)<0){puts("initialization of pin RESET failed!");}
    if(gpio_init(busy,GPIO_IN)<0){puts("initialization of pin BUSY failed!");}
    /* reset */
    gpio_write(reset, 0);
    xtimer_usleep(TWOMILISEC);  
    gpio_write(reset, 1);

    /*sending command POWER SETTING*/
     gpio_write(dc, 0);
    spi_transfer_byte(bus,cs,true,POWER_SETTING);

    /* sending command DISPLAY REFRESH */
    spi_acquire(bus, cs, mode, clk); 
    gpio_write(reset,1);
    gpio_write(dc,0);
    spi_transfer_byte(bus,cs,true, DISPLAY_REFRESH);

    spi_release(bus);
    char line_buf[SHELL_DEFAULT_BUFSIZE];
    shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
    return 0;
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11756#issuecomment-507672618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190702/59f15b1f/attachment-0001.html>


More information about the notifications mailing list