summaryrefslogtreecommitdiff
path: root/fw/fe310/eos
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-26 02:05:19 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-26 02:05:19 +0200
commit3b4ddebe631b14d15abe7355fbabe53e08c61a61 (patch)
treef64bbc41cc770898d0e84d4f87ceeba68feebdd9 /fw/fe310/eos
parentd7bdbcf7e6881065200b21a02522a68cf4fb9881 (diff)
display list burst mode added
Diffstat (limited to 'fw/fe310/eos')
-rw-r--r--fw/fe310/eos/eve/eve.c26
-rw-r--r--fw/fe310/eos/eve/eve.h3
2 files changed, 25 insertions, 4 deletions
diff --git a/fw/fe310/eos/eve/eve.c b/fw/fe310/eos/eve/eve.c
index 1152699..6b3943e 100644
--- a/fw/fe310/eos/eve/eve.c
+++ b/fw/fe310/eos/eve/eve.c
@@ -8,7 +8,10 @@
static char _cmd_burst;
static uint16_t _cmd_offset;
+
+static char _dl_burst;
static uint32_t _dl_addr;
+
static uint32_t *_touch_calib;
static uint8_t _brigtness;
static uint8_t _power_state;
@@ -96,15 +99,32 @@ static void _dl_inc(uint32_t i) {
_dl_addr += i;
}
-void eve_dl_start(uint32_t addr) {
+void eve_dl_start(uint32_t addr, char burst) {
_dl_addr = addr;
+ _dl_burst = burst;
+ if (burst) {
+ eve_spi_cs_set();
+ eve_spi_xchg24(addr | EVE_MEM_WRITE, EVE_SPI_FLAG_TX);
+ }
}
void eve_dl_write(uint32_t dl) {
- eve_write32(_dl_addr, dl);
+ if (_dl_burst) {
+ eve_spi_xchg32(dl, EVE_SPI_FLAG_TX | EVE_SPI_FLAG_BSWAP);
+ } else {
+ eve_write32(_dl_addr, dl);
+ }
_dl_inc(4);
}
+void eve_dl_end(void) {
+ if (_dl_burst) {
+ eve_spi_flush();
+ eve_spi_cs_clear();
+ _dl_burst = 0;
+ }
+}
+
void eve_dl_swap(void) {
eve_write8(REG_DLSWAP, EVE_DLSWAP_FRAME);
}
@@ -343,7 +363,7 @@ static int _init(void) {
eve_write8(REG_VOL_PB, 0x00); /* turn recorded audio volume off */
/* write a basic display-list to get things started */
- eve_dl_start(EVE_RAM_DL);
+ eve_dl_start(EVE_RAM_DL, 0);
eve_dl_write(CLEAR_COLOR_RGB(0,0,0));
eve_dl_write(CLEAR(1,1,1));
eve_dl_write(DISPLAY());
diff --git a/fw/fe310/eos/eve/eve.h b/fw/fe310/eos/eve/eve.h
index c482d83..e204158 100644
--- a/fw/fe310/eos/eve/eve.h
+++ b/fw/fe310/eos/eve/eve.h
@@ -37,8 +37,9 @@ void eve_write32(uint32_t addr, uint32_t data);
void eve_readb(uint32_t addr, uint8_t *b, size_t size);
void eve_writeb(uint32_t addr, uint8_t *b, size_t size);
-void eve_dl_start(uint32_t addr);
+void eve_dl_start(uint32_t addr, char burst);
void eve_dl_write(uint32_t dl);
+void eve_dl_end(void);
void eve_dl_swap(void);
uint32_t eve_dl_get_addr(void);