Lines Matching +full:data +full:- +full:mirror

4  * Copyright (c) 2006-2007 CodeSourcery.
59 int mirror; member
75 static int ssd0303_send(I2CSlave *i2c, uint8_t data) in ssd0303_send() argument
80 switch (s->mode) { in ssd0303_send()
82 DPRINTF("byte 0x%02x\n", data); in ssd0303_send()
83 if (data == 0x80) in ssd0303_send()
84 s->mode = SSD0303_CMD; in ssd0303_send()
85 else if (data == 0x40) in ssd0303_send()
86 s->mode = SSD0303_DATA; in ssd0303_send()
88 BADF("Unexpected byte 0x%x\n", data); in ssd0303_send()
91 DPRINTF("data 0x%02x\n", data); in ssd0303_send()
92 if (s->col < 132) { in ssd0303_send()
93 s->framebuffer[s->col + s->row * 132] = data; in ssd0303_send()
94 s->col++; in ssd0303_send()
95 s->redraw = 1; in ssd0303_send()
99 old_cmd_state = s->cmd_state; in ssd0303_send()
100 s->cmd_state = SSD0303_CMD_NONE; in ssd0303_send()
103 DPRINTF("cmd 0x%02x\n", data); in ssd0303_send()
104 s->mode = SSD0303_IDLE; in ssd0303_send()
105 switch (data) { in ssd0303_send()
107 s->col = (s->col & 0xf0) | (data & 0xf); in ssd0303_send()
110 s->col = (s->col & 0x0f) | ((data & 0xf) << 4); in ssd0303_send()
113 s->start_line = 0; in ssd0303_send()
116 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
118 case 0xa0: /* Mirror off. */ in ssd0303_send()
119 s->mirror = 0; in ssd0303_send()
121 case 0xa1: /* Mirror off. */ in ssd0303_send()
122 s->mirror = 1; in ssd0303_send()
125 s->flash = 0; in ssd0303_send()
128 s->flash = 1; in ssd0303_send()
131 s->inverse = 0; in ssd0303_send()
134 s->inverse = 1; in ssd0303_send()
137 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
139 case 0xad: /* DC-DC power control. */ in ssd0303_send()
140 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
143 s->enabled = 0; in ssd0303_send()
146 s->enabled = 1; in ssd0303_send()
149 s->row = data & 7; in ssd0303_send()
154 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
157 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
160 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
162 case 0xd9: /* Set pre-charge period (Ignored). */ in ssd0303_send()
163 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
166 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
169 s->cmd_state = SSD0303_CMD_SKIP1; in ssd0303_send()
171 case 0xe3: /* no-op. */ in ssd0303_send()
174 BADF("Unknown command: 0x%x\n", data); in ssd0303_send()
178 DPRINTF("skip 0x%02x\n", data); in ssd0303_send()
192 s->mode = SSD0303_IDLE; in ssd0303_event()
200 return -1; in ssd0303_event()
209 DisplaySurface *surface = qemu_console_surface(s->con); in ssd0303_update_display()
220 if (!s->redraw) in ssd0303_update_display()
245 if (s->flash) { in ssd0303_update_display()
248 } else if (s->inverse) { in ssd0303_update_display()
257 line = (y + s->start_line) & 63; in ssd0303_update_display()
258 src = s->framebuffer + 132 * (line >> 3) + 36; in ssd0303_update_display()
266 memcpy(dest, dest - dest_width * 96, dest_width * 96); in ssd0303_update_display()
270 s->redraw = 0; in ssd0303_update_display()
271 dpy_gfx_update(s->con, 0, 0, 96 * MAGNIFY, 16 * MAGNIFY); in ssd0303_update_display()
277 s->redraw = 1; in ssd0303_invalidate_display()
288 VMSTATE_INT32(mirror, ssd0303_state),
310 s->con = graphic_console_init(dev, 0, &ssd0303_ops, s); in ssd0303_realize()
311 qemu_console_resize(s->con, 96 * MAGNIFY, 16 * MAGNIFY); in ssd0303_realize()
314 static void ssd0303_class_init(ObjectClass *klass, void *data) in ssd0303_class_init() argument
319 dc->realize = ssd0303_realize; in ssd0303_class_init()
320 k->event = ssd0303_event; in ssd0303_class_init()
321 k->recv = ssd0303_recv; in ssd0303_class_init()
322 k->send = ssd0303_send; in ssd0303_class_init()
323 dc->vmsd = &vmstate_ssd0303; in ssd0303_class_init()