-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved Linux GPIO Driver Using Chardev (#2943)
* Linux GPIO Driver refactor WIP * Initial new GPIO driver * Fixing toolchain warning * Adding GPIO interface * Adding in more states * Added interrupts to GPIO driver * Fixing build errors * Formatting GPIO driver * Fix spelling * Fixing config check * Quality status * Review fixes * Clearing GPIO struct values * Updating to new RawTime * Fixing take -> now * Fixing quality error * Fixing second review comments * Tested: read, write, interupt rising/falling/both * Final review comment
- Loading branch information
Showing
20 changed files
with
637 additions
and
1,089 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
module Drv { | ||
enum GpioStatus { | ||
OP_OK @< Operation succeeded | ||
NOT_OPENED @< Pin was never opened | ||
INVALID_MODE @< Operation not permitted with current configuration | ||
UNKNOWN_ERROR @< An unknown error occurred | ||
} | ||
} | ||
|
||
module Drv { | ||
|
||
port GpioWrite( | ||
$state: Fw.Logic | ||
) | ||
) -> GpioStatus | ||
|
||
} | ||
|
||
module Drv { | ||
|
||
port GpioRead( | ||
ref $state: Fw.Logic | ||
) | ||
) -> GpioStatus | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
@ Port used to write to a GPIO pin | ||
sync input port gpioWrite: Drv.GpioWrite | ||
|
||
@ Port used to read from a GPIO pin | ||
sync input port gpioRead: Drv.GpioRead | ||
|
||
@ Port used to indicate transition on the GPIO pin | ||
output port gpioInterrupt: Svc.Cycle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.