This page documents the advanced display API for the TM1629-based protoboard target.

Geometry and Setup

tm1629.width, tm1629.height, tm1629.rowMask (board library)

Layer: board library
Behavior: Constants describing the maintained framebuffer shape for the TM1629-based board: 12 columns, 8 rows, and a 12-bit row mask.
Example:

tm1629.width
tm1629.height

tm1629.raw.init, tm1629.init, tm1629.brightness! (FFI / board library)

Layer: board library
Behavior: Initialize the display transport, clear the current and next buffers, and set brightness. tm1629.init wraps the baked-in wiring or explicit pins into the higher-level setup path.
Example:

tm1629.init: TM1629_STB, TM1629_CLK, TM1629_DIO
tm1629.brightness!: 3

Current Framebuffer

tm1629.raw.show, tm1629.show, tm1629.raw.clear, tm1629.clear, tm1629.fill, tm1629.invert, tm1629.shiftLeft, tm1629.shiftRight, tm1629.shiftUp, tm1629.shiftDown (FFI / board library)

Layer: board library
Behavior: Flush the current framebuffer, clear it, fill it, invert it, or shift it in any cardinal direction. Use these before or after higher-level drawing helpers depending on the effect you want.
Example:

tm1629.clear:
tm1629.fill:
tm1629.shiftLeft:
tm1629.show:

tm1629.raw.row@, tm1629.raw.row!, tm1629.row@, tm1629.row!, tm1629.pixel@, tm1629.pixel!, tm1629.plot@, tm1629.plot!, tm1629.toggle! (FFI / board library)

Layer: board library
Behavior: Read and write rows and pixels in the current framebuffer. The plot@ and plot! names are aliases for the pixel operations.
Example:

tm1629.pixel!: 5, 2, true
tm1629.row@: 2

Next-Frame Buffer

tm1629.raw.next@, tm1629.raw.next!, tm1629.raw.nextClear, tm1629.nextClear, tm1629.raw.nextPixel!, tm1629.nextPixel!, tm1629.raw.commitNext, tm1629.commitNext (FFI / board library)

Layer: board library
Behavior: Build the next frame separately from the current frame, inspect or set staged rows directly when needed, and then commit the staged buffer in one step. This is the right layer for animation logic that should avoid tearing.
Example:

tm1629.nextClear:
tm1629.nextPixel!: 2, 3, true
tm1629.commitNext:

Drawing Helpers

tm1629.raw.line, tm1629.hLine, tm1629.vLine, tm1629.raw.rect, tm1629.rect, tm1629.raw.fillRect, tm1629.fillRect (FFI / board library)

Layer: board library
Behavior: Draw lines and rectangles against the current framebuffer. The raw surface exposes the generalized primitives; the higher-level surface adds the readable Frothy wrappers.
Example:

tm1629.hLine: 2, 1, 5, true
tm1629.fillRect: 1, 1, 3, 2, true

tm1629.eachXY, tm1629.populate, tm1629.blit, tm1629.lifeStep (board library)

Layer: board library
Behavior: Higher-level Frothy-native helpers for procedural drawing, sprite copy, and simple cellular-automata stepping.
Example:

tm1629.populate: fn with x, y [ ((x + y) % 2) == 1 ]
tm1629.show: