Fishwaldo commented on code in PR #19871:
URL: https://github.com/apache/nuttx/pull/19871#discussion_r3801054331
##########
include/nuttx/pinctrl/pinctrl.h:
##########
@@ -56,13 +58,47 @@
* Description: Select gpio function of pinctrl pin
* Argument: The uint32_t pinctrl number
*
+ * Command: PINCTRLC_GETPAD
+ * Description: Describe the current configuration of one pad
+ * Argument: A pointer to an instance of struct pinctrl_getpad_s
+ *
*/
#define PINCTRLC_SETFUNCTION _PINCTRLIOC(1)
#define PINCTRLC_SETSTRENGTH _PINCTRLIOC(2)
#define PINCTRLC_SETDRIVER _PINCTRLIOC(3)
#define PINCTRLC_SETSLEWRATE _PINCTRLIOC(4)
#define PINCTRLC_SELECTGPIO _PINCTRLIOC(5)
+#define PINCTRLC_GETPAD _PINCTRLIOC(6)
+
+/* Validity bits for struct pinctrl_padinfo_s. A field is meaningful only
+ * when its bit is set in the have member: a pad may have no function
+ * select, no bias, no drive strength.
+ */
+
+#define PINCTRL_HAVE_FUNCTION (1 << 0)
+#define PINCTRL_HAVE_STRENGTH (1 << 1)
+#define PINCTRL_HAVE_PULL (1 << 2)
+#define PINCTRL_HAVE_SLEWRATE (1 << 3)
+#define PINCTRL_HAVE_INPUT (1 << 4)
+#define PINCTRL_HAVE_SCHMITT (1 << 5)
+
+#define PINCTRL_NAME_MAX 24 /* Longest name plus a terminator */
+#define PINCTRL_EXTRA_MAX 48
+
+/* One pad in a controller's name table: the pad's name, then the name of
+ * each documented function select in select order. Pass NULL in a slot
+ * whose select the manual does not document. The compound literal sizes
+ * the array to exactly what is listed; at file scope it has static
+ * storage.
+ */
+
+#define PINCTRL_PADNAME(padname, ...) \
+ { \
+ (padname), (FAR const char *const[]){__VA_ARGS__}, \
+ sizeof((FAR const char *const[]){__VA_ARGS__}) / \
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]