piface / libpifacedigital

A simple C library for controlling PiFace Digital.
GNU General Public License v3.0
16 stars 10 forks source link

No function for Pull Up Resistors #12

Closed kuelomisli closed 8 years ago

kuelomisli commented 8 years ago

In the C Library there is no function to directly enable/disable the Pull Up Resistors.

For the Input, I found out their hardware address as 0x0d, so if you just add the macro, for example

[code]#define PULL_UPS 0x0d [/code]

you could set/unset them with the pifacedigital_write_reg(val, PULL_UPS, piface_hardw_addr).

tompreston commented 8 years ago

All of the registers are defined in mcp23s17.h. If you include this into your program you can use them - as you have correctly stated - with the pifacedigital_write_reg function.

I hope this helps.

https://github.com/piface/libmcp23s17/blob/master/src/mcp23s17.h#L48-L49

kuelomisli commented 8 years ago

Thanks a lot for responding so quickly! That does indeed help. Will close the issue.