update
This commit is contained in:
parent
169ee776c2
commit
4acd2ff1be
26
csrc/u8g2.h
26
csrc/u8g2.h
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
call sequence
|
call sequence
|
||||||
|
|
||||||
u8g2_Setup_XYZ
|
u8g2_SetupBuffer_XYZ
|
||||||
u8x8_Setup_XYZ
|
u8x8_Setup_XYZ
|
||||||
u8x8_SetupDefaults(u8g2);
|
u8x8_SetupDefaults(u8g2);
|
||||||
assign u8x8 callbacks
|
assign u8x8 callbacks
|
||||||
|
@ -246,6 +246,20 @@ struct u8g2_struct
|
||||||
|
|
||||||
#define u8g2_GetU8x8(u8g2) ((u8x8_t *)(u8g2))
|
#define u8g2_GetU8x8(u8g2) ((u8x8_t *)(u8g2))
|
||||||
|
|
||||||
|
/*==========================================*/
|
||||||
|
/* u8x8 wrapper */
|
||||||
|
|
||||||
|
#define u8g2_SetupDisplay(u8g2, display_cb, cad_cb, byte_cb, gpio_and_delay_cb) \
|
||||||
|
u8x8_Setup(u8g2_GetU8x8(u8g2), (display_cb), (cad_cb), (byte_cb), (gpio_and_delay_cb))
|
||||||
|
|
||||||
|
#define u8g2_InitDisplay(u8g2) u8x8_InitDisplay(u8g2_GetU8x8(u8g2))
|
||||||
|
#define u8g2_SetPowerSave(u8g2, is_enable) u8x8_SetPowerSave(u8g2_GetU8x8(u8g2), (is_enable))
|
||||||
|
#define u8g2_SetFlipMode(u8g2, mode) u8x8_SetFlipMode(u8g2_GetU8x8(u8g2), (mode))
|
||||||
|
#define u8g2_SetContrast(u8g2, value) u8x8_SetContrast(u8g2_GetU8x8(u8g2), (value))
|
||||||
|
#define u8g2_ClearDisplay(u8g2) u8x8_ClearDisplay(u8g2_GetU8x8(u8g2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
/* u8g2_setup.c */
|
/* u8g2_setup.c */
|
||||||
|
|
||||||
|
@ -254,7 +268,7 @@ extern const u8g2_cb_t u8g2_cb_r1;
|
||||||
extern const u8g2_cb_t u8g2_cb_r2;
|
extern const u8g2_cb_t u8g2_cb_r2;
|
||||||
extern const u8g2_cb_t u8g2_cb_r3;
|
extern const u8g2_cb_t u8g2_cb_r3;
|
||||||
|
|
||||||
void u8g2_Setup(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb);
|
void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -311,13 +325,13 @@ u8g2_uint_t u8g2_GetUTF8Width(u8g2_t *u8g2, const char *str);
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
/* u8x8_d_sdl_128x64.c */
|
/* u8x8_d_sdl_128x64.c */
|
||||||
void u8g2_Setup_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
void u8g2_SetupBuffer_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
||||||
void u8g2_Setup_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
void u8g2_SetupBuffer_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
/* u8x8_d_tga.c */
|
/* u8x8_d_tga.c */
|
||||||
void u8g2_Setup_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
void u8g2_SetupBuffer_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
||||||
void u8g2_Setup_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
void u8g2_SetupBuffer_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
/*============================================*/
|
/*============================================*/
|
||||||
|
|
||||||
void u8g2_Setup(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
u8g2->tile_buf_ptr = buf;
|
u8g2->tile_buf_ptr = buf;
|
||||||
u8g2->tile_buf_height = tile_buf_height;
|
u8g2->tile_buf_height = tile_buf_height;
|
||||||
|
|
|
@ -352,11 +352,13 @@ uint8_t u8x8_DrawTile(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t cnt, uint8_t *
|
||||||
/*
|
/*
|
||||||
After a call to u8x8_SetupDefaults,
|
After a call to u8x8_SetupDefaults,
|
||||||
setup u8x8 memory structures & inform callbacks
|
setup u8x8 memory structures & inform callbacks
|
||||||
|
This function is also called from u8x8_Setup(), so do not call u8x8_SetupMemory()
|
||||||
|
directly, but use u8x8_Setup() instead.
|
||||||
*/
|
*/
|
||||||
void u8x8_SetupMemory(u8x8_t *u8x8);
|
void u8x8_SetupMemory(u8x8_t *u8x8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
After calling u8x8_SetupMemory(), init the display hardware itself.
|
After calling u8x8_SetupMemory()/u8x8_Setup(), init the display hardware itself.
|
||||||
This will will the first time, u8x8 talks to the display.
|
This will will the first time, u8x8 talks to the display.
|
||||||
It will init the display, but keep display in power save mode.
|
It will init the display, but keep display in power save mode.
|
||||||
Usually this command must be followed by u8x8_SetPowerSave()
|
Usually this command must be followed by u8x8_SetPowerSave()
|
||||||
|
|
|
@ -333,13 +333,13 @@ void u8x8_Setup_SSD1306_128x64_NONAME(u8x8_t *u8x8)
|
||||||
u8x8_SetupMemory(u8x8);
|
u8x8_SetupMemory(u8x8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void u8g2_Setup_SSD1306_128x64_NONAME_1(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_SSD1306_128x64_NONAME_1(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
|
|
||||||
static uint8_t buf[128*8];
|
static uint8_t buf[128*8];
|
||||||
|
|
||||||
u8x8_Setup_SSD1306_128x64_NONAME(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_SSD1306_128x64_NONAME(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 1, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -350,7 +350,7 @@ uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 };
|
||||||
void setup(void)
|
void setup(void)
|
||||||
{
|
{
|
||||||
//u8x8_Setup_UC1701_DOGS102(&u8g2);
|
//u8x8_Setup_UC1701_DOGS102(&u8g2);
|
||||||
u8g2_Setup_SSD1306_128x64_NONAME_1(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SSD1306_128x64_NONAME_1(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -267,23 +267,23 @@ void u8x8_Setup_SDL_128x64(u8x8_t *u8x8)
|
||||||
u8x8_SetupMemory(u8x8);
|
u8x8_SetupMemory(u8x8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void u8g2_Setup_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
|
|
||||||
static uint8_t buf[128*8];
|
static uint8_t buf[128*8];
|
||||||
|
|
||||||
u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 8, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 8, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void u8g2_Setup_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
|
|
||||||
static uint8_t buf[128*3];
|
static uint8_t buf[128*3];
|
||||||
|
|
||||||
u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 3, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 3, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ u8g2_t u8g2;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
u8g2_Setup_SDL_128x64(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64(&u8g2, &u8g2_cb_r0);
|
||||||
|
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
|
|
|
@ -11,7 +11,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -202,7 +202,7 @@ int main(void)
|
||||||
int x, y;
|
int x, y;
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
u8g2_Setup_SDL_128x64(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -11,7 +11,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
//u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
//u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -58,7 +58,7 @@ const uint8_t bdf_font[762] U8G2_FONT_SECTION("bdf_font") = {
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 };
|
uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 };
|
||||||
u8g2_SetupStdio(&u8g2);
|
u8g2_SetupBufferStdio(&u8g2);
|
||||||
|
|
||||||
u8g2_display_Init(&u8g2);
|
u8g2_display_Init(&u8g2);
|
||||||
u8g2_display_PowerUp(&u8g2);
|
u8g2_display_PowerUp(&u8g2);
|
||||||
|
|
|
@ -284,12 +284,12 @@ void u8x8_Setup_TGA_DESC(u8x8_t *u8x8)
|
||||||
u8x8_SetupMemory(u8x8);
|
u8x8_SetupMemory(u8x8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void u8g2_Setup_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
static uint8_t buf[(XOFFSET+DEFAULT_WIDTH)*8];
|
static uint8_t buf[(XOFFSET+DEFAULT_WIDTH)*8];
|
||||||
|
|
||||||
u8x8_Setup_TGA_DESC(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_TGA_DESC(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 1, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
|
@ -393,12 +393,12 @@ void u8x8_Setup_TGA_LCD(u8x8_t *u8x8)
|
||||||
u8x8_SetupMemory(u8x8);
|
u8x8_SetupMemory(u8x8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void u8g2_Setup_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
static uint8_t buf[(DEFAULT_WIDTH/FACTOR)*8];
|
static uint8_t buf[(DEFAULT_WIDTH/FACTOR)*8];
|
||||||
|
|
||||||
u8x8_Setup_TGA_LCD(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_TGA_LCD(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 1, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_TGA_LCD(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA_LCD(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -81,7 +81,7 @@ int main(void)
|
||||||
u8x8_DrawString(&desc, 0, 0, "Description");
|
u8x8_DrawString(&desc, 0, 0, "Description");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
u8g2_Setup_TGA_DESC(&desc, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA_DESC(&desc, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&desc));
|
u8x8_InitDisplay(u8g2_GetU8x8(&desc));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&desc), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&desc), 0);
|
||||||
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
|
u8x8_ClearDisplay(u8g2_GetU8x8(&desc));
|
||||||
|
|
|
@ -12,7 +12,7 @@ int main(void)
|
||||||
int k;
|
int k;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
u8g2_Setup_TGA_DESC(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA_DESC(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr);
|
||||||
|
|
|
@ -22,14 +22,14 @@ struct controller
|
||||||
struct controller controller_list[] =
|
struct controller controller_list[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"SSD1306", 16, 8, "u8x8_cad_001",
|
"ssd1306", 16, 8, "u8x8_cad_001",
|
||||||
{
|
{
|
||||||
{ "128x64_noname" },
|
{ "128x64_noname" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"UC1701", 9, 8, "u8x8_cad_001",
|
"uc1701", 9, 8, "u8x8_cad_001",
|
||||||
{
|
{
|
||||||
{ "dogs102" },
|
{ "dogs102" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
|
@ -43,11 +43,20 @@ char *strlowercase(const char *s)
|
||||||
{
|
{
|
||||||
int i, len = strlen(s);
|
int i, len = strlen(s);
|
||||||
static char buf[1024];
|
static char buf[1024];
|
||||||
for( i = 0; i < len; i++ )
|
for( i = 0; i <= len; i++ )
|
||||||
buf[i] = tolower(s[i]);
|
buf[i] = tolower(s[i]);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *struppercase(const char *s)
|
||||||
|
{
|
||||||
|
int i, len = strlen(s);
|
||||||
|
static char buf[1024];
|
||||||
|
for( i = 0; i <= len; i++ )
|
||||||
|
buf[i] = toupper(s[i]);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
/*===========================================*/
|
/*===========================================*/
|
||||||
|
|
||||||
FILE *buf_code_fp;
|
FILE *buf_code_fp;
|
||||||
|
@ -58,6 +67,22 @@ FILE *setup_code_fp;
|
||||||
|
|
||||||
/*===========================================*/
|
/*===========================================*/
|
||||||
|
|
||||||
|
void do_display(int controller_idx, int display_idx, const char *postfix)
|
||||||
|
{
|
||||||
|
fprintf(setup_code_fp, "uint8_t *u8g2_Setup_");
|
||||||
|
fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].name));
|
||||||
|
fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].display_list[display_idx].name));
|
||||||
|
fprintf(setup_code_fp, "%s(uint8_t *u8g2, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)\n", postfix);
|
||||||
|
fprintf(setup_code_fp, "{\n");
|
||||||
|
fprintf(setup_code_fp, " u8g2_SetupDisplay(u8x8_d_");
|
||||||
|
fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].name));
|
||||||
|
fprintf(setup_code_fp, "%s, ", strlowercase(controller_list[controller_idx].display_list[display_idx].name));
|
||||||
|
fprintf(setup_code_fp, "%s, ", controller_list[controller_idx].cad);
|
||||||
|
fprintf(setup_code_fp, "byte_cb, gpio_and_delay_cb);");
|
||||||
|
|
||||||
|
fprintf(setup_code_fp, "}\n");
|
||||||
|
}
|
||||||
|
|
||||||
void do_controller_buffer_code(int idx, const char *postfix, int buf_len, int rows)
|
void do_controller_buffer_code(int idx, const char *postfix, int buf_len, int rows)
|
||||||
{
|
{
|
||||||
int display_idx;
|
int display_idx;
|
||||||
|
@ -77,6 +102,7 @@ void do_controller_buffer_code(int idx, const char *postfix, int buf_len, int ro
|
||||||
while( controller_list[idx].display_list[display_idx].name != NULL )
|
while( controller_list[idx].display_list[display_idx].name != NULL )
|
||||||
{
|
{
|
||||||
printf("%s\n", controller_list[idx].display_list[display_idx].name);
|
printf("%s\n", controller_list[idx].display_list[display_idx].name);
|
||||||
|
do_display(idx, display_idx, postfix);
|
||||||
display_idx++;
|
display_idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +131,7 @@ int main(void)
|
||||||
fprintf(buf_header_fp, "/* start of generated code, codebuild, u8g2 project */\n");
|
fprintf(buf_header_fp, "/* start of generated code, codebuild, u8g2 project */\n");
|
||||||
|
|
||||||
setup_code_fp = fopen("u8g2_setup.c", "w");
|
setup_code_fp = fopen("u8g2_setup.c", "w");
|
||||||
fprintf(buf_code_fp, "/* start of generated code, codebuild, u8g2 project */\n");
|
fprintf(setup_code_fp, "/* start of generated code, codebuild, u8g2 project */\n");
|
||||||
|
|
||||||
do_controller_list();
|
do_controller_list();
|
||||||
|
|
||||||
|
@ -114,6 +140,9 @@ int main(void)
|
||||||
|
|
||||||
fprintf(buf_header_fp, "/* end of generated code */\n");
|
fprintf(buf_header_fp, "/* end of generated code */\n");
|
||||||
fclose(buf_header_fp);
|
fclose(buf_header_fp);
|
||||||
|
|
||||||
|
fprintf(setup_code_fp, "/* end of generated code */\n");
|
||||||
|
fclose(setup_code_fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern const uint8_t *u8g2_font_list[] ;
|
||||||
extern char *u8g2_font_names[] ;
|
extern char *u8g2_font_names[] ;
|
||||||
|
|
||||||
#ifdef BUILD2
|
#ifdef BUILD2
|
||||||
extern void u8g2_Setup_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
extern void u8g2_SetupBuffer_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb);
|
||||||
extern void tga_save(const char *name);
|
extern void tga_save(const char *name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ void overviewpic(int i, int fm, char *fms, int bm, char *bms, int mm, char *mms)
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("8x8 font overview picture %s\n", target_font_identifier);
|
printf("8x8 font overview picture %s\n", target_font_identifier);
|
||||||
u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
//u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2));
|
//u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
|
@ -700,7 +700,7 @@ void overviewpic(int i, int fm, char *fms, int bm, char *bms, int mm, char *mms)
|
||||||
else if ( fm == FM_C )
|
else if ( fm == FM_C )
|
||||||
{
|
{
|
||||||
printf("overview picture %s\n", target_font_identifier);
|
printf("overview picture %s\n", target_font_identifier);
|
||||||
u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
//u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr);
|
//u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr);
|
||||||
|
@ -733,7 +733,7 @@ void overviewshortpic(int i, int fm, char *fms, int bm, char *bms, int mm, char
|
||||||
if ( fm == FM_8 )
|
if ( fm == FM_8 )
|
||||||
{
|
{
|
||||||
printf("8x8 font short overview picture %s\n", target_font_identifier);
|
printf("8x8 font short overview picture %s\n", target_font_identifier);
|
||||||
u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
//u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2));
|
//u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
|
@ -756,7 +756,7 @@ void overviewshortpic(int i, int fm, char *fms, int bm, char *bms, int mm, char
|
||||||
else if ( fm == FM_C )
|
else if ( fm == FM_C )
|
||||||
{
|
{
|
||||||
printf("short overview picture %s\n", target_font_identifier);
|
printf("short overview picture %s\n", target_font_identifier);
|
||||||
u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
//u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr);
|
//u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr);
|
||||||
|
@ -807,7 +807,7 @@ void generate_font_list(int i, int fm, char *fms, int bm, char *bms, int mm, cha
|
||||||
}
|
}
|
||||||
else if ( fm == FM_C )
|
else if ( fm == FM_C )
|
||||||
{
|
{
|
||||||
u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0);
|
u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0);
|
||||||
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
u8x8_InitDisplay(u8g2_GetU8x8(&u8g2));
|
||||||
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0);
|
||||||
if ( u8g2_font_list[u8g2_fnt_cnt] != NULL )
|
if ( u8g2_font_list[u8g2_fnt_cnt] != NULL )
|
||||||
|
|
|
@ -261,11 +261,11 @@ void u8x8_Setup_TGA(u8x8_t *u8x8)
|
||||||
u8x8_SetupMemory(u8x8);
|
u8x8_SetupMemory(u8x8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void u8g2_Setup_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
void u8g2_SetupBuffer_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb)
|
||||||
{
|
{
|
||||||
static uint8_t buf[(DEFAULT_WIDTH)*8*8];
|
static uint8_t buf[(DEFAULT_WIDTH)*8*8];
|
||||||
|
|
||||||
u8x8_Setup_TGA(u8g2_GetU8x8(u8g2));
|
u8x8_Setup_TGA(u8g2_GetU8x8(u8g2));
|
||||||
u8g2_Setup(u8g2, buf, 8, u8g2_cb);
|
u8g2_SetupBuffer(u8g2, buf, 8, u8g2_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue