tnt01/19/2022, 1:03 PM
Tim Edwards01/19/2022, 2:13 PM
module. As you noted above, the DM setting that enables pull-up or pull-down has to be combined with OEB set to zero and the output value set to 1 (pullup) or 0 (pulldown).
line 239 specifically overrides the output value appropriately for pullup or pulldown function. The caveats are: (1) There is no equivalent override for OEB, mainly because it's just a configuration bit; and (2) There is no automatic override of the output value for user, as opposed to management, pullup or pulldown mode. Number (2) seems to be an oversight, while (1) is intentional. Conclusions: (1) The bit definitions for GPIO_MODE_[USER/MGMT]_STD_INPUT_[PULLUP/PULLDOWN] all need to clear bit one or else the function won't work properly. That means the definitions should be fixed as follows:
And (2), For the two user modes, the output must be set appropriately to 0 for pulldown function and 1 for pullup function, and this oversight should be corrected for the next version of caravel/caravan.
#define GPIO_MODE_MGMT_STD_INPUT_PULLDOWN 0x0801 #define GPIO_MODE_MGMT_STD_INPUT_PULLUP 0x0c01 #define GPIO_MODE_USER_STD_INPUT_PULLDOWN 0x0800 #define GPIO_MODE_USER_STD_INPUT_PULLUP 0x0c00
tnt01/19/2022, 2:36 PM
Tim Edwards01/19/2022, 3:11 PM
tnt01/19/2022, 3:36 PM
Tim Edwards01/19/2022, 3:39 PM
tnt01/19/2022, 3:42 PM
Tim Edwards01/19/2022, 5:55 PM