Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f73e4d

Browse files
committed
Comments.
1 parent de21540 commit 3f73e4d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

FemtoRV/FIRMWARE/LIBFEMTORV32/femtorv32.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,14 @@ extern void oled3(uint32_t cmd, uint32_t arg1, uint32_t arg2, uint32_t arg3);
147147
* Then send all the pixels using one of the three forms of OLED_WRITE_DATA
148148
*/
149149

150+
/*
151+
* The magic of 1-hot encoding for memory-mapped hw registers: one can
152+
* write in two register simultaneously by setting both bits in the address.
153+
* Here we send the same graphic byte to the OLED display and FGA graphic board,
154+
* so that graphic programs work on both.
155+
*/
150156
#define IO_GFX_DAT (IO_SSD1351_DAT | IO_FGA_DAT)
157+
151158
#define OLED_WRITE_DATA_UINT8_UINT8(HI,LO) IO_OUT(IO_GFX_DAT,(HI)); IO_OUT(IO_GFX_DAT,(LO));
152159
#define OLED_WRITE_DATA_UINT16(RGB) OLED_WRITE_DATA_UINT8_UINT8(RGB>>8, RGB)
153160
#define OLED_WRITE_DATA_RGB(R,G,B) OLED_WRITE_DATA_UINT16(GL_RGB(R,G,B))

0 commit comments

Comments
 (0)