tessel / tessel-rust

Rust driver for Tessel 2.
https://docs.rs/tessel/
86 stars 12 forks source link

Use an enum for commands #31

Closed Dr-Emann closed 8 years ago

Dr-Emann commented 8 years ago

Because possible commands are hard-coded into the tessel C bridge, I don't feel we're losing any real extensibility. Also, you can also call raw_write to emulate any command you want.

tcr commented 8 years ago

For support for arbitrary serial streams (namely thinking of Neopixel support) we will actually probably need to add more items to the tessel C bridge over time. That said, I think this code demonstrates an enum as a list of supported commands by the driver at the current time makes sense, and bundling the opcode with its body is very nice.

lgtm, merging. Thanks @Dr-Emann!