Skip to content

Commit 1b5829b

Browse files
added st7735
1 parent eef58fb commit 1b5829b

File tree

7 files changed

+1009
-0
lines changed

7 files changed

+1009
-0
lines changed

cores/asr650x/SPI/SPI.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ uint8_t SPIClass::transfer(uint8_t data)
223223

224224
void SPIClass::transfer(uint8_t * data, uint32_t size)
225225
{
226+
/*
226227
for(uint32_t i;i<size;i++)
227228
{
228229
if(_spi_num == 0)
@@ -236,6 +237,11 @@ void SPIClass::transfer(uint8_t * data, uint32_t size)
236237
SPI_2_SpiUartWriteTxData(*data++);
237238
}
238239
}
240+
*/
241+
for(int i=0;i<size;i++)
242+
{
243+
transfer(data[i]);
244+
}
239245
}
240246

241247

cores/asr650x/board/inc/debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ extern "C" {
8888
#if LoRaWAN_DEBUG_LEVEL >= 2
8989
#define FREQ_PRINTF(format, ...) printf(format, ##__VA_ARGS__)
9090
#define DIO_PRINTF(format, ...) printf(format, ##__VA_ARGS__)
91+
#define DBG_PRINTF(format, ...) printf(format, ##__VA_ARGS__)
9192
#elif LoRaWAN_DEBUG_LEVEL == 1
9293
#define FREQ_PRINTF(format, ...) printf(format, ##__VA_ARGS__)
9394
#define DIO_PRINTF(format, ...)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#include "HT_st7735.h"
2+
#include "Arduino.h"
3+
HT_st7735 st7735;
4+
void setup()
5+
{
6+
Serial.begin(115200);
7+
st7735.st7735_init();
8+
Serial.printf("Ready!\r\n");
9+
}
10+
11+
void loop() {
12+
// Check border
13+
st7735.st7735_fill_screen(ST7735_BLACK);
14+
15+
for(int x = 0; x < ST7735_WIDTH; x++) {
16+
st7735.st7735_draw_pixel(x, 0, ST7735_RED);
17+
st7735.st7735_draw_pixel(x, ST7735_HEIGHT-1, ST7735_RED);
18+
}
19+
20+
for(int y = 0; y < ST7735_HEIGHT; y++) {
21+
st7735.st7735_draw_pixel(0, y, ST7735_RED);
22+
st7735.st7735_draw_pixel(ST7735_WIDTH-1, y, ST7735_RED);
23+
}
24+
25+
delay(3000);
26+
27+
// Check fonts
28+
st7735.st7735_fill_screen(ST7735_BLACK);
29+
st7735.st7735_write_str(0, 0, "Font_7x10, red on black, lorem ipsum dolor sit amet", Font_7x10, ST7735_RED, ST7735_BLACK);
30+
st7735.st7735_write_str(0, 3*10, "Font_11x18, green, lorem ipsum", Font_11x18, ST7735_GREEN, ST7735_BLACK);
31+
st7735.st7735_write_str(0, 3*10+3*18, "Font_16x26", Font_16x26, ST7735_BLUE, ST7735_BLACK);
32+
delay(2000);
33+
34+
// Check colors
35+
st7735.st7735_fill_screen(ST7735_BLACK);
36+
st7735.st7735_write_str(0, 0, "BLACK", Font_11x18, ST7735_WHITE, ST7735_BLACK);
37+
delay(500);
38+
39+
st7735.st7735_fill_screen(ST7735_BLUE);
40+
st7735.st7735_write_str(0, 0, "BLUE", Font_11x18, ST7735_BLACK, ST7735_BLUE);
41+
delay(500);
42+
43+
st7735.st7735_fill_screen(ST7735_RED);
44+
st7735.st7735_write_str(0, 0, "RED", Font_11x18, ST7735_BLACK, ST7735_RED);
45+
delay(500);
46+
47+
st7735.st7735_fill_screen(ST7735_GREEN);
48+
st7735.st7735_write_str(0, 0, "GREEN", Font_11x18, ST7735_BLACK, ST7735_GREEN);
49+
delay(500);
50+
51+
st7735.st7735_fill_screen(ST7735_CYAN);
52+
st7735.st7735_write_str(0, 0, "CYAN", Font_11x18, ST7735_BLACK, ST7735_CYAN);
53+
delay(500);
54+
55+
st7735.st7735_fill_screen(ST7735_MAGENTA);
56+
st7735.st7735_write_str(0, 0, "MAGENTA", Font_11x18, ST7735_BLACK, ST7735_MAGENTA);
57+
delay(500);
58+
59+
st7735.st7735_fill_screen(ST7735_YELLOW);
60+
st7735.st7735_write_str(0, 0, "YELLOW", Font_11x18, ST7735_BLACK, ST7735_YELLOW);
61+
delay(500);
62+
63+
st7735.st7735_fill_screen(ST7735_WHITE);
64+
st7735.st7735_write_str(0, 0, "WHITE", Font_11x18, ST7735_BLACK, ST7735_WHITE);
65+
delay(500);
66+
}

0 commit comments

Comments
 (0)