+ //chipselect();
+ // Bitmaps are 9 by 8
+ uint8_t databuf[9] = {0x73, 0xFB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDF, 0xDA};
+ //uint8_t databuf[9] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+
+ int totalpixels = 72;
+ int column, row = 0;
+ uint8_t current;
+
+ tft_command(TFT_CASET, 4, 0x00, 10, 0x00, 18);
+ tft_command(TFT_RASET, 4, 0x00, 10, 0x00, 17);
+ tft_command(TFT_RAMWR, 0);
+ rsetbit(GPIOC_ODR, 6); // data = 1
+ for (int i = 0; i < totalpixels; i++) {
+
+ current = databuf[column];
+
+ if ((current >> (7 - row)) & 0x1) {
+ rwrite(SPI2_DR, (uint8_t) (fg >> 8));
+ if (!txbuf_empty())
+ return -1;
+ rwrite(SPI2_DR, (uint8_t) (fg & 0xFF));
+ if (!txbuf_empty())
+ return -1;
+ }
+ else {
+ rwrite(SPI2_DR, (uint8_t) (bg >> 8));
+ if (!txbuf_empty())
+ return -1;
+ rwrite(SPI2_DR, (uint8_t) (bg & 0xFF));
+ if (!txbuf_empty())
+ return -1;
+ }
+
+ /* Algoritm dependent on draw mode: top down, left right */
+ column++;
+ if (column > 8) {
+ column = 0;
+ row++;
+ }
+ }
+ return 0;