NeoBirth / ADXL343.rs

Rust ADXL343 accelerometer driver which uses I²C via embedded-hal
Apache License 2.0
7 stars 8 forks source link

register module is not public #37

Open tufelkinder opened 2 years ago

tufelkinder commented 2 years ago

When I try to use the adxl343 module in my app and set register values, I receive the compile error that the adxl343::register module is not public. The Register enum is public, but it looks like the module needs to be as well.

tarcieri commented 2 years ago

Which type are you trying to access? Register?

If so, a PR would be accepted to re-export it from the toplevel.

tufelkinder commented 2 years ago

Correct: for example, I'm trying to call adxl343.write_register(Register::INT_ENABLE, <value>); and write_register() expects a Register Enum value as the first parameter, unless I'm mistaken.

If there is more to this than just redesignating mod register as pub mod register I'm probably not qualified...

tarcieri commented 2 years ago

You just need to add it to the re-exports here, and remove the private import:

https://github.com/NeoBirth/ADXL343.rs/blob/develop/src/lib.rs#L15