Hardware pin names are usually marked on the circuit boards, that defines a board namespace for pins.
Operating systems, such as Linux, or Zephyr define a pin name mapping that is consistent across the boards supported by the OS.
There is definitely a use case to support OS pin namespace in implementations.
However, supporting board namespaces is very convenient and lowers the bar for simple programs.
The problem is when these name spaces clash. Since we don't control boards nor operating systems, we can't impose a rule to keep those namespaces disjunct. Therefore we can't use both namespaces in the same time (in general), with or without fallback to the other.
IMHO we have the following clean options:
- Support only OS (system) pin namespace. Keep pin names completely opaque, and say in the spec that the meaning is defined by the OS documentation.
- Support both board and system namespaces. The developer can choose the namespace when opening a pin. There is a default namespace, which I suggest to be the board namespace, for developer convenience vs manufacturer convenience. Just look at the board and be (almost) sure the labels will work in this API.
In PR #40 currently option 2 is supported, but it can be changed.
@pfalcon, @grgustaf, @nagineni, @poussa please comment.