Changelog
1.1.0
- Added:
display_text.h, header-only text helpers (UTF-8 decoding, a GFX or extended font seen the same way, glyph lookup and advance), so a renderer that draws text itself gets the same metrics astext(). - Added: the band path of the panel contract (
display_band_ops_t, optional:display_panel_ops_t::band,NULLfor none), for renderers that compose outside the framebuffer, anddisplay_panel_of()/display_claim()/display_release(): while a renderer holds the panel the drawing methods throw\LogicException. The band ops are declared indisplay_band.h(plain C, included bydisplay_panel.h). - Added:
display_vsync_hook()in the C API: a renderer's callback in the TE interrupt at every pulse, besideonVsync(). - Added:
display_band_ops_t::scan(display_scan_t), the order in which the panel refreshes its picture, so a renderer paced on TE can write its bands where the refresh is not reading and the picture does not tear;DISPLAY_SCAN_UNKNOWN(0) when the driver does not set it. - Added:
display_claim_ex(),display_claim()with a callback that tells the renderer holding the panel aboutsleep()(before),wake()(after) and a lost picture (display_invalidate()), so it pauses while the panel is off and sends its whole frame again after a re-initialisation. - Added: the band contract's failure rule: a panel that failed for good returns
BM_ERR_INVALID_STATEfrom every laterbeginandpush, and only then; the renderer takes that code as final.
1.0.0
- First release.
- Added: ide/ext-display.stub, the PHP declarations of the package for IDEs (conductor copies it into vendor/php-baremetal/ide-stubs/).
- Asynchronous flush: with a driver that has
begin/wait,flush()starts the region and returns; a drawing waits only for the rows not yet sent that it touches; aflush()during another one is pending (one region, merged). A failed transfer throws<Panel>: push failed (error 0x..)at the next call; a wait longer than 2000 ms in all throws<Panel>: flush timed out. A display freed or attached again drops its pending region.sleep(),wake()andbacklight()wait for the flush first; withvsync,sleep()andwake()drop a region still waiting for the TE pulse instead of waiting for it. flushWait(): void: returns when no flush is in flight or pending.- Driver options through
display_attach_ex()anddisplay_attach_opts_t:buffered(a copy of the framebuffer, so drawings never wait),vsync(each region starts at the next TE pulse; without a TE pin the driver throws\ValueError) andte(the TE pin, whose interrupt ext-display owns; several objects of one panel share the pin, and freeing one of them leaves the pulses to the others). - Events:
onFlushed(string $event): Baremetal\Source(the end of every region sent;Baremetal\Display\Flushedwith$x0,$y0,$x1,$y1,$us) andonVsync(string $event): Baremetal\Source(every TE pulse, coalescing;Baremetal\TimerEventwith$ticks), with the handlesBaremetal\Display\FlushSourceandBaremetal\Display\VsyncSource. TheonVsync()event is raised at the pulse, before avsyncregion starts.onVsync()without a TE pin throws\ValueError<Panel>::onVsync(): the display has no TE pin; an unknown class\Error<Panel>::onFlushed(): unknown class '...' or too many sources. - C contract for drivers:
display_job_t, thebegin/waitentries ofdisplay_panel_ops_t(begincallable from an interrupt;waitblocks until a band or job ends ormspass, false on timeout; ext-display waits in short slices under one 2000 ms deadline, so a dead TE pin ends inflush timed out),display_rows_sent()/display_job_done(),display_attach_ex()anddisplay_quiesce(). - Requires
php-baremetal/ext-events^1.1andphp-baremetal/events-hal^1.4.