|
8 | 8 | #include <string.h>
|
9 | 9 |
|
10 | 10 | #include "device/spi.h"
|
| 11 | +#include "driver/ssd1331.h" |
11 | 12 |
|
12 | 13 | #define SSD1331_GPIO_PIN_DC 23
|
13 | 14 | #define SSD1331_GPIO_PIN_RST 14
|
@@ -65,19 +66,19 @@ void ssd1331_refresh_gram(uint8_t *gram)
|
65 | 66 |
|
66 | 67 | spi1_trans[0].length = 3*8;
|
67 | 68 | spi1_trans[0].tx_data[0] = 0x15; // Set Column Address
|
68 |
| - spi1_trans[0].tx_data[1] = 0x00; // 0, startx |
69 |
| - spi1_trans[0].tx_data[2] = 0x5f; // 95, endx |
| 69 | + spi1_trans[0].tx_data[1] = 0x00; // startx |
| 70 | + spi1_trans[0].tx_data[2] = SSD1331_SCREEN_WIDTH - 1; // endx |
70 | 71 | spi1_trans[0].user = (void*)0;
|
71 | 72 | spi1_trans[0].flags = SPI_TRANS_USE_TXDATA;
|
72 | 73 |
|
73 | 74 | spi1_trans[1].length = 3*8,
|
74 | 75 | spi1_trans[1].tx_data[0] = 0x75; // Set Row Address
|
75 |
| - spi1_trans[1].tx_data[1] = 0x00; // 0, starty |
76 |
| - spi1_trans[1].tx_data[2] = 0x3f; // 63, endy |
| 76 | + spi1_trans[1].tx_data[1] = 0x00; // starty |
| 77 | + spi1_trans[1].tx_data[2] = SSD1331_SCREEN_HEIGHT - 1; // endy |
77 | 78 | spi1_trans[1].user = (void*)0;
|
78 | 79 | spi1_trans[1].flags = SPI_TRANS_USE_TXDATA;
|
79 | 80 |
|
80 |
| - spi1_trans[2].length = 96*64*2*8; |
| 81 | + spi1_trans[2].length = SSD1331_SCREEN_WIDTH*SSD1331_SCREEN_HEIGHT*2*8; |
81 | 82 | spi1_trans[2].tx_buffer = gram;
|
82 | 83 | spi1_trans[2].user = (void*)1;
|
83 | 84 |
|
|
0 commit comments