Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
0f9fb09a
Commit
0f9fb09a
authored
8 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
GPIO driver: Add an IOCTL command to get the pin type
parent
d0f6a23a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/ioexpander/gpio.c
+15
-0
15 additions, 0 deletions
drivers/ioexpander/gpio.c
include/nuttx/ioexpander/gpio.h
+6
-1
6 additions, 1 deletion
include/nuttx/ioexpander/gpio.h
with
21 additions
and
1 deletion
drivers/ioexpander/gpio.c
+
15
−
0
View file @
0f9fb09a
...
...
@@ -211,6 +211,21 @@ static int gpio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
}
break
;
/* Command: GPIOC_PINTYPE
* Description: Return the GPIO pin type.
* Argument: A pointer to an instance of type enum gpio_pintype_e
*/
case
GPIOC_PINTYPE
:
{
FAR
enum
gpio_pintype_e
*
ptr
=
(
FAR
enum
gpio_pintype_e
*
)((
uintptr_t
)
arg
);
DEBUGASSERT
(
ptr
!=
NULL
);
*
ptr
=
dev
->
gp_pintype
;
ret
=
OK
;
}
break
;
/* Command: GPIOC_REGISTER
* Description: Register to receive a signal whenever there an
* interrupt is received on an input gpio pin. This
...
...
This diff is collapsed.
Click to expand it.
include/nuttx/ioexpander/gpio.h
+
6
−
1
View file @
0f9fb09a
...
...
@@ -60,6 +60,10 @@
* Argument: A pointer to an bool value to receive the result:
* false=low value; true=high value.
*
* Command: GPIOC_PINTYPE
* Description: Return the GPIO pin type.
* Argument: A pointer to an instance of type enum gpio_pintype_e
*
* Command: GPIOC_REGISTER
* Description: Register to receive a signal whenever there an interrupt
* is received on an input gpio pin. This feature, of course,
...
...
@@ -70,7 +74,8 @@
#define GPIOC_WRITE _GPIOC(1)
#define GPIOC_READ _GPIOC(2)
#define GPIOC_REGISTER _GPIOC(3)
#define GPIOC_PINTYPE _GPIOC(3)
#define GPIOC_REGISTER _GPIOC(4)
/****************************************************************************
* Public Types
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment