jperkin / node-rpio

Raspberry Pi GPIO library for node.js
857 stars 123 forks source link

Function bcm2835_i2c_read_register_rs() is not exposed to nodejs #92

Closed VigibotDev closed 4 years ago

VigibotDev commented 5 years ago

Hello,

I finished to implement a CW2015 power management chip on my robots and I need to do the proper I2C NodeJS supervision.

I can access successfully to the registers of my chip with i2c_read() -> bcm2835_i2c_read(char* buf, uint32_t len) underlying method but I need to read the entire 256 bytes frame to get only four bytes of data. It work but it's not optimized.

I need an access to bcm2835_i2c_read_register_rs(char regaddr, char buf, uint32_t len) to put an offset and reduce required i2c bandwidth.

Can you expose it ? I try myself to mod your rpio.cc and add I put code here if it work.

Thanks

jperkin commented 4 years ago

I added this in b1928174b32d52d495ef64b6b331076d95ed2307 but forgot there was also this issue asking for them. Sorry it took so long. If you're able to test that they work correctly that would be great.