|
tin
1.5.9
|
tin is a C++ framework for developing deterministic real-time C++ software for bare-metal, arm, and x86 architectures. It gives teams a bounded runtime substrate, explicit behavior models, portable I/O contracts, platform boundaries, and adapter contracts.
The core idea is simple: raw system inputs should become typed local events, and typed local events should drive explicit behavior. Queues, channels, timers, tasks, adapters, and state machines should be visible enough to review and bounded enough to deploy on constrained targets.
Use tin when a system needs:
tin is organized around small public surfaces. tsm models behavior, runtime moves events and schedules bounded work, tio describes portable I/O contracts, thal describes target adapter contracts, and tin brings those pieces together.
Use tin.md for the main API entry points, architecture.md for dependency rules, and developer_onboarding.md when contributing changes.
A product team may start with behavior:
Build a surgical-assist arm controller that can boot safely, run self-tests, coordinate console readiness, enter teleoperation, pause into safe hold, recover, and fault predictably.
The same shape applies outside robotics: a trading engine can model market-data ingest, risk checks, order routing, throttling, recovery, and fault behavior as explicit states and typed events while keeping queues, timers, and dispatch bounded.
At this level, the important questions are behavioral:
tin keeps the layers separated:
tsm owns behavior: booting, self-test, ready, teleoperation, safe hold, and fault handling.runtime owns bounded event queues, actors, typed ports, timers, tasks, channels, and deterministic dispatch.tio owns portable device-facing contracts for sensors, pedals, encoders, drives, and other adapter boundaries.thal owns target profiles and platform bindings for Linux simulation, RTOS targets, and board-specific adapters.The product benefit is a reviewable behavior core that is not tangled into middleware callbacks, driver code, or ad hoc timers.
At the behavior layer, that can start as a normal tsm definition:
A platform team may start with infrastructure:
We have interrupts, drivers, periodic ticks, CAN frames, UART messages, task wakeups, and fault signals. Every product reimplements queues, callbacks, timers, and glue differently.
At this level, the important questions are mechanical:
tin gives that infrastructure a deterministic shape. A driver can publish into a fixed-capacity channel, a task can translate samples into typed events, and a tsm machine can handle those events as explicit behavior. The low-level mechanics stay bounded while the product logic stays readable.
At the runtime layer, that can start as a bounded channel and typed event translation:
The result is a product line where each surface can document its own API and examples while sharing deterministic runtime infrastructure underneath.