更改显示数据字节顺序交换位置
This commit is contained in:
parent
7d90d05fc9
commit
639346b53e
|
@ -71,18 +71,6 @@ void U8G2::writeBufferXBM2(Print &p)
|
||||||
u8g2_print_for_screenshot = &p;
|
u8g2_print_for_screenshot = &p;
|
||||||
u8g2_WriteBufferXBM2(getU8g2(), u8g2_print_callback);
|
u8g2_WriteBufferXBM2(getU8g2(), u8g2_print_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void U8G2::writeBufferPBM3(Print &p)
|
|
||||||
{
|
|
||||||
u8g2_print_for_screenshot = &p;
|
|
||||||
u8g2_WriteBufferPBM3(getU8g2(), u8g2_print_callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
void U8G2::writeBufferXBM3(Print &p)
|
|
||||||
{
|
|
||||||
u8g2_print_for_screenshot = &p;
|
|
||||||
u8g2_WriteBufferXBM3(getU8g2(), u8g2_print_callback);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -309,10 +309,6 @@ u8g2_uint_t u8g2_GetUTF8Width(u8g2_t *u8g2, const char *str);
|
||||||
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
||||||
void writeBufferPBM2(Print &p);
|
void writeBufferPBM2(Print &p);
|
||||||
void writeBufferXBM2(Print &p);
|
void writeBufferXBM2(Print &p);
|
||||||
/* vertical top msb memory architecture */
|
|
||||||
/* GP12x7AI */
|
|
||||||
void writeBufferPBM3(Print &p);
|
|
||||||
void writeBufferXBM3(Print &p);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* virtual function for print base class */
|
/* virtual function for print base class */
|
||||||
|
|
|
@ -1466,9 +1466,6 @@ void u8g2_WriteBufferXBM(u8g2_t *u8g2, void (*out)(const char *s));
|
||||||
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
||||||
void u8g2_WriteBufferPBM2(u8g2_t *u8g2, void (*out)(const char *s));
|
void u8g2_WriteBufferPBM2(u8g2_t *u8g2, void (*out)(const char *s));
|
||||||
void u8g2_WriteBufferXBM2(u8g2_t *u8g2, void (*out)(const char *s));
|
void u8g2_WriteBufferXBM2(u8g2_t *u8g2, void (*out)(const char *s));
|
||||||
/* GP12x7AI */
|
|
||||||
void u8g2_WriteBufferPBM3(u8g2_t *u8g2, void (*out)(const char *s));
|
|
||||||
void u8g2_WriteBufferXBM3(u8g2_t *u8g2, void (*out)(const char *s));
|
|
||||||
|
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
|
@ -1486,8 +1483,6 @@ void u8g2_WriteBufferXBM3(u8g2_t *u8g2, void (*out)(const char *s));
|
||||||
void u8g2_ll_hvline_vertical_top_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
|
void u8g2_ll_hvline_vertical_top_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
|
||||||
/* ST7920 */
|
/* ST7920 */
|
||||||
void u8g2_ll_hvline_horizontal_right_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
|
void u8g2_ll_hvline_horizontal_right_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
|
||||||
/* GP12x7AI */
|
|
||||||
void u8g2_ll_hvline_vertical_top_msb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir);
|
|
||||||
|
|
||||||
|
|
||||||
/*==========================================*/
|
/*==========================================*/
|
||||||
|
|
|
@ -211,17 +211,3 @@ void u8g2_WriteBufferXBM2(u8g2_t *u8g2, void (*out)(const char *s))
|
||||||
u8x8_capture_write_xbm_buffer(u8g2_GetBufferPtr(u8g2), u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), u8x8_capture_get_pixel_2, out);
|
u8x8_capture_write_xbm_buffer(u8g2_GetBufferPtr(u8g2), u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), u8x8_capture_get_pixel_2, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vertical_top msb memory architecture */
|
|
||||||
/* GP12x7AI */
|
|
||||||
void u8g2_WriteBufferPBM3(u8g2_t *u8g2, void (*out)(const char *s))
|
|
||||||
{
|
|
||||||
u8x8_capture_write_pbm_pre(u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), out);
|
|
||||||
u8x8_capture_write_pbm_buffer(u8g2_GetBufferPtr(u8g2), u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), u8x8_capture_get_pixel_3, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
void u8g2_WriteBufferXBM3(u8g2_t *u8g2, void (*out)(const char *s))
|
|
||||||
{
|
|
||||||
u8x8_capture_write_xbm_pre(u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), out);
|
|
||||||
u8x8_capture_write_xbm_buffer(u8g2_GetBufferPtr(u8g2), u8g2_GetBufferTileWidth(u8g2), u8g2_GetBufferTileHeight(u8g2), u8x8_capture_get_pixel_3, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -7095,7 +7095,7 @@ void u8g2_Setup_gp1287ai_256x50_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_7_1(&tile_buf_height);
|
buf = u8g2_m_32_7_1(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* gp1287ai 2 */
|
/* gp1287ai 2 */
|
||||||
void u8g2_Setup_gp1287ai_256x50_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
void u8g2_Setup_gp1287ai_256x50_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
||||||
|
@ -7104,7 +7104,7 @@ void u8g2_Setup_gp1287ai_256x50_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_7_2(&tile_buf_height);
|
buf = u8g2_m_32_7_2(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* gp1287ai f */
|
/* gp1287ai f */
|
||||||
void u8g2_Setup_gp1287ai_256x50_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
void u8g2_Setup_gp1287ai_256x50_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
||||||
|
@ -7113,7 +7113,7 @@ void u8g2_Setup_gp1287ai_256x50_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1287ai_256x50, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_7_f(&tile_buf_height);
|
buf = u8g2_m_32_7_f(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* gp1247ai */
|
/* gp1247ai */
|
||||||
/* gp1247ai 1 */
|
/* gp1247ai 1 */
|
||||||
|
@ -7123,7 +7123,7 @@ void u8g2_Setup_gp1247ai_253x63_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_8_1(&tile_buf_height);
|
buf = u8g2_m_32_8_1(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* gp1247ai 2 */
|
/* gp1247ai 2 */
|
||||||
void u8g2_Setup_gp1247ai_253x63_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
void u8g2_Setup_gp1247ai_253x63_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
||||||
|
@ -7132,7 +7132,7 @@ void u8g2_Setup_gp1247ai_253x63_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_8_2(&tile_buf_height);
|
buf = u8g2_m_32_8_2(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* gp1247ai f */
|
/* gp1247ai f */
|
||||||
void u8g2_Setup_gp1247ai_253x63_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
void u8g2_Setup_gp1247ai_253x63_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
|
||||||
|
@ -7141,7 +7141,7 @@ void u8g2_Setup_gp1247ai_253x63_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
u8g2_SetupDisplay(u8g2, u8x8_d_gp1247ai_253x63, u8x8_cad_empty, byte_cb, gpio_and_delay_cb);
|
||||||
buf = u8g2_m_32_8_f(&tile_buf_height);
|
buf = u8g2_m_32_8_f(&tile_buf_height);
|
||||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_msb, rotation);
|
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||||
}
|
}
|
||||||
/* a2printer */
|
/* a2printer */
|
||||||
/* a2printer 1 */
|
/* a2printer 1 */
|
||||||
|
|
|
@ -368,175 +368,4 @@ void u8g2_ll_hvline_horizontal_right_lsb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* U8G2_WITH_HVLINE_SPEED_OPTIMIZATION */
|
|
||||||
|
|
||||||
/*=================================================*/
|
|
||||||
/*
|
|
||||||
u8g2_ll_hvline_vertical_top_msb
|
|
||||||
GP12x7AI
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef U8G2_WITH_HVLINE_SPEED_OPTIMIZATION
|
|
||||||
|
|
||||||
/*
|
|
||||||
x,y Upper left position of the line within the local buffer (not the display!)
|
|
||||||
len length of the line in pixel, len must not be 0
|
|
||||||
dir 0: horizontal line (left to right)
|
|
||||||
1: vertical line (top to bottom)
|
|
||||||
asumption:
|
|
||||||
all clipping done
|
|
||||||
*/
|
|
||||||
void u8g2_ll_hvline_vertical_top_msb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir)
|
|
||||||
{
|
|
||||||
uint16_t offset;
|
|
||||||
uint8_t *ptr;
|
|
||||||
uint8_t bit_pos, mask;
|
|
||||||
uint8_t or_mask, xor_mask;
|
|
||||||
#ifdef __unix
|
|
||||||
uint8_t *max_ptr = u8g2->tile_buf_ptr + u8g2_GetU8x8(u8g2)->display_info->tile_width*u8g2->tile_buf_height*8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//assert(x >= u8g2->buf_x0);
|
|
||||||
//assert(x < u8g2_GetU8x8(u8g2)->display_info->tile_width*8);
|
|
||||||
//assert(y >= u8g2->buf_y0);
|
|
||||||
//assert(y < u8g2_GetU8x8(u8g2)->display_info->tile_height*8);
|
|
||||||
|
|
||||||
/* bytes are vertical, msb on top (y=0), lsb at bottom (y=7) */
|
|
||||||
bit_pos = y; /* overflow truncate is ok here... */
|
|
||||||
bit_pos &= 7; /* ... because only the lowest 3 bits are needed */
|
|
||||||
mask = 0x80; /* LSB -> MSB */
|
|
||||||
mask >>= bit_pos; /* LSB -> MSB */
|
|
||||||
|
|
||||||
or_mask = 0;
|
|
||||||
xor_mask = 0;
|
|
||||||
if ( u8g2->draw_color <= 1 )
|
|
||||||
or_mask = mask;
|
|
||||||
if ( u8g2->draw_color != 1 )
|
|
||||||
xor_mask = mask;
|
|
||||||
|
|
||||||
|
|
||||||
offset = y; /* y might be 8 or 16 bit, but we need 16 bit, so use a 16 bit variable */
|
|
||||||
offset &= ~7;
|
|
||||||
offset *= u8g2_GetU8x8(u8g2)->display_info->tile_width;
|
|
||||||
ptr = u8g2->tile_buf_ptr;
|
|
||||||
ptr += offset;
|
|
||||||
ptr += x;
|
|
||||||
|
|
||||||
if ( dir == 0 )
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
#ifdef __unix
|
|
||||||
assert(ptr < max_ptr);
|
|
||||||
#endif
|
|
||||||
*ptr |= or_mask;
|
|
||||||
*ptr ^= xor_mask;
|
|
||||||
ptr++;
|
|
||||||
len--;
|
|
||||||
} while( len != 0 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
#ifdef __unix
|
|
||||||
assert(ptr < max_ptr);
|
|
||||||
#endif
|
|
||||||
*ptr |= or_mask;
|
|
||||||
*ptr ^= xor_mask;
|
|
||||||
|
|
||||||
bit_pos++;
|
|
||||||
bit_pos &= 7;
|
|
||||||
|
|
||||||
len--;
|
|
||||||
|
|
||||||
if ( bit_pos == 0 )
|
|
||||||
{
|
|
||||||
ptr+=u8g2->pixel_buf_width; /* 6 Jan 17: Changed u8g2->width to u8g2->pixel_buf_width, issue #148 */
|
|
||||||
|
|
||||||
if ( u8g2->draw_color <= 1 )
|
|
||||||
or_mask = 0x80; /* LSB -> MSB */
|
|
||||||
if ( u8g2->draw_color != 1 )
|
|
||||||
xor_mask = 0x80; /* LSB -> MSB */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
or_mask >>= 1; /* LSB -> MSB */
|
|
||||||
xor_mask >>= 1; /* LSB -> MSB */
|
|
||||||
}
|
|
||||||
} while( len != 0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#else /* U8G2_WITH_HVLINE_SPEED_OPTIMIZATION */
|
|
||||||
|
|
||||||
/*
|
|
||||||
x,y position within the buffer
|
|
||||||
*/
|
|
||||||
static void u8g2_draw_pixel_vertical_top_msb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y)
|
|
||||||
{
|
|
||||||
uint16_t offset;
|
|
||||||
uint8_t *ptr;
|
|
||||||
uint8_t bit_pos, mask;
|
|
||||||
|
|
||||||
//assert(x >= u8g2->buf_x0);
|
|
||||||
//assert(x < u8g2_GetU8x8(u8g2)->display_info->tile_width*8);
|
|
||||||
//assert(y >= u8g2->buf_y0);
|
|
||||||
//assert(y < u8g2_GetU8x8(u8g2)->display_info->tile_height*8);
|
|
||||||
|
|
||||||
/* bytes are vertical, msb on top (y=0), lsb at bottom (y=7) */
|
|
||||||
bit_pos = y; /* overflow truncate is ok here... */
|
|
||||||
bit_pos &= 7; /* ... because only the lowest 3 bits are needed */
|
|
||||||
mask = 0x80; /* LSB -> MSB */
|
|
||||||
mask >>= bit_pos; /* LSB -> MSB */
|
|
||||||
|
|
||||||
offset = y; /* y might be 8 or 16 bit, but we need 16 bit, so use a 16 bit variable */
|
|
||||||
offset &= ~7;
|
|
||||||
offset *= u8g2_GetU8x8(u8g2)->display_info->tile_width;
|
|
||||||
ptr = u8g2->tile_buf_ptr;
|
|
||||||
ptr += offset;
|
|
||||||
ptr += x;
|
|
||||||
|
|
||||||
|
|
||||||
if ( u8g2->draw_color <= 1 )
|
|
||||||
*ptr |= mask;
|
|
||||||
if ( u8g2->draw_color != 1 )
|
|
||||||
*ptr ^= mask;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
x,y Upper left position of the line within the local buffer (not the display!)
|
|
||||||
len length of the line in pixel, len must not be 0
|
|
||||||
dir 0: horizontal line (left to right)
|
|
||||||
1: vertical line (top to bottom)
|
|
||||||
asumption:
|
|
||||||
all clipping done
|
|
||||||
*/
|
|
||||||
void u8g2_ll_hvline_vertical_top_msb(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir)
|
|
||||||
{
|
|
||||||
if ( dir == 0 )
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
u8g2_draw_pixel_vertical_top_msb(u8g2, x, y);
|
|
||||||
x++;
|
|
||||||
len--;
|
|
||||||
} while( len != 0 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
u8g2_draw_pixel_vertical_top_msb(u8g2, x, y);
|
|
||||||
y++;
|
|
||||||
len--;
|
|
||||||
} while( len != 0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* U8G2_WITH_HVLINE_SPEED_OPTIMIZATION */
|
#endif /* U8G2_WITH_HVLINE_SPEED_OPTIMIZATION */
|
||||||
|
|
|
@ -1082,10 +1082,6 @@ uint8_t u8x8_capture_get_pixel_1(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint
|
||||||
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
/* SH1122, LD7032, ST7920, ST7986, LC7981, T6963, SED1330, RA8835, MAX7219, LS0 */
|
||||||
uint8_t u8x8_capture_get_pixel_2(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint8_t tile_width);
|
uint8_t u8x8_capture_get_pixel_2(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint8_t tile_width);
|
||||||
|
|
||||||
/* vertical_top msb memory architecture */
|
|
||||||
/* GP12x7AI */
|
|
||||||
uint8_t u8x8_capture_get_pixel_3(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint8_t tile_width);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void u8x8_capture_write_pbm_pre(uint8_t tile_width, uint8_t tile_height, void (*out)(const char *s));
|
void u8x8_capture_write_pbm_pre(uint8_t tile_width, uint8_t tile_height, void (*out)(const char *s));
|
||||||
|
|
|
@ -72,22 +72,6 @@ uint8_t u8x8_capture_get_pixel_2(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vertical top msb memory architecture */
|
|
||||||
/* GP12x7AI */
|
|
||||||
uint8_t u8x8_capture_get_pixel_3(uint16_t x, uint16_t y, uint8_t *dest_ptr, uint8_t tile_width)
|
|
||||||
{
|
|
||||||
//uint8_t *dest_ptr = capture->buffer;
|
|
||||||
//if ( dest_ptr == NULL )
|
|
||||||
//return 0;
|
|
||||||
//dest_ptr += (y/8)*capture->tile_width*8;
|
|
||||||
dest_ptr += (y/8)*tile_width*8;
|
|
||||||
y &= 7;
|
|
||||||
dest_ptr += x;
|
|
||||||
if ( (*dest_ptr & (0x80>>y)) == 0 ) /* LSB -> MSB */
|
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void u8x8_capture_write_pbm_pre(uint8_t tile_width, uint8_t tile_height, void (*out)(const char *s))
|
void u8x8_capture_write_pbm_pre(uint8_t tile_width, uint8_t tile_height, void (*out)(const char *s))
|
||||||
{
|
{
|
||||||
out("P1\n");
|
out("P1\n");
|
||||||
|
|
|
@ -141,6 +141,7 @@ uint8_t u8x8_d_gp1247ai_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
|
||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
uint8_t x, y;
|
uint8_t x, y;
|
||||||
uint16_t tx_cnt;
|
uint16_t tx_cnt;
|
||||||
|
uint8_t swapped_byte;
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
||||||
|
@ -172,14 +173,12 @@ uint8_t u8x8_d_gp1247ai_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
|
||||||
u8x8_cad_SendArg(u8x8, SWAP8(0x007)); /* Y方向每8像素自动折返 */
|
u8x8_cad_SendArg(u8x8, SWAP8(0x007)); /* Y方向每8像素自动折返 */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (tx_cnt > 255)
|
while (tx_cnt > 0)
|
||||||
{
|
{
|
||||||
u8x8_cad_SendData(u8x8, 255, ptr); /* u8x8_cad_SendData() 一次最多只能发送255 Byte,所以分两次发 */
|
swapped_byte = SWAP8(*ptr);
|
||||||
u8x8_cad_SendData(u8x8, tx_cnt - 255, ptr + 255);
|
u8x8_cad_SendData(u8x8, 1, &swapped_byte);
|
||||||
}
|
ptr += 1;
|
||||||
else
|
tx_cnt -= 1;
|
||||||
{
|
|
||||||
u8x8_cad_SendData(u8x8, tx_cnt, ptr);
|
|
||||||
}
|
}
|
||||||
arg_int--;
|
arg_int--;
|
||||||
} while (arg_int > 0);
|
} while (arg_int > 0);
|
||||||
|
|
|
@ -149,6 +149,7 @@ uint8_t u8x8_d_gp1287ai_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
|
||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
uint8_t x, y;
|
uint8_t x, y;
|
||||||
uint16_t tx_cnt;
|
uint16_t tx_cnt;
|
||||||
|
uint8_t swapped_byte;
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
||||||
|
@ -180,14 +181,12 @@ uint8_t u8x8_d_gp1287ai_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
|
||||||
u8x8_cad_SendArg(u8x8, SWAP8(0x007)); /* Y方向每8像素自动折返 */
|
u8x8_cad_SendArg(u8x8, SWAP8(0x007)); /* Y方向每8像素自动折返 */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (tx_cnt > 255)
|
while (tx_cnt > 0)
|
||||||
{
|
{
|
||||||
u8x8_cad_SendData(u8x8, 255, ptr); /* u8x8_cad_SendData() 一次最多只能发送255 Byte,所以分两次发 */
|
swapped_byte = SWAP8(*ptr);
|
||||||
u8x8_cad_SendData(u8x8, tx_cnt - 255, ptr + 255);
|
u8x8_cad_SendData(u8x8, 1, &swapped_byte);
|
||||||
}
|
ptr += 1;
|
||||||
else
|
tx_cnt -= 1;
|
||||||
{
|
|
||||||
u8x8_cad_SendData(u8x8, tx_cnt, ptr);
|
|
||||||
}
|
}
|
||||||
arg_int--;
|
arg_int--;
|
||||||
} while (arg_int > 0);
|
} while (arg_int > 0);
|
||||||
|
|
|
@ -1879,7 +1879,7 @@ struct controller controller_list[] =
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"gp1287ai", 32, 7, "u8g2_ll_hvline_vertical_top_msb", "u8x8_cad_empty", "", COM_4WSPI, /* DC pin is not used */
|
"gp1287ai", 32, 7, "u8g2_ll_hvline_vertical_top_lsb", "u8x8_cad_empty", "", COM_4WSPI, /* DC pin is not used */
|
||||||
"", /* is_generate_u8g2_class= */ 1,
|
"", /* is_generate_u8g2_class= */ 1,
|
||||||
{
|
{
|
||||||
{ "256x50" },
|
{ "256x50" },
|
||||||
|
@ -1888,7 +1888,7 @@ struct controller controller_list[] =
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"gp1247ai", 32, 8, "u8g2_ll_hvline_vertical_top_msb", "u8x8_cad_empty", "", COM_4WSPI, /* DC pin is not used */
|
"gp1247ai", 32, 8, "u8g2_ll_hvline_vertical_top_lsb", "u8x8_cad_empty", "", COM_4WSPI, /* DC pin is not used */
|
||||||
"", /* is_generate_u8g2_class= */ 1,
|
"", /* is_generate_u8g2_class= */ 1,
|
||||||
{
|
{
|
||||||
{ "253x63" },
|
{ "253x63" },
|
||||||
|
|
Loading…
Reference in New Issue