-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPIO Drive Strength Constants #983
Comments
Yes, unfortunately, the naming for the GPIO Drive strengths is non-trivial and confusing with all the possible configurations. TLDR >>: The current The 15 MCUs in the MSDK do not support the same set of drive strength values - such as cases like this. Even certain pins of an MCU won't follow the same set of drive strengths as the other pins on that same MCU. Not only that, the drive strengths of certain MCUs could also be inconsistent when the GPIO pin is in VDDIO or VDDIOH voltage setting (GPIO_VSSEL). In short, there are many possible drive strength values that a pin can be set to (1mA,2mA,4mA,6mA,8mA,10mA), and each could need to set a different GPIO_DS[2] register value depending on the condition of the GPIO.
This is just an all-encompassing example of possible register configurations if we use the drive strength values for the enum names. Ultimately, we settled with However, as you've pointed out though, it's not well documented to indicate that the enum names of Hope this explanation makes sense! It gets confusing quick when it comes to naming, so let me know if I need to clarify. |
I think the PR helps a little bit, but still doesn't really address the root issue that we are not abstracting away this complexity from the user at all. Yes, this is easier to maintain for us but it's almost a useless abstraction. Deciphering what drive strength 0 means is not a straightforward task for a user. I agree that the top-level enum should be an actual current value. The role of the |
There looks to be discrepancies between different part datasheets as well as within code of what the values for GPIO drive strength represents.
The PBU support team confirmed the MAX32672 datasheet is correct, in that the drive strength is not a linear mapping between the bitfield and the actual current value.
It is recommended that the mxc_gpio_drvstr_t enum names be more in line with the actual values. From this:
To something like this:
Other parts in the MAX32 family should be checked against the hardware implementation and against the datasheet. For example, the MAX32690 has this, which is 2mA and 4mA flipped from the MAX32672. Are both datasheets correct and the values are different, or is one erroneous?
The text was updated successfully, but these errors were encountered: