Skip to content
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

Improved Linux GPIO Driver Using Chardev #2943

Merged
merged 19 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ changeme
CHANNELID
CHANS
Chieu
CHIPINFO
CHK
CHNG
CIRCULARSTATE
Expand Down Expand Up @@ -284,6 +285,7 @@ EVENTARRAY
EVENTBOOL
EVENTID
eventname
eventflags
EVENTPRIMITIVE
evr
evt
Expand Down Expand Up @@ -366,6 +368,9 @@ Gorang
GPGGA
GPINT
gpio
gpiochip
gpioevent
gpiohandle
Graphviz
grayscales
grnd
Expand All @@ -376,6 +381,7 @@ gtest
gtimeout
Guire
handcoded
handleflags
hardtoaccess
hashvalue
hdr
Expand Down Expand Up @@ -491,7 +497,10 @@ libiconv
LIBLOC
lic
lindent
LINEEVENT
LINEHANDLE
linelength
lineoffset
lineroo
listdir
Listst
Expand Down Expand Up @@ -882,7 +891,6 @@ subhist
subhistory
subseconds
subtargets
subtopologies
subtopology
suppr
suseconds
Expand Down
13 changes: 11 additions & 2 deletions Drv/GpioDriverPorts/GpioDriverPorts.fpp
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

}
9 changes: 9 additions & 0 deletions Drv/Interfaces/GpioInterface.fppi
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
8 changes: 4 additions & 4 deletions Drv/LinuxGpioDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ endif()
if(FPRIME_USE_STUBBED_DRIVERS)
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverComponentImplCommon.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverComponentImplStub.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverCommon.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverStub.cpp"
)
register_fprime_module()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverComponentImplCommon.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverComponentImpl.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriverCommon.cpp"
"${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver.cpp"
)
register_fprime_module()
endif()
Expand Down
62 changes: 0 additions & 62 deletions Drv/LinuxGpioDriver/Events.fppi

This file was deleted.

Loading
Loading