Skip to content

Hardware Library Guidelines

Victor Nakoryakov edited this page May 8, 2019 · 2 revisions

Device node

Provide the very basic device descriptor with xxx-device node producing a custom-typed DEV output

Action nodes

Create action nodes for various aspects of the device

Action nodes are dumb

Do not place much magic behind action nodes. Offload throttling, checking, protection to other levels.

Provide straightforward DO/DONE pulses that just force the action execution

Action nodes encourage daisy-chaining

For action nodes chain DEV to DEV'

Mutexes are explicit

If an action is a long-running process provide MUX and MUX' pins to explicitly pass a mutex to lock

Provide quickstart node

Create quickstart nodes for the most common usage scenarios with the simplest interface possible.

Decompose the device custom type to plain port and configuration parameter pins.

Quickstart nodes control pins

If the function managed by an actuator quickstart node is idempotent (e.g. LED, servo, text LCD), use boolean ACT for control; otherwise, use pulse UPD.

If the function managed by a sensor quickstart node presumes fast polling (e.g. button, encoder), use boolean ACT for control; otherwise, use pulse UPD.

Provide output counterparts for control inputs:

  • ACTACK (a hook to handle errors)
  • UPDOK (may be a part of an imperative chain)

Quickstart should throttle if necessary

If the hardware cannot execute an action reliably with an arbitrary rate, place throttle inside its quickstart node.