Apparently nim doesn't like this:
type
## Pin direction, in or out
Direction* = enum
in, out
it complains that out is a key word.You can apply the pure pragma to get fully qualified enums, see http://nim-lang.org/docs/manual.html#types-enumeration-types
I am not sure if that really solves your problem, but it should solve it it my opinion.
Making it a pure enum still does not work. One could escape them to stop it being keywords but I think choosing other words would be better.
type
## Pin direction, in or out
Direction* = enum
`in`, `out`