Open d-m-bailey opened 8 months ago
output enable is not used when oe_override is not set, so it is clear that the 3rd bit should have been set and not the 4th bit:
#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x005
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x004
@RTimothyEdwards I only added the INPUT_ENABLE
bit. I did not change the OUTPUT_ENABLE
bit. My understanding was that OUTPUT_ENABLE
was irrelevant.
#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x00d
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x00c
Is this a problem?
@d-m-bailey : Not a real problem, no, but maybe confusing to the end-user. I interpreted the original problem as just being an accidental bit shift, so fixed it accordingly. But what we really need is just to have a truth table somewhere to properly document the function, presumably in comment lines in the defs.h
file:
OE OE_override function
--------------------------------------------------------------------------------------------------------
0 1 output (forced) disabled
1 1 output (forced) enabled
X 0 output determined by OE input, not OE configuration bit
input is disabled.
GPIO_MODE_MGMT_STD_BIDIRECTIONAL
should be0x005
or0x00d
GPIO_MODE_USER_STD_BIDIRECTIONAL
should be0x004
or0x00c
(withOE_OVERRIDE
low,OUTPUT_enable
is irrelevant.)